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 --- .../test/lib/Elastica/Test/Filter/NestedTest.php | 121 --------------------- 1 file changed, 121 deletions(-) delete mode 100644 vendor/ruflin/elastica/test/lib/Elastica/Test/Filter/NestedTest.php (limited to 'vendor/ruflin/elastica/test/lib/Elastica/Test/Filter/NestedTest.php') diff --git a/vendor/ruflin/elastica/test/lib/Elastica/Test/Filter/NestedTest.php b/vendor/ruflin/elastica/test/lib/Elastica/Test/Filter/NestedTest.php deleted file mode 100644 index 8d0d2004..00000000 --- a/vendor/ruflin/elastica/test/lib/Elastica/Test/Filter/NestedTest.php +++ /dev/null @@ -1,121 +0,0 @@ -_getClient(); - $index = $client->getIndex('elastica_test_filter_nested'); - $index->create(array(), true); - $type = $index->getType('user'); - $mapping = new Mapping(); - $mapping->setProperties( - array( - 'firstname' => array('type' => 'string', 'store' => 'yes'), - // default is store => no expected - 'lastname' => array('type' => 'string'), - 'hobbies' => array( - 'type' => 'nested', - 'include_in_parent' => true, - 'properties' => array('hobby' => array('type' => 'string')) - ) - ) - ); - $type->setMapping($mapping); - - // Adds a list of documents with _bulk upload to the index - $docs = array(); - $docs[] = new Document(1, - array( - 'firstname' => 'Nicolas', - 'lastname' => 'Ruflin', - 'hobbies' => array( - array('hobby' => 'opensource') - ) - ) - ); - $docs[] = new Document(2, - array( - 'firstname' => 'Nicolas', - 'lastname' => 'Ippolito', - 'hobbies' => array( - array('hobby' => 'opensource'), - array('hobby' => 'guitar'), - ) - ) - ); - $response = $type->addDocuments($docs); - - // Refresh index - $index->refresh(); - } - - public function tearDown() - { - $client = $this->_getClient(); - $index = $client->getIndex('elastica_test_filter_nested'); - $index->delete(); - } - - public function testToArray() - { - $f = new Nested(); - $this->assertEquals(array('nested' => array()), $f->toArray()); - $q = new Terms(); - $q->setTerms('hobby', array('guitar')); - $f->setPath('hobbies'); - $f->setQuery($q); - - $expectedArray = array( - 'nested' => array( - 'path' => 'hobbies', - 'query' => array('terms' => array( - 'hobby' => array('guitar') - )) - ) - ); - - $this->assertEquals($expectedArray, $f->toArray()); - } - - public function testShouldReturnTheRightNumberOfResult() - { - $f = new Nested(); - $this->assertEquals(array('nested' => array()), $f->toArray()); - $q = new Terms(); - $q->setTerms('hobby', array('guitar')); - $f->setPath('hobbies'); - $f->setQuery($q); - - $c = $this->_getClient(); - $s = new Search($c); - $i = $c->getIndex('elastica_test_filter_nested'); - $s->addIndex($i); - $r = $s->search($f); - - $this->assertEquals(1, $r->getTotalHits()); - - $f = new Nested(); - $this->assertEquals(array('nested' => array()), $f->toArray()); - $q = new Terms(); - $q->setTerms('hobby', array('opensource')); - $f->setPath('hobbies'); - $f->setQuery($q); - - $c = $this->_getClient(); - $s = new Search($c); - $i = $c->getIndex('elastica_test_filter_nested'); - $s->addIndex($i); - $r = $s->search($f); - $this->assertEquals(2, $r->getTotalHits()); - } -} -- cgit v1.2.3-54-g00ecf