update tests to use new factories

This commit is contained in:
Matthew Penner
2021-01-15 18:24:10 -07:00
parent 0330716174
commit ebc6efc5f4
58 changed files with 270 additions and 231 deletions

View File

@@ -49,7 +49,7 @@ class AccessingValidServerTest extends MiddlewareTestCase
$this->expectException(AccessDeniedHttpException::class);
$this->expectExceptionMessage('Server is suspended and cannot be accessed.');
$model = factory(Server::class)->make(['suspended' => 1]);
$model = Server::factory()->make(['suspended' => 1]);
$this->request->shouldReceive('route->parameter')->with('server')->once()->andReturn('123456');
$this->request->shouldReceive('expectsJson')->withNoArgs()->once()->andReturn(true);
@@ -67,7 +67,7 @@ class AccessingValidServerTest extends MiddlewareTestCase
$this->expectException(ConflictHttpException::class);
$this->expectExceptionMessage('Server is still completing the installation process.');
$model = factory(Server::class)->make(['installed' => 0]);
$model = Server::factory()->make(['installed' => 0]);
$this->request->shouldReceive('route->parameter')->with('server')->once()->andReturn('123456');
$this->request->shouldReceive('expectsJson')->withNoArgs()->once()->andReturn(true);
@@ -101,7 +101,7 @@ class AccessingValidServerTest extends MiddlewareTestCase
*/
public function testValidServerProcess()
{
$model = factory(Server::class)->make();
$model = Server::factory()->make();
$this->request->shouldReceive('route->parameter')->with('server')->once()->andReturn('123456');
$this->request->shouldReceive('expectsJson')->withNoArgs()->once()->andReturn(false);
@@ -126,9 +126,9 @@ class AccessingValidServerTest extends MiddlewareTestCase
$this->refreshApplication();
return [
[factory(Server::class)->make(['suspended' => 1]), 'errors.suspended', 403],
[factory(Server::class)->make(['installed' => 0]), 'errors.installing', 409],
[factory(Server::class)->make(['installed' => 2]), 'errors.installing', 409],
[Server::factory()->make(['suspended' => 1]), 'errors.suspended', 403],
[Server::factory()->make(['installed' => 0]), 'errors.installing', 409],
[Server::factory()->make(['installed' => 2]), 'errors.installing', 409],
];
}