summaryrefslogtreecommitdiff
path: root/vendor/ruflin/elastica/test/lib/Elastica/Test/RequestTest.php
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2016-05-01 15:31:33 -0400
committerLuke Shumaker <lukeshu@sbcglobal.net>2016-05-01 15:31:33 -0400
commit150f94f051128f367bc89f6b7e5f57eb2a69fc62 (patch)
tree181f454813b310ee97385058c6c6f2e3f34d5fd8 /vendor/ruflin/elastica/test/lib/Elastica/Test/RequestTest.php
parent7e85254903c7c0cb49e381f16b18441ea7b058cc (diff)
parent80f7dc77d430774192b929d780f96260066df2ee (diff)
Merge commit '80f7dc'
# Conflicts: # extensions/ArchInterWiki.sql
Diffstat (limited to 'vendor/ruflin/elastica/test/lib/Elastica/Test/RequestTest.php')
-rw-r--r--vendor/ruflin/elastica/test/lib/Elastica/Test/RequestTest.php87
1 files changed, 0 insertions, 87 deletions
diff --git a/vendor/ruflin/elastica/test/lib/Elastica/Test/RequestTest.php b/vendor/ruflin/elastica/test/lib/Elastica/Test/RequestTest.php
deleted file mode 100644
index 8896adeb..00000000
--- a/vendor/ruflin/elastica/test/lib/Elastica/Test/RequestTest.php
+++ /dev/null
@@ -1,87 +0,0 @@
-<?php
-
-namespace Elastica\Test;
-
-use Elastica\Connection;
-use Elastica\Request;
-use Elastica\Test\Base as BaseTest;
-
-class RequestTest extends BaseTest
-{
-
- public function testConstructor()
- {
- $path = 'test';
- $method = Request::POST;
- $query = array('no' => 'params');
- $data = array('key' => 'value');
-
- $request = new Request($path, $method, $data, $query);
-
- $this->assertEquals($path, $request->getPath());
- $this->assertEquals($method, $request->getMethod());
- $this->assertEquals($query, $request->getQuery());
- $this->assertEquals($data, $request->getData());
- }
-
- /**
- * @expectedException \Elastica\Exception\InvalidException
- */
- public function testInvalidConnection()
- {
- $request = new Request('', Request::GET);
- $request->send();
- }
-
- public function testSend()
- {
- $connection = new Connection();
- $connection->setHost('localhost');
- $connection->setPort('9200');
-
- $request = new Request('_status', Request::GET, array(), array(), $connection);
-
- $response = $request->send();
-
- $this->assertInstanceOf('Elastica\Response', $response);
- }
-
- public function testToString()
- {
- $path = 'test';
- $method = Request::POST;
- $query = array('no' => 'params');
- $data = array('key' => 'value');
-
- $connection = new Connection();
- $connection->setHost('localhost');
- $connection->setPort('9200');
-
- $request = new Request($path, $method, $data, $query, $connection);
-
- $data = $request->toArray();
-
- $this->assertInternalType('array', $data);
- $this->assertArrayHasKey('method', $data);
- $this->assertArrayHasKey('path', $data);
- $this->assertArrayHasKey('query', $data);
- $this->assertArrayHasKey('data', $data);
- $this->assertArrayHasKey('connection', $data);
- $this->assertEquals($request->getMethod(), $data['method']);
- $this->assertEquals($request->getPath(), $data['path']);
- $this->assertEquals($request->getQuery(), $data['query']);
- $this->assertEquals($request->getData(), $data['data']);
- $this->assertInternalType('array', $data['connection']);
- $this->assertArrayHasKey('host', $data['connection']);
- $this->assertArrayHasKey('port', $data['connection']);
- $this->assertEquals($request->getConnection()->getHost(), $data['connection']['host']);
- $this->assertEquals($request->getConnection()->getPort(), $data['connection']['port']);
-
- $string = $request->toString();
-
- $this->assertInternalType('string', $string);
-
- $string = (string) $request;
- $this->assertInternalType('string', $string);
- }
-}