vmangos
This commit is contained in:
@@ -4,7 +4,7 @@ namespace Tests\Feature;
|
||||
|
||||
use App\Exceptions\DuplicateGameAccountException;
|
||||
use App\Exceptions\InviteCodeException;
|
||||
use App\Services\AzerothCoreAccountRegistrar;
|
||||
use App\Services\VMangosAccountRegistrar;
|
||||
use App\Services\InviteCodeService;
|
||||
use Closure;
|
||||
use Mockery\MockInterface;
|
||||
@@ -12,6 +12,13 @@ use Tests\TestCase;
|
||||
|
||||
class GameAccountRegistrationTest extends TestCase
|
||||
{
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
config(['moonwell.registration.require_invite_code' => true]);
|
||||
}
|
||||
|
||||
public function test_registration_form_submits_successfully(): void
|
||||
{
|
||||
$this->mock(InviteCodeService::class, function (MockInterface $mock): void {
|
||||
@@ -21,7 +28,7 @@ class GameAccountRegistrationTest extends TestCase
|
||||
->andReturnUsing(fn (string $code, string $username, Closure $callback): array => $callback());
|
||||
});
|
||||
|
||||
$this->mock(AzerothCoreAccountRegistrar::class, function (MockInterface $mock): void {
|
||||
$this->mock(VMangosAccountRegistrar::class, function (MockInterface $mock): void {
|
||||
$mock->shouldReceive('register')
|
||||
->once()
|
||||
->with('playerone', 'player@example.com', 'Pass1234')
|
||||
@@ -63,7 +70,7 @@ class GameAccountRegistrationTest extends TestCase
|
||||
$this->mock(InviteCodeService::class, function (MockInterface $mock): void {
|
||||
$mock->shouldNotReceive('redeemForRegistration');
|
||||
});
|
||||
$this->mock(AzerothCoreAccountRegistrar::class, function (MockInterface $mock): void {
|
||||
$this->mock(VMangosAccountRegistrar::class, function (MockInterface $mock): void {
|
||||
$mock->shouldReceive('register')
|
||||
->once()
|
||||
->with('playerone', 'player@example.com', 'Pass1234')
|
||||
@@ -87,7 +94,7 @@ class GameAccountRegistrationTest extends TestCase
|
||||
->andReturnUsing(fn (string $code, string $username, Closure $callback): array => $callback());
|
||||
});
|
||||
|
||||
$this->mock(AzerothCoreAccountRegistrar::class, function (MockInterface $mock): void {
|
||||
$this->mock(VMangosAccountRegistrar::class, function (MockInterface $mock): void {
|
||||
$mock->shouldReceive('register')
|
||||
->once()
|
||||
->andThrow(DuplicateGameAccountException::forUsername());
|
||||
|
||||
Reference in New Issue
Block a user