diff --git a/Tests/Functional/Indexing/IndexTcaTableTest.php b/Tests/Functional/Indexing/IndexTcaTableTest.php index 6d0999b..64fb55a 100644 --- a/Tests/Functional/Indexing/IndexTcaTableTest.php +++ b/Tests/Functional/Indexing/IndexTcaTableTest.php @@ -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.' );