|
2 | 2 |
|
3 | 3 | namespace MongoDB\Laravel\Tests\Queue\Failed;
|
4 | 4 |
|
| 5 | +use Illuminate\Queue\Failed\DatabaseFailedJobProvider; |
5 | 6 | use Illuminate\Support\Facades\Date;
|
6 | 7 | use Illuminate\Support\Facades\DB;
|
7 | 8 | use MongoDB\BSON\ObjectId;
|
8 | 9 | use MongoDB\BSON\UTCDateTime;
|
9 |
| -use MongoDB\Laravel\Queue\Failed\MongoFailedJobProvider; |
10 | 10 | use MongoDB\Laravel\Tests\TestCase;
|
11 | 11 | use OutOfBoundsException;
|
12 | 12 |
|
13 | 13 | use function array_map;
|
14 | 14 | use function range;
|
15 | 15 | use function sprintf;
|
16 | 16 |
|
17 |
| -class MongoFailedJobProviderTest extends TestCase |
| 17 | +/** |
| 18 | + * Ensure the Laravel class {@see DatabaseFailedJobProvider} works with a MongoDB connection. |
| 19 | + */ |
| 20 | +class DatabaseFailedJobProviderTest extends TestCase |
18 | 21 | {
|
19 | 22 | public function setUp(): void
|
20 | 23 | {
|
@@ -57,8 +60,7 @@ public function testLog(): void
|
57 | 60 | $this->assertSame('default', $inserted->queue);
|
58 | 61 | $this->assertSame('{"foo":"bar"}', $inserted->payload);
|
59 | 62 | $this->assertStringContainsString('OutOfBoundsException: This is the error', $inserted->exception);
|
60 |
| - $this->assertInstanceOf(ObjectId::class, $inserted->_id); |
61 |
| - $this->assertSame((string) $inserted->_id, $inserted->id); |
| 63 | + $this->assertInstanceOf(ObjectId::class, $inserted->id); |
62 | 64 | }
|
63 | 65 |
|
64 | 66 | public function testCount(): void
|
@@ -143,8 +145,8 @@ public function testPrune(): void
|
143 | 145 | $this->assertEquals(3, $provider->count());
|
144 | 146 | }
|
145 | 147 |
|
146 |
| - private function getProvider(): MongoFailedJobProvider |
| 148 | + private function getProvider(): DatabaseFailedJobProvider |
147 | 149 | {
|
148 |
| - return new MongoFailedJobProvider(DB::getFacadeRoot(), '', 'failed_jobs'); |
| 150 | + return new DatabaseFailedJobProvider(DB::getFacadeRoot(), '', 'failed_jobs'); |
149 | 151 | }
|
150 | 152 | }
|
0 commit comments