diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-05-01 15:31:33 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-05-01 15:31:33 -0400 |
commit | 150f94f051128f367bc89f6b7e5f57eb2a69fc62 (patch) | |
tree | 181f454813b310ee97385058c6c6f2e3f34d5fd8 /vendor/ruflin/elastica/test/lib/Elastica/Test/Facet/StatisticalTest.php | |
parent | 7e85254903c7c0cb49e381f16b18441ea7b058cc (diff) | |
parent | 80f7dc77d430774192b929d780f96260066df2ee (diff) |
Merge commit '80f7dc'
# Conflicts:
# extensions/ArchInterWiki.sql
Diffstat (limited to 'vendor/ruflin/elastica/test/lib/Elastica/Test/Facet/StatisticalTest.php')
-rw-r--r-- | vendor/ruflin/elastica/test/lib/Elastica/Test/Facet/StatisticalTest.php | 82 |
1 files changed, 0 insertions, 82 deletions
diff --git a/vendor/ruflin/elastica/test/lib/Elastica/Test/Facet/StatisticalTest.php b/vendor/ruflin/elastica/test/lib/Elastica/Test/Facet/StatisticalTest.php deleted file mode 100644 index 0b528a79..00000000 --- a/vendor/ruflin/elastica/test/lib/Elastica/Test/Facet/StatisticalTest.php +++ /dev/null @@ -1,82 +0,0 @@ -<?php - -namespace Elastica\Test\Facet; - -use Elastica\Document; -use Elastica\Facet\Statistical; -use Elastica\Query; -use Elastica\Query\MatchAll; -use Elastica\Test\Base as BaseTest; - -class StatisticalTest extends BaseTest -{ - public function testStatisticalWithSetField() - { - $client = $this->_getClient(); - $index = $client->getIndex('test'); - $index->create(array(), true); - $type = $index->getType('helloworld'); - - $doc = new Document(1, array('price' => 10)); - $type->addDocument($doc); - $doc = new Document(2, array('price' => 35)); - $type->addDocument($doc); - $doc = new Document(2, array('price' => 45)); - $type->addDocument($doc); - - $facet = new Statistical('stats'); - $facet->setField('price'); - - $query = new Query(); - $query->addFacet($facet); - $query->setQuery(new MatchAll()); - - $index->refresh(); - - $response = $type->search($query); - $facets = $response->getFacets(); - - $this->assertEquals(55, $facets['stats']['total']); - $this->assertEquals(10, $facets['stats']['min']); - $this->assertEquals(45, $facets['stats']['max']); - } - - public function testStatisticalWithSetFields() - { - $client = $this->_getClient(); - $index = $client->getIndex('test'); - $index->create(array(), true); - $type = $index->getType('helloworld'); - - $doc = new Document(1, array('price' => 10, 'price2' => 20)); - $type->addDocument($doc); - $doc = new Document(2, array('price' => 35, 'price2' => 70)); - $type->addDocument($doc); - $doc = new Document(2, array('price' => 45, 'price2' => 90)); - $type->addDocument($doc); - - $facet = new Statistical('stats'); - $facet->setFields(array('price','price2')); - - $query = new Query(); - $query->addFacet($facet); - $query->setQuery(new MatchAll()); - - $index->refresh(); - - $response = $type->search($query); - $facets = $response->getFacets(); - - $this->assertEquals(165, $facets['stats']['total']); - $this->assertEquals(10, $facets['stats']['min']); - $this->assertEquals(90, $facets['stats']['max']); - } - - /** - * @todo - */ - public function testStatisticalWithSetScript() - { - $this->markTestIncomplete('Test for setting the script value'); - } -} |