Total Complexity | 3 |
Total Lines | 33 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
9 | class SuperCacheInvalidationHelperTest extends TestCase |
||
10 | { |
||
11 | protected SuperCacheInvalidationHelper $helper; |
||
12 | |||
13 | protected function setUp(): void |
||
14 | { |
||
15 | parent::setUp(); |
||
16 | $this->helper = new SuperCacheInvalidationHelper(); |
||
17 | } |
||
18 | |||
19 | public function testInsertInvalidationEvent(): void |
||
20 | { |
||
21 | // Mock DB insert |
||
22 | DB::shouldReceive('table->insertGetId')->once()->andReturn(1); |
||
23 | |||
24 | $this->helper->insertInvalidationEvent('tag', 'test_tag', 'Test reason', 0); |
||
25 | |||
26 | // Assertions are handled by Mockery expectations |
||
27 | } |
||
28 | |||
29 | public function testInsertInvalidationEventWithAssociations(): void |
||
30 | { |
||
31 | // Mock DB insert |
||
32 | DB::shouldReceive('table->insertGetId')->once()->andReturn(1); |
||
33 | DB::shouldReceive('table->insert')->once(); |
||
34 | |||
35 | $this->helper->insertInvalidationEvent( |
||
36 | 'tag', |
||
37 | 'article_ID:7', |
||
38 | 'Article 7 removed', |
||
39 | 0, |
||
40 | [ |
||
41 | ['type' => 'tag', 'identifier' => 'plp:sport'], |
||
42 | ] |
||
48 |