From 80f7dc77d430774192b929d780f96260066df2ee Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sun, 18 Oct 2015 09:31:31 +0200 Subject: Update to MediaWiki 1.25.3 --- .../lib/Elastica/Test/Query/PostFilterTest.php | 83 ---------------------- 1 file changed, 83 deletions(-) delete mode 100644 vendor/ruflin/elastica/test/lib/Elastica/Test/Query/PostFilterTest.php (limited to 'vendor/ruflin/elastica/test/lib/Elastica/Test/Query/PostFilterTest.php') diff --git a/vendor/ruflin/elastica/test/lib/Elastica/Test/Query/PostFilterTest.php b/vendor/ruflin/elastica/test/lib/Elastica/Test/Query/PostFilterTest.php deleted file mode 100644 index 16b7e07b..00000000 --- a/vendor/ruflin/elastica/test/lib/Elastica/Test/Query/PostFilterTest.php +++ /dev/null @@ -1,83 +0,0 @@ -_index = $this->_createIndex("query"); - $docs = array( - new Document("1", array("color" => "green", "make" => "ford")), - new Document("2", array("color" => "blue", "make" => "volvo")), - new Document("3", array("color" => "red", "make" => "ford")), - new Document("4", array("color" => "green", "make" => "renault")), - ); - $this->_index->getType("test")->addDocuments($docs); - $this->_index->refresh(); - - } - - protected function tearDown() - { - parent::tearDown(); - if ($this->_index instanceof Index) { - $this->_index->delete(); - } - } - - public function testToArray() - { - $query = new Query(); - - $post_filter = new Term(array('color' => 'green')); - $query->setPostFilter($post_filter->toArray()); - - $data = $query->toArray(); - - $this->assertArrayHasKey('post_filter', $data); - $this->assertEquals(array('term' => array('color' => 'green')), $data['post_filter']); - - $query->setPostFilter(array()); - - $this->assertArrayNotHasKey('post_filter', $query->toArray()); - } - - public function testQuery() - { - $query = new Query(); - - $match = new Match(); - $match->setField('make', 'ford'); - - $query->setQuery($match); - - $filter = new Term(); - $filter->setTerm('color', 'green'); - - $query->setPostFilter($filter->toArray()); - - $results = $this->_index->search($query); - - $this->assertEquals(1, $results->getTotalHits()); - - } - - protected function _createIndex($name = 'test', $delete = true, $shards = 1) - { - return parent::_createIndex('test_postfilter_' . $name, $delete, $shards); - } -} -- cgit v1.2.3-54-g00ecf