improved search with negation (#5453)
This commit is contained in:
40
tests/Repository/Search/SearchConfigurationTest.php
Normal file
40
tests/Repository/Search/SearchConfigurationTest.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Kimai time-tracking app.
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace App\Tests\Repository\Search;
|
||||
|
||||
use App\Repository\Search\SearchConfiguration;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* @covers \App\Repository\Search\SearchConfiguration
|
||||
*/
|
||||
class SearchConfigurationTest extends TestCase
|
||||
{
|
||||
public function testDefaultConstruct(): void
|
||||
{
|
||||
$sut = new SearchConfiguration();
|
||||
self::assertNull($sut->getMetaFieldClass());
|
||||
self::assertNull($sut->getMetaFieldName());
|
||||
self::assertEquals('meta', $sut->getEntityFieldName());
|
||||
self::assertEquals([], $sut->getSearchableFields());
|
||||
}
|
||||
|
||||
public function testConstruct(): void
|
||||
{
|
||||
$fields = ['field1', 'field2'];
|
||||
$sut = new SearchConfiguration($fields, 'SomeClassName', 'foo-bar');
|
||||
self::assertEquals($fields, $sut->getSearchableFields());
|
||||
self::assertEquals('SomeClassName', $sut->getMetaFieldClass());
|
||||
self::assertEquals('foo-bar', $sut->getMetaFieldName());
|
||||
|
||||
$sut->setEntityFieldName('customField');
|
||||
self::assertEquals('customField', $sut->getEntityFieldName());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user