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/Exception/ResponseExceptionTest.php | |
parent | cccd7bb4d819334c07e0dadaf16cbfdef31880e1 (diff) |
Update to MediaWiki 1.25.3
Diffstat (limited to 'vendor/ruflin/elastica/test/lib/Elastica/Test/Exception/ResponseExceptionTest.php')
-rw-r--r-- | vendor/ruflin/elastica/test/lib/Elastica/Test/Exception/ResponseExceptionTest.php | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/vendor/ruflin/elastica/test/lib/Elastica/Test/Exception/ResponseExceptionTest.php b/vendor/ruflin/elastica/test/lib/Elastica/Test/Exception/ResponseExceptionTest.php deleted file mode 100644 index 06b5462b..00000000 --- a/vendor/ruflin/elastica/test/lib/Elastica/Test/Exception/ResponseExceptionTest.php +++ /dev/null @@ -1,60 +0,0 @@ -<?php - -namespace Elastica\Test\Exception; - -use Elastica\Document; -use Elastica\Exception\ResponseException; -use Elastica\Test\Base as BaseTest; - -class ResponseExceptionTest extends BaseTest -{ - - public function testCreateExistingIndex() - { - $this->_createIndex('woo', true); - - try { - $this->_createIndex('woo', false); - $this->fail('Index created when it should fail'); - } catch (ResponseException $ex) { - $this->assertEquals('IndexAlreadyExistsException', $ex->getElasticsearchException()->getExceptionName()); - $this->assertEquals(400, $ex->getElasticsearchException()->getCode()); - } - } - - public function testBadType() - { - $index = $this->_createIndex('woo'); - $type = $index->getType('test'); - - $type->setMapping(array( - 'num' => array( - 'type' => 'long' - ) - )); - - try { - $type->addDocument(new Document('', array( - 'num' => 'not number at all', - ))); - $this->fail('Indexing with wrong type should fail'); - } catch (ResponseException $ex) { - $this->assertEquals('MapperParsingException', $ex->getElasticsearchException()->getExceptionName()); - $this->assertEquals(400, $ex->getElasticsearchException()->getCode()); - } - } - - public function testWhatever() - { - $index = $this->_createIndex('woo'); - $index->delete(); - - try { - $index->search(); - } catch (ResponseException $ex) { - $this->assertEquals('IndexMissingException', $ex->getElasticsearchException()->getExceptionName()); - $this->assertEquals(404, $ex->getElasticsearchException()->getCode()); - } - } - -} |