Skip to content

Commit b3806dc

Browse files
author
Jan Petr
authored
Merge pull request #808 from algolia/small_test_optimalization
Small test optimalization
2 parents 933075e + e4dd59e commit b3806dc

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

tests/CategoriesIndexingTest.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ public function testDefaultIndexableAttributes()
1313
setConfig('algoliasearch/categories/category_additional_attributes2', serialize(array()));
1414

1515
$indexer = new Algolia_Algoliasearch_Model_Indexer_Algoliacategories();
16-
$indexer->reindexAll();
16+
$indexer->reindexSpecificCategories(24);
1717

1818
$this->algoliaHelper->waitLastTask();
1919

20-
$results = $this->algoliaHelper->query($this->indexPrefix.'default_categories', '', array('hitsPerPage' => 1));
21-
$hit = reset($results['hits']);
20+
$results = $this->algoliaHelper->getObjects($this->indexPrefix.'default_categories', array('24'));
21+
$hit = reset($results['results']);
2222

2323
$defaultAttributes = array(
2424
'objectID',
@@ -31,7 +31,6 @@ public function testDefaultIndexableAttributes()
3131
'popularity',
3232
'product_count',
3333
'algoliaLastUpdateAtCET',
34-
'_highlightResult',
3534
);
3635

3736
foreach ($defaultAttributes as $key => $attribute) {

tests/ProductsIndexingTest.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@ public function testDefaultIndexableAttributes()
4848
setConfig('algoliasearch/products/custom_ranking_product_attributes', serialize(array()));
4949

5050
$indexer = new Algolia_Algoliasearch_Model_Indexer_Algolia();
51-
$indexer->reindexAll();
51+
$indexer->reindexSpecificProducts(405);
5252

5353
$this->algoliaHelper->waitLastTask();
5454

55-
$results = $this->algoliaHelper->query($this->indexPrefix.'default_products', '', array('hitsPerPage' => 1));
56-
$hit = reset($results['hits']);
55+
$results = $this->algoliaHelper->getObjects($this->indexPrefix.'default_products', array('405'));
56+
$hit = reset($results['results']);
5757

5858
$defaultAttributes = array(
5959
'objectID',
@@ -69,7 +69,6 @@ public function testDefaultIndexableAttributes()
6969
'price',
7070
'type_id',
7171
'algoliaLastUpdateAtCET',
72-
'_highlightResult',
7372
);
7473

7574
foreach ($defaultAttributes as $key => $attribute) {

0 commit comments

Comments
 (0)