-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature #5948 Add mode to search all/any terms (all as default)
- Loading branch information
Showing
9 changed files
with
84 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,13 +4,13 @@ | |
|
||
use EasyCorp\Bundle\EasyAdminBundle\Test\AbstractCrudTestCase; | ||
use EasyCorp\Bundle\EasyAdminBundle\Tests\TestApplication\Controller\DashboardController; | ||
use EasyCorp\Bundle\EasyAdminBundle\Tests\TestApplication\Controller\Search\AllTermsCrudSearchController; | ||
use EasyCorp\Bundle\EasyAdminBundle\Tests\TestApplication\Controller\Search\AnyTermsCrudSearchController; | ||
|
||
class AllTermsCrudSearchControllerTest extends AbstractCrudTestCase | ||
class AnyTermsCrudSearchControllerTest extends AbstractCrudTestCase | ||
{ | ||
protected function getControllerFqcn(): string | ||
{ | ||
return AllTermsCrudSearchController::class; | ||
return AnyTermsCrudSearchController::class; | ||
} | ||
|
||
protected function getDashboardFqcn(): string | ||
|
@@ -41,29 +41,29 @@ public static function provideSearchTests(): iterable | |
$numOfPostsWrittenByEachAuthor = 4; | ||
$numOfPostsPublishedByEachUser = 2; | ||
|
||
yield 'search by blog post title and author or publisher email no results' => [ | ||
'"Blog Post 10" "user4@"', | ||
yield 'search by blog post title yields no results' => [ | ||
'blog post', | ||
0, | ||
]; | ||
|
||
yield 'search by blog post title and author or publisher email' => [ | ||
'Blog Post "user4@"', | ||
$numOfPostsWrittenByEachAuthor + $numOfPostsPublishedByEachUser, | ||
yield 'search by blog post slug yields no results' => [ | ||
'blog-post', | ||
0, | ||
]; | ||
|
||
yield 'search by author and publisher email' => [ | ||
'user1 user2@', | ||
$numOfPostsPublishedByEachUser, | ||
yield 'search by author or publisher email' => [ | ||
'@example.com', | ||
$totalNumberOfPosts, | ||
]; | ||
|
||
yield 'search by author and publisher email no results' => [ | ||
'user1 user3@', | ||
0, | ||
yield 'quoted search by author or published email' => [ | ||
'"user4@"', | ||
$numOfPostsWrittenByEachAuthor + $numOfPostsPublishedByEachUser, | ||
]; | ||
|
||
yield 'search by author or publisher email' => [ | ||
'user4', | ||
$numOfPostsWrittenByEachAuthor + $numOfPostsPublishedByEachUser, | ||
yield 'multiple search by author or publisher email (partial or complete)' => [ | ||
'"[email protected]" "user4@"', | ||
2 * $numOfPostsWrittenByEachAuthor + 2 * $numOfPostsPublishedByEachUser, | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,33 +37,32 @@ public static function provideSearchTests(): iterable | |
{ | ||
// the CRUD Controller associated to this test has configured the search | ||
// properties used by the search engine. That's why results are not the default ones | ||
$totalNumberOfPosts = 20; | ||
$numOfPostsWrittenByEachAuthor = 4; | ||
$numOfPostsPublishedByEachUser = 2; | ||
|
||
yield 'search by blog post title yields no results' => [ | ||
'blog post', | ||
yield 'search by blog post title and author or publisher email no results' => [ | ||
'"Blog Post 10" "user4@"', | ||
0, | ||
]; | ||
|
||
yield 'search by blog post slug yields no results' => [ | ||
'blog-post', | ||
0, | ||
yield 'search by blog post title and author or publisher email' => [ | ||
'Blog Post "user4@"', | ||
$numOfPostsWrittenByEachAuthor + $numOfPostsPublishedByEachUser, | ||
]; | ||
|
||
yield 'search by author or publisher email' => [ | ||
'@example.com', | ||
$totalNumberOfPosts, | ||
yield 'search by author and publisher email' => [ | ||
'user1 user2@', | ||
$numOfPostsPublishedByEachUser, | ||
]; | ||
|
||
yield 'quoted search by author or published email' => [ | ||
'"user4@"', | ||
$numOfPostsWrittenByEachAuthor + $numOfPostsPublishedByEachUser, | ||
yield 'search by author and publisher email no results' => [ | ||
'user1 user3@', | ||
0, | ||
]; | ||
|
||
yield 'multiple search by author or publisher email (partial or complete)' => [ | ||
'"[email protected]" "user4@"', | ||
2 * $numOfPostsWrittenByEachAuthor + 2 * $numOfPostsPublishedByEachUser, | ||
yield 'search by author or publisher email' => [ | ||
'user4', | ||
$numOfPostsWrittenByEachAuthor + $numOfPostsPublishedByEachUser, | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters