Passed
Push — main ( 0cf387...5995aa )
by Lorenzo
03:04
created

PruneCacheInvalidationDataTest::setUp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 4
rs 10
1
<?php
2
3
namespace Padosoft\SuperCacheInvalidate\Test\Unit;
4
5
use PHPUnit\Framework\TestCase;
6
use Illuminate\Support\Facades\DB;
7
use Padosoft\SuperCacheInvalidate\Console\PruneCacheInvalidationDataCommand;
8
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
37
        // Assertions are handled by Mockery expectations
38
    }
39
}
40