| Conditions | 1 |
| Paths | 1 |
| Total Lines | 22 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | function testQueue() |
||
| 16 | { |
||
| 17 | $queue = $this->app->get(Queue::class); |
||
| 18 | $queue->init('testing'); |
||
| 19 | $queue->truncate('testing'); |
||
| 20 | |||
| 21 | $data = [ |
||
| 22 | 'name' => 'testing', |
||
| 23 | 'timestamp' => time() |
||
| 24 | ]; |
||
| 25 | |||
| 26 | |||
| 27 | $queue->put('testing', $data); |
||
| 28 | $task = $queue->take('testing'); |
||
| 29 | |||
| 30 | $this->assertNotNull($task); |
||
| 31 | $this->assertEquals($task[2], $data); |
||
| 32 | |||
| 33 | $queue->ack('testing', $task[0]); |
||
| 34 | $task = $queue->take('testing', 1); |
||
| 35 | $this->assertNull($task); |
||
| 36 | } |
||
| 37 | } |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.