diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2015-10-18 09:31:31 +0200 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2015-10-18 09:31:31 +0200 |
commit | 80f7dc77d430774192b929d780f96260066df2ee (patch) | |
tree | 102eaae7fc9ec567f2af76e96da3de2d1e83afcf /vendor/ruflin/elastica/test/lib/Elastica/Test/Query/IdsTest.php | |
parent | cccd7bb4d819334c07e0dadaf16cbfdef31880e1 (diff) |
Update to MediaWiki 1.25.3
Diffstat (limited to 'vendor/ruflin/elastica/test/lib/Elastica/Test/Query/IdsTest.php')
-rw-r--r-- | vendor/ruflin/elastica/test/lib/Elastica/Test/Query/IdsTest.php | 165 |
1 files changed, 0 insertions, 165 deletions
diff --git a/vendor/ruflin/elastica/test/lib/Elastica/Test/Query/IdsTest.php b/vendor/ruflin/elastica/test/lib/Elastica/Test/Query/IdsTest.php deleted file mode 100644 index d1bf901e..00000000 --- a/vendor/ruflin/elastica/test/lib/Elastica/Test/Query/IdsTest.php +++ /dev/null @@ -1,165 +0,0 @@ -<?php - -namespace Elastica\Test\Query; - -use Elastica\Document; -use Elastica\Query\Ids; -use Elastica\Test\Base as BaseTest; - -class IdsTest extends BaseTest -{ - protected $_index; - protected $_type; - - public function setUp() - { - $client = $this->_getClient(); - $index = $client->getIndex('test'); - $index->create(array(), true); - - $type1 = $index->getType('helloworld1'); - $type2 = $index->getType('helloworld2'); - - $doc = new Document(1, array('name' => 'hello world')); - $type1->addDocument($doc); - - $doc = new Document(2, array('name' => 'nicolas ruflin')); - $type1->addDocument($doc); - - $doc = new Document(3, array('name' => 'ruflin')); - $type1->addDocument($doc); - - $doc = new Document(4, array('name' => 'hello world again')); - $type2->addDocument($doc); - - $index->refresh(); - - $this->_type = $type1; - $this->_index = $index; - } - - public function tearDown() - { - $client = $this->_getClient(); - $index = $client->getIndex('test'); - $index->delete(); - } - - public function testSetIdsSearchSingle() - { - $query = new Ids(); - $query->setIds('1'); - - $resultSet = $this->_type->search($query); - - $this->assertEquals(1, $resultSet->count()); - } - - public function testSetIdsSearchArray() - { - $query = new Ids(); - $query->setIds(array('1', '2')); - - $resultSet = $this->_type->search($query); - - $this->assertEquals(2, $resultSet->count()); - } - - public function testAddIdsSearchSingle() - { - $query = new Ids(); - $query->addId('3'); - - $resultSet = $this->_type->search($query); - - $this->assertEquals(1, $resultSet->count()); - } - - public function testComboIdsSearchArray() - { - $query = new Ids(); - - $query->setIds(array('1', '2')); - $query->addId('3'); - - $resultSet = $this->_type->search($query); - - $this->assertEquals(3, $resultSet->count()); - } - - public function testSetTypeSingleSearchSingle() - { - $query = new Ids(); - - $query->setIds('1'); - $query->setType('helloworld1'); - - $resultSet = $this->_index->search($query); - - $this->assertEquals(1, $resultSet->count()); - } - - public function testSetTypeSingleSearchArray() - { - $query = new Ids(); - - $query->setIds(array('1', '2')); - $query->setType('helloworld1'); - - $resultSet = $this->_index->search($query); - - $this->assertEquals(2, $resultSet->count()); - } - - public function testSetTypeSingleSearchSingleDocInOtherType() - { - $query = new Ids(); - - // Doc 4 is in the second type... - $query->setIds('4'); - $query->setType('helloworld1'); - - $resultSet = $this->_index->search($query); - - // ...therefore 0 results should be returned - $this->assertEquals(0, $resultSet->count()); - } - - public function testSetTypeSingleSearchArrayDocInOtherType() - { - $query = new Ids(); - - // Doc 4 is in the second type... - $query->setIds(array('1', '4')); - $query->setType('helloworld1'); - - $resultSet = $this->_index->search($query); - - // ...therefore only 1 result should be returned - $this->assertEquals(1, $resultSet->count()); - } - - public function testSetTypeArraySearchArray() - { - $query = new Ids(); - - $query->setIds(array('1', '4')); - $query->setType(array('helloworld1', 'helloworld2')); - - $resultSet = $this->_index->search($query); - - $this->assertEquals(2, $resultSet->count()); - } - - public function testSetTypeArraySearchSingle() - { - $query = new Ids(); - - $query->setIds('4'); - $query->setType(array('helloworld1', 'helloworld2')); - - $resultSet = $this->_index->search($query); - - $this->assertEquals(1, $resultSet->count()); - } -} |