mirror of
https://github.com/Codappix/search_core.git
synced 2024-12-22 19:16:11 +01:00
FEATURE: Improve tests
* As they fail on travis and have a dependency to result order. * Resolve the dependency and query each document itself.
This commit is contained in:
parent
99fbb28b9d
commit
a87610716b
1 changed files with 12 additions and 5 deletions
|
@ -109,7 +109,7 @@ class IndexTcaTableTest extends AbstractFunctionalTestCase
|
|||
$response = $this->client->request('typo3content/_search?q=*:*');
|
||||
|
||||
$this->assertTrue($response->isOK());
|
||||
$this->assertSame($response->getData()['hits']['total'], 2, 'Not exactly 2 document was indexed.');
|
||||
$this->assertSame($response->getData()['hits']['total'], 2, 'Not exactly 2 documents were indexed.');
|
||||
$this->assertArraySubset(
|
||||
['_source' => ['header' => 'Also indexable record']],
|
||||
$response->getData()['hits']['hits'][0],
|
||||
|
@ -138,7 +138,10 @@ class IndexTcaTableTest extends AbstractFunctionalTestCase
|
|||
;
|
||||
|
||||
$response = $this->client->request('typo3content/_search?q=*:*');
|
||||
$this->assertTrue($response->isOK());
|
||||
$this->assertSame($response->getData()['hits']['total'], 3, 'Not exactly 3 documents were indexed.');
|
||||
|
||||
$response = $this->client->request('typo3content/_search?q=uid:9');
|
||||
$this->assertArraySubset(
|
||||
['_source' => [
|
||||
'uid' => '9',
|
||||
|
@ -147,24 +150,28 @@ class IndexTcaTableTest extends AbstractFunctionalTestCase
|
|||
]],
|
||||
$response->getData()['hits']['hits'][0],
|
||||
false,
|
||||
'Record was not indexed with resolved category relation to a single value.'
|
||||
'Record was not indexed with resolved category relations to multiple values.'
|
||||
);
|
||||
|
||||
$response = $this->client->request('typo3content/_search?q=uid:10');
|
||||
$this->assertArraySubset(
|
||||
['_source' => [
|
||||
'uid' => '10',
|
||||
'CType' => 'textmedia',
|
||||
'categories' => ['Category 2'],
|
||||
]],
|
||||
$response->getData()['hits']['hits'][1],
|
||||
$response->getData()['hits']['hits'][0],
|
||||
false,
|
||||
'Record was not indexed with resolved category relation to multiple values.'
|
||||
'Record was not indexed with resolved category relations to a single value.'
|
||||
);
|
||||
|
||||
$response = $this->client->request('typo3content/_search?q=uid:6');
|
||||
$this->assertArraySubset(
|
||||
['_source' => [
|
||||
'uid' => '6',
|
||||
'categories' => null,
|
||||
]],
|
||||
$response->getData()['hits']['hits'][2],
|
||||
$response->getData()['hits']['hits'][0],
|
||||
false,
|
||||
'Record was indexed with resolved category relation, but should not have any.'
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue