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 --- .../elastica/test/lib/Elastica/Test/ResultTest.php | 121 --------------------- 1 file changed, 121 deletions(-) delete mode 100644 vendor/ruflin/elastica/test/lib/Elastica/Test/ResultTest.php (limited to 'vendor/ruflin/elastica/test/lib/Elastica/Test/ResultTest.php') diff --git a/vendor/ruflin/elastica/test/lib/Elastica/Test/ResultTest.php b/vendor/ruflin/elastica/test/lib/Elastica/Test/ResultTest.php deleted file mode 100644 index 54d3ce55..00000000 --- a/vendor/ruflin/elastica/test/lib/Elastica/Test/ResultTest.php +++ /dev/null @@ -1,121 +0,0 @@ -_createIndex(); - $type = $index->getType($typeName); - - // Adds 1 document to the index - $docId = 3; - $doc1 = new Document($docId, array('username' => 'hans')); - $type->addDocument($doc1); - - // Refreshes index - $index->refresh(); - - $resultSet = $type->search('hans'); - - $this->assertEquals(1, $resultSet->count()); - - $result = $resultSet->current(); - - $this->assertInstanceOf('Elastica\Result', $result); - $this->assertEquals($index->getName(), $result->getIndex()); - $this->assertEquals($typeName, $result->getType()); - $this->assertEquals($docId, $result->getId()); - $this->assertGreaterThan(0, $result->getScore()); - $this->assertInternalType('array', $result->getData()); - $this->assertTrue(isset($result->username)); - $this->assertEquals('hans', $result->username); - } - - public function testGetIdNoSource() - { - // Creates a new index 'xodoa' and a type 'user' inside this index - $indexName = 'xodoa'; - $typeName = 'user'; - - $client = $this->_getClient(); - $index = $client->getIndex($indexName); - $index->create(array(), true); - $type = $index->getType($typeName); - - $mapping = new Mapping($type); - $mapping->disableSource(); - $mapping->send(); - - // Adds 1 document to the index - $docId = 3; - $doc1 = new Document($docId, array('username' => 'hans')); - $type->addDocument($doc1); - - // Refreshes index - $index->refresh(); - - $resultSet = $type->search('hans'); - - $this->assertEquals(1, $resultSet->count()); - - $result = $resultSet->current(); - - $this->assertEquals(array(), $result->getSource()); - $this->assertInstanceOf('Elastica\Result', $result); - $this->assertEquals($indexName, $result->getIndex()); - $this->assertEquals($typeName, $result->getType()); - $this->assertEquals($docId, $result->getId()); - $this->assertGreaterThan(0, $result->getScore()); - $this->assertInternalType('array', $result->getData()); - } - - public function testGetTotalTimeReturnsExpectedResults() - { - $typeName = 'user'; - $index = $this->_createIndex(); - $type = $index->getType($typeName); - - // Adds 1 document to the index - $docId = 3; - $doc1 = new Document($docId, array('username' => 'hans')); - $type->addDocument($doc1); - - // Refreshes index - $index->refresh(); - - $resultSet = $type->search('hans'); - - $this->assertNotNull($resultSet->getTotalTime(), 'Get Total Time should never be a null value'); - $this->assertEquals( - 'integer', - getType($resultSet->getTotalTime()), - 'Total Time should be an integer' - ); - } - - public function testHasFields() - { - $data = array('value set'); - - $result = new Result(array()); - $this->assertFalse($result->hasFields()); - - $result = new Result(array('_source' => $data)); - $this->assertFalse($result->hasFields()); - - $result = new Result(array('fields' => $data)); - $this->assertTrue($result->hasFields()); - $this->assertEquals($data, $result->getFields()); - } -} -- cgit v1.2.3-54-g00ecf