Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 19 additions & 19 deletions tests/PushAndPopWithDelayTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,25 +38,7 @@ protected function setUp(): void
$this->config = config(QueueConfig::class);
}

public static function handlerProvider(): iterable
{
return [
[
'database', // name
'CodeIgniter\Queue\Handlers\DatabaseHandler', // class
],
[
'redis',
'CodeIgniter\Queue\Handlers\RedisHandler',
],
[
'predis',
'CodeIgniter\Queue\Handlers\PredisHandler',
],
];
}

#[DataProvider('handlerProvider')]
#[DataProvider('providePushAndPopWithDelay')]
public function testPushAndPopWithDelay(string $name, string $class): void
{
Time::setTestNow('2023-12-29 14:15:16');
Expand Down Expand Up @@ -100,4 +82,22 @@ public function testPushAndPopWithDelay(string $name, string $class): void
$payload = ['job' => 'success', 'data' => ['key1' => 'value1'], 'metadata' => []];
$this->assertSame($payload, $result->payload);
}

public static function providePushAndPopWithDelay(): iterable
{
return [
[
'database', // name
'CodeIgniter\Queue\Handlers\DatabaseHandler', // class
],
[
'redis',
'CodeIgniter\Queue\Handlers\RedisHandler',
],
[
'predis',
'CodeIgniter\Queue\Handlers\PredisHandler',
],
];
}
}
Loading