mirror of
https://github.com/Codappix/search_core.git
synced 2024-12-22 18:16:11 +01:00
TASK: Update existing tests to work with new pages setup
This commit is contained in:
parent
e2c1846d6b
commit
a737501dac
4 changed files with 21 additions and 19 deletions
|
@ -50,10 +50,10 @@ class IndexTcaTableTest extends AbstractFunctionalTestCase
|
|||
$response = $this->client->request('typo3content/_search?q=*:*');
|
||||
|
||||
$this->assertTrue($response->isOK(), 'Elastica did not answer with ok code.');
|
||||
$this->assertSame($response->getData()['hits']['total'], 1, 'Not exactly 1 document was indexed.');
|
||||
$this->assertSame($response->getData()['hits']['total'], 2, 'Not exactly 2 documents were indexed.');
|
||||
$this->assertArraySubset(
|
||||
['_source' => ['header' => 'indexed content element']],
|
||||
$response->getData()['hits']['hits'][0],
|
||||
$response->getData()['hits']['hits'][1],
|
||||
false,
|
||||
'Record was not indexed.'
|
||||
);
|
||||
|
@ -90,7 +90,7 @@ class IndexTcaTableTest extends AbstractFunctionalTestCase
|
|||
$response = $this->client->request('typo3content/_search?q=*:*');
|
||||
|
||||
$this->assertTrue($response->isOK(), 'Elastica did not answer with ok code.');
|
||||
$this->assertSame($response->getData()['hits']['total'], 1, 'Not exactly 1 document was indexed.');
|
||||
$this->assertSame($response->getData()['hits']['total'], 2, 'Not exactly 2 documents were indexed.');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -113,16 +113,18 @@ class IndexTcaTableTest extends AbstractFunctionalTestCase
|
|||
$response = $this->client->request('typo3content/_search?q=*:*');
|
||||
|
||||
$this->assertTrue($response->isOK(), 'Elastica did not answer with ok code.');
|
||||
$this->assertSame($response->getData()['hits']['total'], 2, 'Not exactly 2 documents were indexed.');
|
||||
$this->assertSame($response->getData()['hits']['total'], 3, 'Not exactly 3 documents were indexed.');
|
||||
$response = $this->client->request('typo3content/_search?q=uid:11');
|
||||
$this->assertArraySubset(
|
||||
['_source' => ['header' => 'Also indexable record']],
|
||||
$response->getData()['hits']['hits'][0],
|
||||
false,
|
||||
'Record was not indexed.'
|
||||
);
|
||||
$response = $this->client->request('typo3content/_search?q=uid:6');
|
||||
$this->assertArraySubset(
|
||||
['_source' => ['header' => 'indexed content element']],
|
||||
$response->getData()['hits']['hits'][1],
|
||||
$response->getData()['hits']['hits'][0],
|
||||
false,
|
||||
'Record was not indexed.'
|
||||
);
|
||||
|
@ -143,12 +145,12 @@ class IndexTcaTableTest extends AbstractFunctionalTestCase
|
|||
|
||||
$response = $this->client->request('typo3content/_search?q=*:*');
|
||||
$this->assertTrue($response->isOK(), 'Elastica did not answer with ok code.');
|
||||
$this->assertSame($response->getData()['hits']['total'], 3, 'Not exactly 3 documents were indexed.');
|
||||
$this->assertSame($response->getData()['hits']['total'], 4, 'Not exactly 4 documents were indexed.');
|
||||
|
||||
$response = $this->client->request('typo3content/_search?q=uid:9');
|
||||
$response = $this->client->request('typo3content/_search?q=uid:11');
|
||||
$this->assertArraySubset(
|
||||
['_source' => [
|
||||
'uid' => '9',
|
||||
'uid' => '11',
|
||||
'CType' => 'Header', // Testing items
|
||||
'categories' => ['Category 1', 'Category 2'], // Testing mm (with sorting)
|
||||
]],
|
||||
|
@ -157,10 +159,10 @@ class IndexTcaTableTest extends AbstractFunctionalTestCase
|
|||
'Record was not indexed with resolved category relations to multiple values.'
|
||||
);
|
||||
|
||||
$response = $this->client->request('typo3content/_search?q=uid:10');
|
||||
$response = $this->client->request('typo3content/_search?q=uid:12');
|
||||
$this->assertArraySubset(
|
||||
['_source' => [
|
||||
'uid' => '10',
|
||||
'uid' => '12',
|
||||
'CType' => 'Header',
|
||||
'categories' => ['Category 2'],
|
||||
]],
|
||||
|
|
|
@ -67,7 +67,7 @@
|
|||
<crdate>1480686370</crdate>
|
||||
<hidden>0</hidden>
|
||||
<sorting>72</sorting>
|
||||
<CType>list</CType>
|
||||
<CType>div</CType>
|
||||
<header>not indexed due to ctype</header>
|
||||
<bodytext>this is the content of header content element that should not get indexed</bodytext>
|
||||
<media>0</media>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<dataset>
|
||||
<tt_content>
|
||||
<uid>9</uid>
|
||||
<uid>11</uid>
|
||||
<pid>1</pid>
|
||||
<tstamp>1480686370</tstamp>
|
||||
<crdate>1480686370</crdate>
|
||||
|
@ -22,7 +22,7 @@
|
|||
</tt_content>
|
||||
|
||||
<tt_content>
|
||||
<uid>10</uid>
|
||||
<uid>12</uid>
|
||||
<pid>1</pid>
|
||||
<tstamp>1480686370</tstamp>
|
||||
<crdate>1480686370</crdate>
|
||||
|
@ -92,7 +92,7 @@
|
|||
|
||||
<sys_category_record_mm>
|
||||
<uid_local>1</uid_local>
|
||||
<uid_foreign>9</uid_foreign>
|
||||
<uid_foreign>11</uid_foreign>
|
||||
<tablenames>tt_content</tablenames>
|
||||
<fieldname>categories</fieldname>
|
||||
<sorting>2</sorting>
|
||||
|
@ -100,7 +100,7 @@
|
|||
</sys_category_record_mm>
|
||||
<sys_category_record_mm>
|
||||
<uid_local>2</uid_local>
|
||||
<uid_foreign>9</uid_foreign>
|
||||
<uid_foreign>11</uid_foreign>
|
||||
<tablenames>tt_content</tablenames>
|
||||
<fieldname>categories</fieldname>
|
||||
<sorting>1</sorting>
|
||||
|
@ -108,7 +108,7 @@
|
|||
</sys_category_record_mm>
|
||||
<sys_category_record_mm>
|
||||
<uid_local>3</uid_local>
|
||||
<uid_foreign>9</uid_foreign>
|
||||
<uid_foreign>11</uid_foreign>
|
||||
<tablenames>tt_content</tablenames>
|
||||
<fieldname>categories</fieldname>
|
||||
<sorting>3</sorting>
|
||||
|
@ -117,7 +117,7 @@
|
|||
|
||||
<sys_category_record_mm>
|
||||
<uid_local>2</uid_local>
|
||||
<uid_foreign>10</uid_foreign>
|
||||
<uid_foreign>12</uid_foreign>
|
||||
<tablenames>tt_content</tablenames>
|
||||
<fieldname>categories</fieldname>
|
||||
<sorting>1</sorting>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<dataset>
|
||||
<tt_content>
|
||||
<uid>9</uid>
|
||||
<uid>11</uid>
|
||||
<pid>1</pid>
|
||||
<tstamp>1480686370</tstamp>
|
||||
<crdate>1480686370</crdate>
|
||||
|
@ -21,7 +21,7 @@
|
|||
</tt_content>
|
||||
|
||||
<tt_content>
|
||||
<uid>10</uid>
|
||||
<uid>12</uid>
|
||||
<pid>1</pid>
|
||||
<tstamp>1480686370</tstamp>
|
||||
<crdate>1480686370</crdate>
|
||||
|
|
Loading…
Reference in a new issue