Skip to content

Commit 371ba8d

Browse files
committed
fix carbon
1 parent 8be070f commit 371ba8d

File tree

5 files changed

+57
-57
lines changed

5 files changed

+57
-57
lines changed

composer.lock

Lines changed: 35 additions & 34 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Console/ProcessCacheInvalidationEventsCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ protected function processEvents(): void
114114
$eventsToUpdate = [];
115115
$eventsAll = [];
116116
foreach ($unique_events as $event) {
117-
$elapsed = $processingStartTime->diffInSeconds($event->event_time);
117+
$elapsed = $processingStartTime->diffInSeconds($event->event_time, true);
118118
$typeFilter = $event->type;
119119
$identifierFilter = $event->identifier;
120120
if ($elapsed < $this->invalidation_window) {

tests/Unit/ProcessCacheInvalidationEventsTest.php

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,18 @@ public function test_process_events_with_associated_identifiers_within_window():
2424
// Mock data
2525
$now = now();
2626
$events = collect([
27-
(object)[
28-
'id' => 1,
29-
'type' => 'key',
30-
'identifier' => 'article_ID:7',
31-
'reason' => 'Article 7 removed',
32-
'connection_name' => 'default',
33-
'shard' => 0,
34-
'priority' => 0,
35-
'event_time' => $now,
36-
'partition_key' => 0,
37-
],
38-
]);
27+
(object)[
28+
'id' => 1,
29+
'type' => 'key',
30+
'identifier' => 'article_ID:7',
31+
'reason' => 'Article 7 removed',
32+
'connection_name' => 'default',
33+
'shard' => 0,
34+
'priority' => 0,
35+
'event_time' => $now,
36+
'partition_key' => 0,
37+
],
38+
]);
3939

4040
Config::set('super_cache_invalidate.invalidation_window', 0);
4141

@@ -47,7 +47,6 @@ public function test_process_events_with_associated_identifiers_within_window():
4747

4848
$partitionCache_invalidation_events = $this->helper->getCacheInvalidationEventsUnprocessedPartitionName(0, 0);
4949

50-
5150
DB::shouldReceive('raw')
5251
->once()
5352
->with("`cache_invalidation_events` PARTITION ({$partitionCache_invalidation_events})")
@@ -61,9 +60,10 @@ public function test_process_events_with_associated_identifiers_within_window():
6160
;
6261

6362
DB::shouldReceive('select')
64-
->once()
65-
->with(['id', 'type', 'identifier', 'connection_name', 'partition_key', 'event_time'])
66-
->andReturnSelf();
63+
->once()
64+
->with(['id', 'type', 'identifier', 'connection_name', 'partition_key', 'event_time'])
65+
->andReturnSelf()
66+
;
6767

6868
DB::shouldReceive('where')
6969
->once()
@@ -112,10 +112,10 @@ public function test_process_events_with_associated_identifiers_within_window():
112112
->andReturn($events)
113113
;
114114

115-
//DB::shouldReceive('toArray')
115+
// DB::shouldReceive('toArray')
116116
// ->once()
117117
// ->andReturn($events->toArray())
118-
//;
118+
// ;
119119

120120
// CHIAVE
121121
// Mock Cache
@@ -211,7 +211,7 @@ public function test_process_events_with_associated_identifiers_within_window():
211211
->andReturn(true)
212212
;
213213

214-
//DB::shouldReceive('commit')->once();
214+
// DB::shouldReceive('commit')->once();
215215
Redis::connection('default')->del('shard_lock:0_0');
216216
// Run the command
217217
// Run the command

tests/Unit/PruneCacheInvalidationDataTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace Padosoft\SuperCacheInvalidate\Test\Unit;
44

55
use Illuminate\Support\Facades\DB;
6-
use Padosoft\SuperCacheInvalidate\Console\PruneCacheInvalidationDataCommand;
76

87
class PruneCacheInvalidationDataTest extends TestCase
98
{
@@ -12,7 +11,7 @@ protected function setUp(): void
1211
parent::setUp();
1312
}
1413

15-
public function testPruneTables(): void
14+
public function test_prune_tables(): void
1615
{
1716
// Mock DB queries
1817
$retentionDate = now()->subMonths(1);

tests/Unit/SuperCacheInvalidationHelperTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public function test_insert_invalidation_event(): void
2020
$partition = $this->helper->getCacheInvalidationEventsUnprocessedPartitionName(0, 0);
2121

2222
// Mock DB insert
23-
//DB::shouldReceive('table->insert')->once();
23+
// DB::shouldReceive('table->insert')->once();
2424
// Mock DB facade
2525
$now = now();
2626
$data = [

0 commit comments

Comments
 (0)