Skip to content

Commit

Permalink
[IntegrationTests] Add some missing fixtures for Search tests
Browse files Browse the repository at this point in the history
  • Loading branch information
andrerom committed Jan 6, 2015
1 parent e062fd0 commit ba417a6
Show file tree
Hide file tree
Showing 6 changed files with 346 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Repository/Tests/SearchServiceLocationTest.php
Expand Up @@ -812,7 +812,7 @@ public function testQueryCustomField()
public function testQueryModifiedField()
{
// Check using get_class since the others extend SetupFactory\Legacy
if ( get_class( $this->getSetupFactory() ) === '\eZ\Publish\API\Repository\Tests\SetupFactory\Legacy' )
if ( ltrim( get_class( $this->getSetupFactory() ), '\\' ) === 'eZ\Publish\API\Repository\Tests\SetupFactory\Legacy' )
{
$this->markTestIncomplete(
"Custom fields not supported by LegacySE " .
Expand Down
2 changes: 1 addition & 1 deletion Repository/Tests/SearchServiceTest.php
Expand Up @@ -2383,7 +2383,7 @@ public function testQueryCustomField()
public function testQueryModifiedField()
{
// Check using get_class since the others extend SetupFactory\Legacy
if ( get_class( $this->getSetupFactory() ) === '\eZ\Publish\API\Repository\Tests\SetupFactory\Legacy' )
if ( ltrim( get_class( $this->getSetupFactory() ), '\\' ) === 'eZ\Publish\API\Repository\Tests\SetupFactory\Legacy' )
{
$this->markTestIncomplete(
"Custom fields not supported by LegacySE " .
Expand Down
102 changes: 102 additions & 0 deletions Repository/Tests/_fixtures/Elasticsearch/Location/SortDateModified.php
@@ -0,0 +1,102 @@
<?php

return eZ\Publish\API\Repository\Values\Content\Search\SearchResult::__set_state(
array(
'facets' => array(),
'searchHits' => array(
0 => eZ\Publish\API\Repository\Values\Content\Search\SearchHit::__set_state(
array(
'valueObject' => array(
'id' => 4,
'title' => 'Users',
),
'score' => 1,
'index' => NULL,
'highlight' => NULL,
)
),
1 => eZ\Publish\API\Repository\Values\Content\Search\SearchHit::__set_state(
array(
'valueObject' => array(
'id' => 12,
'title' => 'Administrator users',
),
'score' => 1,
'index' => NULL,
'highlight' => NULL,
)
),
2 => eZ\Publish\API\Repository\Values\Content\Search\SearchHit::__set_state(
array(
'valueObject' => array(
'id' => 13,
'title' => 'Editors',
),
'score' => 1,
'index' => NULL,
'highlight' => NULL,
)
),
3 => eZ\Publish\API\Repository\Values\Content\Search\SearchHit::__set_state(
array(
'valueObject' => array(
'id' => 42,
'title' => 'Anonymous Users',
),
'score' => 1,
'index' => NULL,
'highlight' => NULL,
)
),
4 => eZ\Publish\API\Repository\Values\Content\Search\SearchHit::__set_state(
array(
'valueObject' => array(
'id' => 10,
'title' => 'Anonymous User',
),
'score' => 1,
'index' => NULL,
'highlight' => NULL,
)
),
5 => eZ\Publish\API\Repository\Values\Content\Search\SearchHit::__set_state(
array(
'valueObject' => array(
'id' => 14,
'title' => 'Administrator User',
),
'score' => 1,
'index' => NULL,
'highlight' => NULL,
)
),
6 => eZ\Publish\API\Repository\Values\Content\Search\SearchHit::__set_state(
array(
'valueObject' => array(
'id' => 59,
'title' => 'Partners',
),
'score' => 1,
'index' => NULL,
'highlight' => NULL,
)
),
7 => eZ\Publish\API\Repository\Values\Content\Search\SearchHit::__set_state(
array(
'valueObject' => array(
'id' => 11,
'title' => 'Members',
),
'score' => 1,
'index' => NULL,
'highlight' => NULL,
)
),
),
'spellSuggestion' => NULL,
'time' => 1,
'timedOut' => NULL,
'maxScore' => 1,
'totalCount' => 8,
)
);
102 changes: 102 additions & 0 deletions Repository/Tests/_fixtures/Elasticsearch/SortDateModified.php
@@ -0,0 +1,102 @@
<?php

return eZ\Publish\API\Repository\Values\Content\Search\SearchResult::__set_state(
array(
'facets' => array(),
'searchHits' => array(
0 => eZ\Publish\API\Repository\Values\Content\Search\SearchHit::__set_state(
array(
'valueObject' => array(
'id' => 4,
'title' => 'Users',
),
'score' => 1,
'index' => NULL,
'highlight' => NULL,
)
),
1 => eZ\Publish\API\Repository\Values\Content\Search\SearchHit::__set_state(
array(
'valueObject' => array(
'id' => 12,
'title' => 'Administrator users',
),
'score' => 1,
'index' => NULL,
'highlight' => NULL,
)
),
2 => eZ\Publish\API\Repository\Values\Content\Search\SearchHit::__set_state(
array(
'valueObject' => array(
'id' => 13,
'title' => 'Editors',
),
'score' => 1,
'index' => NULL,
'highlight' => NULL,
)
),
3 => eZ\Publish\API\Repository\Values\Content\Search\SearchHit::__set_state(
array(
'valueObject' => array(
'id' => 42,
'title' => 'Anonymous Users',
),
'score' => 1,
'index' => NULL,
'highlight' => NULL,
)
),
4 => eZ\Publish\API\Repository\Values\Content\Search\SearchHit::__set_state(
array(
'valueObject' => array(
'id' => 10,
'title' => 'Anonymous User',
),
'score' => 1,
'index' => NULL,
'highlight' => NULL,
)
),
5 => eZ\Publish\API\Repository\Values\Content\Search\SearchHit::__set_state(
array(
'valueObject' => array(
'id' => 14,
'title' => 'Administrator User',
),
'score' => 1,
'index' => NULL,
'highlight' => NULL,
)
),
6 => eZ\Publish\API\Repository\Values\Content\Search\SearchHit::__set_state(
array(
'valueObject' => array(
'id' => 59,
'title' => 'Partners',
),
'score' => 1,
'index' => NULL,
'highlight' => NULL,
)
),
7 => eZ\Publish\API\Repository\Values\Content\Search\SearchHit::__set_state(
array(
'valueObject' => array(
'id' => 11,
'title' => 'Members',
),
'score' => 1,
'index' => NULL,
'highlight' => NULL,
)
),
),
'spellSuggestion' => NULL,
'time' => 1,
'timedOut' => NULL,
'maxScore' => 1,
'totalCount' => 8,
)
);
38 changes: 38 additions & 0 deletions Repository/Tests/_fixtures/Legacy/QueryModifiedField.php
@@ -0,0 +1,38 @@
<?php

return eZ\Publish\API\Repository\Values\Content\Search\SearchResult::__set_state(array(
'facets' =>
array (
),
'searchHits' =>
array (
0 =>
eZ\Publish\API\Repository\Values\Content\Search\SearchHit::__set_state(array(
'valueObject' =>
array (
'id' => 10,
'title' => 'Anonymous User',
),
'score' => NULL,
'index' => NULL,
'highlight' => NULL,
)),
1 =>
eZ\Publish\API\Repository\Values\Content\Search\SearchHit::__set_state(array(
'valueObject' =>
array (
'id' => 14,
'title' => 'Administrator User',
),
'score' => NULL,
'index' => NULL,
'highlight' => NULL,
)),
),
'spellSuggestion' => NULL,
'time' => 1,
'timedOut' => NULL,
'maxScore' => NULL,
'totalCount' => 2,
));

102 changes: 102 additions & 0 deletions Repository/Tests/_fixtures/Legacy/SortDateModified.php
@@ -0,0 +1,102 @@
<?php

return eZ\Publish\API\Repository\Values\Content\Search\SearchResult::__set_state(
array(
'facets' => array(),
'searchHits' => array(
0 => eZ\Publish\API\Repository\Values\Content\Search\SearchHit::__set_state(
array(
'valueObject' => array(
'id' => 4,
'title' => 'Users',
),
'score' => NULL,
'index' => NULL,
'highlight' => NULL,
)
),
1 => eZ\Publish\API\Repository\Values\Content\Search\SearchHit::__set_state(
array(
'valueObject' => array(
'id' => 12,
'title' => 'Administrator users',
),
'score' => NULL,
'index' => NULL,
'highlight' => NULL,
)
),
2 => eZ\Publish\API\Repository\Values\Content\Search\SearchHit::__set_state(
array(
'valueObject' => array(
'id' => 13,
'title' => 'Editors',
),
'score' => NULL,
'index' => NULL,
'highlight' => NULL,
)
),
3 => eZ\Publish\API\Repository\Values\Content\Search\SearchHit::__set_state(
array(
'valueObject' => array(
'id' => 42,
'title' => 'Anonymous Users',
),
'score' => NULL,
'index' => NULL,
'highlight' => NULL,
)
),
4 => eZ\Publish\API\Repository\Values\Content\Search\SearchHit::__set_state(
array(
'valueObject' => array(
'id' => 10,
'title' => 'Anonymous User',
),
'score' => NULL,
'index' => NULL,
'highlight' => NULL,
)
),
5 => eZ\Publish\API\Repository\Values\Content\Search\SearchHit::__set_state(
array(
'valueObject' => array(
'id' => 14,
'title' => 'Administrator User',
),
'score' => NULL,
'index' => NULL,
'highlight' => NULL,
)
),
6 => eZ\Publish\API\Repository\Values\Content\Search\SearchHit::__set_state(
array(
'valueObject' => array(
'id' => 59,
'title' => 'Partners',
),
'score' => NULL,
'index' => NULL,
'highlight' => NULL,
)
),
7 => eZ\Publish\API\Repository\Values\Content\Search\SearchHit::__set_state(
array(
'valueObject' => array(
'id' => 11,
'title' => 'Members',
),
'score' => NULL,
'index' => NULL,
'highlight' => NULL,
)
),
),
'spellSuggestion' => NULL,
'time' => 1,
'timedOut' => NULL,
'maxScore' => NULL,
'totalCount' => 8,
)
);

0 comments on commit ba417a6

Please sign in to comment.