| Total Complexity | 2 |
| Total Lines | 27 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 9 | class PruneCacheInvalidationDataTest extends TestCase |
||
| 10 | { |
||
| 11 | protected PruneCacheInvalidationDataCommand $command; |
||
| 12 | |||
| 13 | protected function setUp(): void |
||
| 14 | { |
||
| 15 | parent::setUp(); |
||
| 16 | $this->command = new PruneCacheInvalidationDataCommand(); |
||
| 17 | } |
||
| 18 | |||
| 19 | public function testPruneTables(): void |
||
| 20 | { |
||
| 21 | // Mock DB queries |
||
| 22 | DB::shouldReceive('select') |
||
| 23 | ->times(3) |
||
| 24 | ->andReturn([ |
||
| 25 | (object)[ |
||
| 26 | 'PARTITION_NAME' => 'p202401', |
||
| 27 | 'PARTITION_DESCRIPTION' => '202401', |
||
| 28 | ], |
||
| 29 | ]) |
||
| 30 | ; |
||
| 31 | |||
| 32 | DB::shouldReceive('statement')->times(3); |
||
| 33 | |||
| 34 | // Run the command |
||
| 35 | $this->command->handle(); |
||
| 36 | |||
| 40 |