TASK: Update existing tests to work with new pages setup

This commit is contained in:
Daniel Siepmann 2017-07-18 15:12:24 +02:00
parent e2c1846d6b
commit a737501dac
Signed by: Daniel Siepmann
GPG key ID: 33D6629915560EF4
4 changed files with 21 additions and 19 deletions

View file

@ -50,10 +50,10 @@ class IndexTcaTableTest extends AbstractFunctionalTestCase
$response = $this->client->request('typo3content/_search?q=*:*'); $response = $this->client->request('typo3content/_search?q=*:*');
$this->assertTrue($response->isOK(), 'Elastica did not answer with ok code.'); $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( $this->assertArraySubset(
['_source' => ['header' => 'indexed content element']], ['_source' => ['header' => 'indexed content element']],
$response->getData()['hits']['hits'][0], $response->getData()['hits']['hits'][1],
false, false,
'Record was not indexed.' 'Record was not indexed.'
); );
@ -90,7 +90,7 @@ class IndexTcaTableTest extends AbstractFunctionalTestCase
$response = $this->client->request('typo3content/_search?q=*:*'); $response = $this->client->request('typo3content/_search?q=*:*');
$this->assertTrue($response->isOK(), 'Elastica did not answer with ok code.'); $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=*:*'); $response = $this->client->request('typo3content/_search?q=*:*');
$this->assertTrue($response->isOK(), 'Elastica did not answer with ok code.'); $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( $this->assertArraySubset(
['_source' => ['header' => 'Also indexable record']], ['_source' => ['header' => 'Also indexable record']],
$response->getData()['hits']['hits'][0], $response->getData()['hits']['hits'][0],
false, false,
'Record was not indexed.' 'Record was not indexed.'
); );
$response = $this->client->request('typo3content/_search?q=uid:6');
$this->assertArraySubset( $this->assertArraySubset(
['_source' => ['header' => 'indexed content element']], ['_source' => ['header' => 'indexed content element']],
$response->getData()['hits']['hits'][1], $response->getData()['hits']['hits'][0],
false, false,
'Record was not indexed.' 'Record was not indexed.'
); );
@ -143,12 +145,12 @@ class IndexTcaTableTest extends AbstractFunctionalTestCase
$response = $this->client->request('typo3content/_search?q=*:*'); $response = $this->client->request('typo3content/_search?q=*:*');
$this->assertTrue($response->isOK(), 'Elastica did not answer with ok code.'); $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( $this->assertArraySubset(
['_source' => [ ['_source' => [
'uid' => '9', 'uid' => '11',
'CType' => 'Header', // Testing items 'CType' => 'Header', // Testing items
'categories' => ['Category 1', 'Category 2'], // Testing mm (with sorting) '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.' '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( $this->assertArraySubset(
['_source' => [ ['_source' => [
'uid' => '10', 'uid' => '12',
'CType' => 'Header', 'CType' => 'Header',
'categories' => ['Category 2'], 'categories' => ['Category 2'],
]], ]],

View file

@ -67,7 +67,7 @@
<crdate>1480686370</crdate> <crdate>1480686370</crdate>
<hidden>0</hidden> <hidden>0</hidden>
<sorting>72</sorting> <sorting>72</sorting>
<CType>list</CType> <CType>div</CType>
<header>not indexed due to ctype</header> <header>not indexed due to ctype</header>
<bodytext>this is the content of header content element that should not get indexed</bodytext> <bodytext>this is the content of header content element that should not get indexed</bodytext>
<media>0</media> <media>0</media>

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<dataset> <dataset>
<tt_content> <tt_content>
<uid>9</uid> <uid>11</uid>
<pid>1</pid> <pid>1</pid>
<tstamp>1480686370</tstamp> <tstamp>1480686370</tstamp>
<crdate>1480686370</crdate> <crdate>1480686370</crdate>
@ -22,7 +22,7 @@
</tt_content> </tt_content>
<tt_content> <tt_content>
<uid>10</uid> <uid>12</uid>
<pid>1</pid> <pid>1</pid>
<tstamp>1480686370</tstamp> <tstamp>1480686370</tstamp>
<crdate>1480686370</crdate> <crdate>1480686370</crdate>
@ -92,7 +92,7 @@
<sys_category_record_mm> <sys_category_record_mm>
<uid_local>1</uid_local> <uid_local>1</uid_local>
<uid_foreign>9</uid_foreign> <uid_foreign>11</uid_foreign>
<tablenames>tt_content</tablenames> <tablenames>tt_content</tablenames>
<fieldname>categories</fieldname> <fieldname>categories</fieldname>
<sorting>2</sorting> <sorting>2</sorting>
@ -100,7 +100,7 @@
</sys_category_record_mm> </sys_category_record_mm>
<sys_category_record_mm> <sys_category_record_mm>
<uid_local>2</uid_local> <uid_local>2</uid_local>
<uid_foreign>9</uid_foreign> <uid_foreign>11</uid_foreign>
<tablenames>tt_content</tablenames> <tablenames>tt_content</tablenames>
<fieldname>categories</fieldname> <fieldname>categories</fieldname>
<sorting>1</sorting> <sorting>1</sorting>
@ -108,7 +108,7 @@
</sys_category_record_mm> </sys_category_record_mm>
<sys_category_record_mm> <sys_category_record_mm>
<uid_local>3</uid_local> <uid_local>3</uid_local>
<uid_foreign>9</uid_foreign> <uid_foreign>11</uid_foreign>
<tablenames>tt_content</tablenames> <tablenames>tt_content</tablenames>
<fieldname>categories</fieldname> <fieldname>categories</fieldname>
<sorting>3</sorting> <sorting>3</sorting>
@ -117,7 +117,7 @@
<sys_category_record_mm> <sys_category_record_mm>
<uid_local>2</uid_local> <uid_local>2</uid_local>
<uid_foreign>10</uid_foreign> <uid_foreign>12</uid_foreign>
<tablenames>tt_content</tablenames> <tablenames>tt_content</tablenames>
<fieldname>categories</fieldname> <fieldname>categories</fieldname>
<sorting>1</sorting> <sorting>1</sorting>

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<dataset> <dataset>
<tt_content> <tt_content>
<uid>9</uid> <uid>11</uid>
<pid>1</pid> <pid>1</pid>
<tstamp>1480686370</tstamp> <tstamp>1480686370</tstamp>
<crdate>1480686370</crdate> <crdate>1480686370</crdate>
@ -21,7 +21,7 @@
</tt_content> </tt_content>
<tt_content> <tt_content>
<uid>10</uid> <uid>12</uid>
<pid>1</pid> <pid>1</pid>
<tstamp>1480686370</tstamp> <tstamp>1480686370</tstamp>
<crdate>1480686370</crdate> <crdate>1480686370</crdate>