improved search with negation (#5453)

This commit is contained in:
Kevin Papst
2025-05-05 18:18:00 +02:00
committed by GitHub
parent 2a9de506a1
commit 452a8d9390
20 changed files with 881 additions and 287 deletions

View File

@@ -72,9 +72,27 @@ class ProjectControllerTest extends AbstractControllerBaseTestCase
$fixture = new ProjectFixtures();
$fixture->setAmount(5);
$fixture->setCallback(function (Project $project) {
$i = 0;
$fixture->setCallback(function (Project $project) use (&$i) {
$project->setVisible(true);
$project->setComment('I am a foobar with tralalalala some more content');
switch ($i++) {
case 0:
$project->setComment('I am a foo');
break;
case 1:
$project->setComment('I am a foo with tralalalala some more content');
break;
case 2:
$project->setComment('I am a barfoo with tralalalala some more content');
break;
case 3:
$project->setName($project->getName() . ' with');
$project->setComment('I am a foobar tralalalala some more content');
break;
default:
$project->setComment('I am a foobar with tralalalala some more content');
break;
}
$project->setMetaField((new ProjectMeta())->setName('location')->setValue('homeoffice'));
$project->setMetaField((new ProjectMeta())->setName('feature')->setValue('timetracking'));
});
@@ -89,7 +107,7 @@ class ProjectControllerTest extends AbstractControllerBaseTestCase
$form = $client->getCrawler()->filter('form.searchform')->form();
$client->submit($form, [
'searchTerm' => 'feature:timetracking foo',
'searchTerm' => 'feature:timetracking foo with',
'visibility' => 1,
'customers' => [1],
'size' => 50,
@@ -98,7 +116,7 @@ class ProjectControllerTest extends AbstractControllerBaseTestCase
self::assertTrue($client->getResponse()->isSuccessful());
$this->assertHasDataTable($client);
$this->assertDataTableRowCount($client, 'datatable_project_admin', 5);
$this->assertDataTableRowCount($client, 'datatable_project_admin', 4);
}
public function testExportIsSecureForRole(): void