Laravel 10 (#4706)
This commit is contained in:
parent
ad4ddc6300
commit
1d38b4f0e2
136 changed files with 1735 additions and 2008 deletions
|
@ -2,8 +2,6 @@
|
|||
|
||||
namespace Pterodactyl\Tests\Integration\Services\Servers;
|
||||
|
||||
use Mockery;
|
||||
use Exception;
|
||||
use Mockery\MockInterface;
|
||||
use GuzzleHttp\Psr7\Request;
|
||||
use GuzzleHttp\Psr7\Response;
|
||||
|
@ -35,8 +33,8 @@ class ServerDeletionServiceTest extends IntegrationTestCase
|
|||
// There will be some log calls during this test, don't actually write to the disk.
|
||||
config()->set('logging.default', 'null');
|
||||
|
||||
$this->daemonServerRepository = Mockery::mock(DaemonServerRepository::class);
|
||||
$this->databaseManagementService = Mockery::mock(DatabaseManagementService::class);
|
||||
$this->daemonServerRepository = \Mockery::mock(DaemonServerRepository::class);
|
||||
$this->databaseManagementService = \Mockery::mock(DatabaseManagementService::class);
|
||||
|
||||
$this->app->instance(DaemonServerRepository::class, $this->daemonServerRepository);
|
||||
$this->app->instance(DatabaseManagementService::class, $this->databaseManagementService);
|
||||
|
@ -120,11 +118,11 @@ class ServerDeletionServiceTest extends IntegrationTestCase
|
|||
$server->refresh();
|
||||
|
||||
$this->daemonServerRepository->expects('setServer->delete')->withNoArgs()->andReturnUndefined();
|
||||
$this->databaseManagementService->expects('delete')->with(Mockery::on(function ($value) use ($db) {
|
||||
$this->databaseManagementService->expects('delete')->with(\Mockery::on(function ($value) use ($db) {
|
||||
return $value instanceof Database && $value->id === $db->id;
|
||||
}))->andThrows(new Exception());
|
||||
}))->andThrows(new \Exception());
|
||||
|
||||
$this->expectException(Exception::class);
|
||||
$this->expectException(\Exception::class);
|
||||
$this->getService()->handle($server);
|
||||
|
||||
$this->assertDatabaseHas('servers', ['id' => $server->id]);
|
||||
|
@ -145,9 +143,9 @@ class ServerDeletionServiceTest extends IntegrationTestCase
|
|||
$server->refresh();
|
||||
|
||||
$this->daemonServerRepository->expects('setServer->delete')->withNoArgs()->andReturnUndefined();
|
||||
$this->databaseManagementService->expects('delete')->with(Mockery::on(function ($value) use ($db) {
|
||||
$this->databaseManagementService->expects('delete')->with(\Mockery::on(function ($value) use ($db) {
|
||||
return $value instanceof Database && $value->id === $db->id;
|
||||
}))->andThrows(new Exception());
|
||||
}))->andThrows(new \Exception());
|
||||
|
||||
$this->getService()->withForce(true)->handle($server);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue