Laravel 10 (#4706)
This commit is contained in:
parent
ad4ddc6300
commit
1d38b4f0e2
136 changed files with 1735 additions and 2008 deletions
|
@ -2,11 +2,9 @@
|
|||
|
||||
namespace Pterodactyl\Tests\Integration\Services\Schedules;
|
||||
|
||||
use Mockery;
|
||||
use Exception;
|
||||
use Carbon\CarbonImmutable;
|
||||
use Pterodactyl\Models\Task;
|
||||
use InvalidArgumentException;
|
||||
use Pterodactyl\Models\Schedule;
|
||||
use Illuminate\Support\Facades\Bus;
|
||||
use Illuminate\Contracts\Bus\Dispatcher;
|
||||
|
@ -47,7 +45,7 @@ class ProcessScheduleServiceTest extends IntegrationTestCase
|
|||
/** @var \Pterodactyl\Models\Task $task */
|
||||
$task = Task::factory()->create(['schedule_id' => $schedule->id, 'sequence_id' => 1]);
|
||||
|
||||
$this->expectException(InvalidArgumentException::class);
|
||||
$this->expectException(\InvalidArgumentException::class);
|
||||
|
||||
$this->getService()->handle($schedule);
|
||||
|
||||
|
@ -126,7 +124,7 @@ class ProcessScheduleServiceTest extends IntegrationTestCase
|
|||
*/
|
||||
public function testTaskDispatchedNowIsResetProperlyIfErrorIsEncountered()
|
||||
{
|
||||
$this->swap(Dispatcher::class, $dispatcher = Mockery::mock(Dispatcher::class));
|
||||
$this->swap(Dispatcher::class, $dispatcher = \Mockery::mock(Dispatcher::class));
|
||||
|
||||
$server = $this->createServerModel();
|
||||
/** @var \Pterodactyl\Models\Schedule $schedule */
|
||||
|
@ -134,9 +132,9 @@ class ProcessScheduleServiceTest extends IntegrationTestCase
|
|||
/** @var \Pterodactyl\Models\Task $task */
|
||||
$task = Task::factory()->create(['schedule_id' => $schedule->id, 'sequence_id' => 1]);
|
||||
|
||||
$dispatcher->expects('dispatchNow')->andThrows(new Exception('Test thrown exception'));
|
||||
$dispatcher->expects('dispatchNow')->andThrows(new \Exception('Test thrown exception'));
|
||||
|
||||
$this->expectException(Exception::class);
|
||||
$this->expectException(\Exception::class);
|
||||
$this->expectExceptionMessage('Test thrown exception');
|
||||
|
||||
$this->getService()->handle($schedule, true);
|
||||
|
@ -150,7 +148,7 @@ class ProcessScheduleServiceTest extends IntegrationTestCase
|
|||
$this->assertDatabaseHas('tasks', ['id' => $task->id, 'is_queued' => false]);
|
||||
}
|
||||
|
||||
public function dispatchNowDataProvider(): array
|
||||
public static function dispatchNowDataProvider(): array
|
||||
{
|
||||
return [[true], [false]];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue