Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/StaticCaching/DefaultInvalidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ protected function invalidateNavUrls($nav)

protected function invalidateNavTreeUrls($tree)
{
$rules = collect(Arr::get($this->rules, "navigation.{$tree->structure()->handle()}.urls"));
$rules = collect(Arr::get($this->rules, "navigation.{$tree->handle()}.urls"));

$absoluteUrls = $rules->filter(fn (string $rule) => $this->isAbsoluteUrl($rule))->all();

Expand Down
12 changes: 2 additions & 10 deletions tests/StaticCaching/DefaultInvalidatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -559,12 +559,8 @@ public function navigation_urls_can_be_invalidated_by_a_tree()
])->once();
});

$nav = tap(Mockery::mock(Nav::class), function ($m) {
$tree = tap(Mockery::mock(NavTree::class), function ($m) {
$m->shouldReceive('handle')->andReturn('links');
});

$tree = tap(Mockery::mock(NavTree::class), function ($m) use ($nav) {
$m->shouldReceive('structure')->andReturn($nav);
$m->shouldReceive('site')->andReturn(Site::default());
});

Expand Down Expand Up @@ -599,12 +595,8 @@ public function navigation_urls_can_be_invalidated_by_a_tree_in_a_multisite()
])->once();
});

$nav = tap(Mockery::mock(Nav::class), function ($m) {
$tree = tap(Mockery::mock(NavTree::class), function ($m) {
$m->shouldReceive('handle')->andReturn('links');
});

$tree = tap(Mockery::mock(NavTree::class), function ($m) use ($nav) {
$m->shouldReceive('structure')->andReturn($nav);
$m->shouldReceive('site')->andReturn(Site::get('fr'));
});

Expand Down