Skip to content

Commit

Permalink
add test case for TermQueryBuilder where entries.driver is file
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBnl committed Nov 13, 2024
1 parent 0df27e0 commit 2b8742a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Taxonomies/TermQueryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ private function applyCollectionAndTaxonomyWheres()
->pluck('slug');
}

dump("using map");
return TermModel::where('taxonomy', $taxonomy)
->select('slug')
->get()
Expand Down
10 changes: 10 additions & 0 deletions tests/Data/Taxonomies/TermQueryBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,16 @@ public function terms_are_found_using_where_column()
$this->assertEquals(['a', 'b', 'e'], $terms->map->slug()->all());
}

#[Test]
public function it_filters_usage_in_collections_using_file_based_entries()
{
config()->set('statamic.eloquent-driver.entries.driver', 'file');
$this->it_filters_usage_in_collections();

// revert config to original
config()->set('statamic.eloquent-driver.entries.driver', 'eloquent');
}

#[Test]
public function it_filters_usage_in_collections()
{
Expand Down

0 comments on commit 2b8742a

Please sign in to comment.