@@ -29,14 +29,14 @@ discard block |
||
| 29 | 29 | { |
| 30 | 30 | |
| 31 | 31 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 32 | - ->shouldReceive('performRequest')->once() |
|
| 33 | - ->with( |
|
| 34 | - 'GET', |
|
| 35 | - '/testIndex/_mapping', |
|
| 36 | - array(), |
|
| 37 | - null |
|
| 38 | - ) |
|
| 39 | - ->getMock(); |
|
| 32 | + ->shouldReceive('performRequest')->once() |
|
| 33 | + ->with( |
|
| 34 | + 'GET', |
|
| 35 | + '/testIndex/_mapping', |
|
| 36 | + array(), |
|
| 37 | + null |
|
| 38 | + ) |
|
| 39 | + ->getMock(); |
|
| 40 | 40 | |
| 41 | 41 | $action = new Get($mockTransport); |
| 42 | 42 | $action->setIndex('testIndex') |
@@ -48,14 +48,14 @@ discard block |
||
| 48 | 48 | { |
| 49 | 49 | |
| 50 | 50 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 51 | - ->shouldReceive('performRequest')->once() |
|
| 52 | - ->with( |
|
| 53 | - 'GET', |
|
| 54 | - '/_mapping/testType', |
|
| 55 | - array(), |
|
| 56 | - null |
|
| 57 | - ) |
|
| 58 | - ->getMock(); |
|
| 51 | + ->shouldReceive('performRequest')->once() |
|
| 52 | + ->with( |
|
| 53 | + 'GET', |
|
| 54 | + '/_mapping/testType', |
|
| 55 | + array(), |
|
| 56 | + null |
|
| 57 | + ) |
|
| 58 | + ->getMock(); |
|
| 59 | 59 | |
| 60 | 60 | $action = new Get($mockTransport); |
| 61 | 61 | $action->setType('testType') |
@@ -67,14 +67,14 @@ discard block |
||
| 67 | 67 | { |
| 68 | 68 | |
| 69 | 69 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 70 | - ->shouldReceive('performRequest')->once() |
|
| 71 | - ->with( |
|
| 72 | - 'GET', |
|
| 73 | - '/_mapping', |
|
| 74 | - array(), |
|
| 75 | - null |
|
| 76 | - ) |
|
| 77 | - ->getMock(); |
|
| 70 | + ->shouldReceive('performRequest')->once() |
|
| 71 | + ->with( |
|
| 72 | + 'GET', |
|
| 73 | + '/_mapping', |
|
| 74 | + array(), |
|
| 75 | + null |
|
| 76 | + ) |
|
| 77 | + ->getMock(); |
|
| 78 | 78 | |
| 79 | 79 | $action = new Get($mockTransport); |
| 80 | 80 | $action->performRequest(); |
@@ -85,14 +85,14 @@ discard block |
||
| 85 | 85 | { |
| 86 | 86 | |
| 87 | 87 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 88 | - ->shouldReceive('performRequest')->once() |
|
| 89 | - ->with( |
|
| 90 | - 'GET', |
|
| 91 | - '/testIndex/_mapping/testType', |
|
| 92 | - array(), |
|
| 93 | - null |
|
| 94 | - ) |
|
| 95 | - ->getMock(); |
|
| 88 | + ->shouldReceive('performRequest')->once() |
|
| 89 | + ->with( |
|
| 90 | + 'GET', |
|
| 91 | + '/testIndex/_mapping/testType', |
|
| 92 | + array(), |
|
| 93 | + null |
|
| 94 | + ) |
|
| 95 | + ->getMock(); |
|
| 96 | 96 | |
| 97 | 97 | $action = new Get($mockTransport); |
| 98 | 98 | $action->setIndex('testIndex')->setType('testType') |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | ->with( |
| 34 | 34 | 'GET', |
| 35 | 35 | '/testIndex/_mapping', |
| 36 | - array(), |
|
| 36 | + array (), |
|
| 37 | 37 | null |
| 38 | 38 | ) |
| 39 | 39 | ->getMock(); |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | ->with( |
| 53 | 53 | 'GET', |
| 54 | 54 | '/_mapping/testType', |
| 55 | - array(), |
|
| 55 | + array (), |
|
| 56 | 56 | null |
| 57 | 57 | ) |
| 58 | 58 | ->getMock(); |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | ->with( |
| 72 | 72 | 'GET', |
| 73 | 73 | '/_mapping', |
| 74 | - array(), |
|
| 74 | + array (), |
|
| 75 | 75 | null |
| 76 | 76 | ) |
| 77 | 77 | ->getMock(); |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | ->with( |
| 90 | 90 | 'GET', |
| 91 | 91 | '/testIndex/_mapping/testType', |
| 92 | - array(), |
|
| 92 | + array (), |
|
| 93 | 93 | null |
| 94 | 94 | ) |
| 95 | 95 | ->getMock(); |
@@ -19,14 +19,12 @@ discard block |
||
| 19 | 19 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 |
| 20 | 20 | * @link http://elasticsearch.org |
| 21 | 21 | */ |
| 22 | -class GetTest extends \PHPUnit_Framework_TestCase |
|
| 23 | -{ |
|
| 22 | +class GetTest extends \PHPUnit_Framework_TestCase { |
|
| 24 | 23 | public function tearDown() { |
| 25 | 24 | m::close(); |
| 26 | 25 | } |
| 27 | 26 | |
| 28 | - public function testValidGetWithIndex() |
|
| 29 | - { |
|
| 27 | + public function testValidGetWithIndex() { |
|
| 30 | 28 | |
| 31 | 29 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 32 | 30 | ->shouldReceive('performRequest')->once() |
@@ -44,8 +42,7 @@ discard block |
||
| 44 | 42 | |
| 45 | 43 | } |
| 46 | 44 | |
| 47 | - public function testValidGetWithType() |
|
| 48 | - { |
|
| 45 | + public function testValidGetWithType() { |
|
| 49 | 46 | |
| 50 | 47 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 51 | 48 | ->shouldReceive('performRequest')->once() |
@@ -63,8 +60,7 @@ discard block |
||
| 63 | 60 | |
| 64 | 61 | } |
| 65 | 62 | |
| 66 | - public function testValidGetWithNoIndexOrType() |
|
| 67 | - { |
|
| 63 | + public function testValidGetWithNoIndexOrType() { |
|
| 68 | 64 | |
| 69 | 65 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 70 | 66 | ->shouldReceive('performRequest')->once() |
@@ -81,8 +77,7 @@ discard block |
||
| 81 | 77 | |
| 82 | 78 | } |
| 83 | 79 | |
| 84 | - public function testValidGetWithIndexAndType() |
|
| 85 | - { |
|
| 80 | + public function testValidGetWithIndexAndType() { |
|
| 86 | 81 | |
| 87 | 82 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 88 | 83 | ->shouldReceive('performRequest')->once() |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | 'GET', |
| 35 | 35 | '/testIndex/_mapping', |
| 36 | 36 | array(), |
| 37 | - null |
|
| 37 | + NULL |
|
| 38 | 38 | ) |
| 39 | 39 | ->getMock(); |
| 40 | 40 | |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | 'GET', |
| 54 | 54 | '/_mapping/testType', |
| 55 | 55 | array(), |
| 56 | - null |
|
| 56 | + NULL |
|
| 57 | 57 | ) |
| 58 | 58 | ->getMock(); |
| 59 | 59 | |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | 'GET', |
| 73 | 73 | '/_mapping', |
| 74 | 74 | array(), |
| 75 | - null |
|
| 75 | + NULL |
|
| 76 | 76 | ) |
| 77 | 77 | ->getMock(); |
| 78 | 78 | |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | 'GET', |
| 91 | 91 | '/testIndex/_mapping/testType', |
| 92 | 92 | array(), |
| 93 | - null |
|
| 93 | + NULL |
|
| 94 | 94 | ) |
| 95 | 95 | ->getMock(); |
| 96 | 96 | |
@@ -59,14 +59,14 @@ |
||
| 59 | 59 | $body = array('field' => 'value'); |
| 60 | 60 | |
| 61 | 61 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 62 | - ->shouldReceive('performRequest')->once() |
|
| 63 | - ->with( |
|
| 64 | - 'PUT', |
|
| 65 | - '/testIndex/testType/_mapping', |
|
| 66 | - array(), |
|
| 67 | - $body |
|
| 68 | - ) |
|
| 69 | - ->getMock(); |
|
| 62 | + ->shouldReceive('performRequest')->once() |
|
| 63 | + ->with( |
|
| 64 | + 'PUT', |
|
| 65 | + '/testIndex/testType/_mapping', |
|
| 66 | + array(), |
|
| 67 | + $body |
|
| 68 | + ) |
|
| 69 | + ->getMock(); |
|
| 70 | 70 | |
| 71 | 71 | $action = new Put($mockTransport); |
| 72 | 72 | $action->setIndex('testIndex')->setType('testType')->setBody($body) |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | $mockTransport = m::mock('\Elasticsearch\Transport'); |
| 36 | 36 | |
| 37 | 37 | $index = new Put($mockTransport); |
| 38 | - $index->setIndex('testIndex')->setBody(array())->performRequest(); |
|
| 38 | + $index->setIndex('testIndex')->setBody(array ())->performRequest(); |
|
| 39 | 39 | |
| 40 | 40 | } |
| 41 | 41 | |
@@ -56,14 +56,14 @@ discard block |
||
| 56 | 56 | public function testValidPutWithIndexTypeAndBody() |
| 57 | 57 | { |
| 58 | 58 | |
| 59 | - $body = array('field' => 'value'); |
|
| 59 | + $body = array ('field' => 'value'); |
|
| 60 | 60 | |
| 61 | 61 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 62 | 62 | ->shouldReceive('performRequest')->once() |
| 63 | 63 | ->with( |
| 64 | 64 | 'PUT', |
| 65 | 65 | '/testIndex/testType/_mapping', |
| 66 | - array(), |
|
| 66 | + array (), |
|
| 67 | 67 | $body |
| 68 | 68 | ) |
| 69 | 69 | ->getMock(); |
@@ -20,8 +20,7 @@ discard block |
||
| 20 | 20 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 |
| 21 | 21 | * @link http://elasticsearch.org |
| 22 | 22 | */ |
| 23 | -class PutTest extends \PHPUnit_Framework_TestCase |
|
| 24 | -{ |
|
| 23 | +class PutTest extends \PHPUnit_Framework_TestCase { |
|
| 25 | 24 | public function tearDown() { |
| 26 | 25 | m::close(); |
| 27 | 26 | } |
@@ -29,8 +28,7 @@ discard block |
||
| 29 | 28 | /** |
| 30 | 29 | * @expectedException RuntimeException |
| 31 | 30 | */ |
| 32 | - public function testNoType() |
|
| 33 | - { |
|
| 31 | + public function testNoType() { |
|
| 34 | 32 | |
| 35 | 33 | $mockTransport = m::mock('\Elasticsearch\Transport'); |
| 36 | 34 | |
@@ -42,8 +40,7 @@ discard block |
||
| 42 | 40 | /** |
| 43 | 41 | * @expectedException RuntimeException |
| 44 | 42 | */ |
| 45 | - public function testNoBody() |
|
| 46 | - { |
|
| 43 | + public function testNoBody() { |
|
| 47 | 44 | |
| 48 | 45 | $mockTransport = m::mock('\Elasticsearch\Transport'); |
| 49 | 46 | |
@@ -53,8 +50,7 @@ discard block |
||
| 53 | 50 | } |
| 54 | 51 | |
| 55 | 52 | |
| 56 | - public function testValidPutWithIndexTypeAndBody() |
|
| 57 | - { |
|
| 53 | + public function testValidPutWithIndexTypeAndBody() { |
|
| 58 | 54 | |
| 59 | 55 | $body = array('field' => 'value'); |
| 60 | 56 | |
@@ -26,14 +26,14 @@ discard block |
||
| 26 | 26 | public function testValidFlushWithNoIndex() |
| 27 | 27 | { |
| 28 | 28 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 29 | - ->shouldReceive('performRequest')->once() |
|
| 30 | - ->with( |
|
| 31 | - 'GET', |
|
| 32 | - '/_flush', |
|
| 33 | - array(), |
|
| 34 | - null |
|
| 35 | - ) |
|
| 36 | - ->getMock(); |
|
| 29 | + ->shouldReceive('performRequest')->once() |
|
| 30 | + ->with( |
|
| 31 | + 'GET', |
|
| 32 | + '/_flush', |
|
| 33 | + array(), |
|
| 34 | + null |
|
| 35 | + ) |
|
| 36 | + ->getMock(); |
|
| 37 | 37 | |
| 38 | 38 | $action = new Flush($mockTransport); |
| 39 | 39 | $action->performRequest(); |
@@ -44,14 +44,14 @@ discard block |
||
| 44 | 44 | { |
| 45 | 45 | |
| 46 | 46 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 47 | - ->shouldReceive('performRequest')->once() |
|
| 48 | - ->with( |
|
| 49 | - 'GET', |
|
| 50 | - '/testIndex/_flush', |
|
| 51 | - array(), |
|
| 52 | - null |
|
| 53 | - ) |
|
| 54 | - ->getMock(); |
|
| 47 | + ->shouldReceive('performRequest')->once() |
|
| 48 | + ->with( |
|
| 49 | + 'GET', |
|
| 50 | + '/testIndex/_flush', |
|
| 51 | + array(), |
|
| 52 | + null |
|
| 53 | + ) |
|
| 54 | + ->getMock(); |
|
| 55 | 55 | |
| 56 | 56 | $action = new Flush($mockTransport); |
| 57 | 57 | $action->setIndex('testIndex') |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | ->with( |
| 31 | 31 | 'GET', |
| 32 | 32 | '/_flush', |
| 33 | - array(), |
|
| 33 | + array (), |
|
| 34 | 34 | null |
| 35 | 35 | ) |
| 36 | 36 | ->getMock(); |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | ->with( |
| 49 | 49 | 'GET', |
| 50 | 50 | '/testIndex/_flush', |
| 51 | - array(), |
|
| 51 | + array (), |
|
| 52 | 52 | null |
| 53 | 53 | ) |
| 54 | 54 | ->getMock(); |
@@ -17,14 +17,12 @@ discard block |
||
| 17 | 17 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 |
| 18 | 18 | * @link http://elasticsearch.org |
| 19 | 19 | */ |
| 20 | -class FlushTest extends \PHPUnit_Framework_TestCase |
|
| 21 | -{ |
|
| 20 | +class FlushTest extends \PHPUnit_Framework_TestCase { |
|
| 22 | 21 | public function tearDown() { |
| 23 | 22 | m::close(); |
| 24 | 23 | } |
| 25 | 24 | |
| 26 | - public function testValidFlushWithNoIndex() |
|
| 27 | - { |
|
| 25 | + public function testValidFlushWithNoIndex() { |
|
| 28 | 26 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 29 | 27 | ->shouldReceive('performRequest')->once() |
| 30 | 28 | ->with( |
@@ -40,8 +38,7 @@ discard block |
||
| 40 | 38 | |
| 41 | 39 | } |
| 42 | 40 | |
| 43 | - public function testValidFlushWithIndex() |
|
| 44 | - { |
|
| 41 | + public function testValidFlushWithIndex() { |
|
| 45 | 42 | |
| 46 | 43 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 47 | 44 | ->shouldReceive('performRequest')->once() |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | 'GET', |
| 32 | 32 | '/_flush', |
| 33 | 33 | array(), |
| 34 | - null |
|
| 34 | + NULL |
|
| 35 | 35 | ) |
| 36 | 36 | ->getMock(); |
| 37 | 37 | |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | 'GET', |
| 50 | 50 | '/testIndex/_flush', |
| 51 | 51 | array(), |
| 52 | - null |
|
| 52 | + NULL |
|
| 53 | 53 | ) |
| 54 | 54 | ->getMock(); |
| 55 | 55 | |
@@ -68,14 +68,14 @@ |
||
| 68 | 68 | { |
| 69 | 69 | |
| 70 | 70 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 71 | - ->shouldReceive('performRequest')->once() |
|
| 72 | - ->with( |
|
| 73 | - 'DELETE', |
|
| 74 | - '/testIndex/_warmer/testName', |
|
| 75 | - array(), |
|
| 76 | - null |
|
| 77 | - ) |
|
| 78 | - ->getMock(); |
|
| 71 | + ->shouldReceive('performRequest')->once() |
|
| 72 | + ->with( |
|
| 73 | + 'DELETE', |
|
| 74 | + '/testIndex/_warmer/testName', |
|
| 75 | + array(), |
|
| 76 | + null |
|
| 77 | + ) |
|
| 78 | + ->getMock(); |
|
| 79 | 79 | |
| 80 | 80 | $action = new Delete($mockTransport); |
| 81 | 81 | $action->setIndex('testIndex')->setName('testName')->performRequest(); |
@@ -72,7 +72,7 @@ |
||
| 72 | 72 | ->with( |
| 73 | 73 | 'DELETE', |
| 74 | 74 | '/testIndex/_warmer/testName', |
| 75 | - array(), |
|
| 75 | + array (), |
|
| 76 | 76 | null |
| 77 | 77 | ) |
| 78 | 78 | ->getMock(); |
@@ -18,8 +18,7 @@ discard block |
||
| 18 | 18 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 |
| 19 | 19 | * @link http://elasticsearch.org |
| 20 | 20 | */ |
| 21 | -class DeleteTest extends \PHPUnit_Framework_TestCase |
|
| 22 | -{ |
|
| 21 | +class DeleteTest extends \PHPUnit_Framework_TestCase { |
|
| 23 | 22 | public function tearDown() { |
| 24 | 23 | m::close(); |
| 25 | 24 | } |
@@ -28,8 +27,7 @@ discard block |
||
| 28 | 27 | /** |
| 29 | 28 | * @expectedException RuntimeException |
| 30 | 29 | */ |
| 31 | - public function testDeleteNoIndex() |
|
| 32 | - { |
|
| 30 | + public function testDeleteNoIndex() { |
|
| 33 | 31 | |
| 34 | 32 | $mockTransport = m::mock('\Elasticsearch\Transport'); |
| 35 | 33 | |
@@ -42,8 +40,7 @@ discard block |
||
| 42 | 40 | /** |
| 43 | 41 | * @expectedException RuntimeException |
| 44 | 42 | */ |
| 45 | - public function testDeleteWithOnlyIndex() |
|
| 46 | - { |
|
| 43 | + public function testDeleteWithOnlyIndex() { |
|
| 47 | 44 | |
| 48 | 45 | $mockTransport = m::mock('\Elasticsearch\Transport'); |
| 49 | 46 | |
@@ -55,8 +52,7 @@ discard block |
||
| 55 | 52 | /** |
| 56 | 53 | * @expectedException RuntimeException |
| 57 | 54 | */ |
| 58 | - public function testDeleteWithOnlyName() |
|
| 59 | - { |
|
| 55 | + public function testDeleteWithOnlyName() { |
|
| 60 | 56 | |
| 61 | 57 | $mockTransport = m::mock('\Elasticsearch\Transport'); |
| 62 | 58 | |
@@ -64,8 +60,7 @@ discard block |
||
| 64 | 60 | $action->setName('testName')->performRequest(); |
| 65 | 61 | |
| 66 | 62 | } |
| 67 | - public function testDeleteWithIndexAndName() |
|
| 68 | - { |
|
| 63 | + public function testDeleteWithIndexAndName() { |
|
| 69 | 64 | |
| 70 | 65 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 71 | 66 | ->shouldReceive('performRequest')->once() |
@@ -73,7 +73,7 @@ |
||
| 73 | 73 | 'DELETE', |
| 74 | 74 | '/testIndex/_warmer/testName', |
| 75 | 75 | array(), |
| 76 | - null |
|
| 76 | + NULL |
|
| 77 | 77 | ) |
| 78 | 78 | ->getMock(); |
| 79 | 79 | |
@@ -29,14 +29,14 @@ discard block |
||
| 29 | 29 | { |
| 30 | 30 | |
| 31 | 31 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 32 | - ->shouldReceive('performRequest')->once() |
|
| 33 | - ->with( |
|
| 34 | - 'GET', |
|
| 35 | - '/_warmer', |
|
| 36 | - array(), |
|
| 37 | - null |
|
| 38 | - ) |
|
| 39 | - ->getMock(); |
|
| 32 | + ->shouldReceive('performRequest')->once() |
|
| 33 | + ->with( |
|
| 34 | + 'GET', |
|
| 35 | + '/_warmer', |
|
| 36 | + array(), |
|
| 37 | + null |
|
| 38 | + ) |
|
| 39 | + ->getMock(); |
|
| 40 | 40 | |
| 41 | 41 | $action = new Get($mockTransport); |
| 42 | 42 | $action->performRequest(); |
@@ -47,14 +47,14 @@ discard block |
||
| 47 | 47 | { |
| 48 | 48 | |
| 49 | 49 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 50 | - ->shouldReceive('performRequest')->once() |
|
| 51 | - ->with( |
|
| 52 | - 'GET', |
|
| 53 | - '/testIndex/_warmer', |
|
| 54 | - array(), |
|
| 55 | - null |
|
| 56 | - ) |
|
| 57 | - ->getMock(); |
|
| 50 | + ->shouldReceive('performRequest')->once() |
|
| 51 | + ->with( |
|
| 52 | + 'GET', |
|
| 53 | + '/testIndex/_warmer', |
|
| 54 | + array(), |
|
| 55 | + null |
|
| 56 | + ) |
|
| 57 | + ->getMock(); |
|
| 58 | 58 | |
| 59 | 59 | $action = new Get($mockTransport); |
| 60 | 60 | $action->setIndex('testIndex')->performRequest(); |
@@ -79,14 +79,14 @@ discard block |
||
| 79 | 79 | { |
| 80 | 80 | |
| 81 | 81 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 82 | - ->shouldReceive('performRequest')->once() |
|
| 83 | - ->with( |
|
| 84 | - 'GET', |
|
| 85 | - '/testIndex/_warmer/testName', |
|
| 86 | - array(), |
|
| 87 | - null |
|
| 88 | - ) |
|
| 89 | - ->getMock(); |
|
| 82 | + ->shouldReceive('performRequest')->once() |
|
| 83 | + ->with( |
|
| 84 | + 'GET', |
|
| 85 | + '/testIndex/_warmer/testName', |
|
| 86 | + array(), |
|
| 87 | + null |
|
| 88 | + ) |
|
| 89 | + ->getMock(); |
|
| 90 | 90 | |
| 91 | 91 | $action = new Get($mockTransport); |
| 92 | 92 | $action->setIndex('testIndex')->setName('testName')->performRequest(); |
@@ -97,14 +97,14 @@ discard block |
||
| 97 | 97 | { |
| 98 | 98 | |
| 99 | 99 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 100 | - ->shouldReceive('performRequest')->once() |
|
| 101 | - ->with( |
|
| 102 | - 'GET', |
|
| 103 | - '/testIndex/testType/_warmer/testName', |
|
| 104 | - array(), |
|
| 105 | - null |
|
| 106 | - ) |
|
| 107 | - ->getMock(); |
|
| 100 | + ->shouldReceive('performRequest')->once() |
|
| 101 | + ->with( |
|
| 102 | + 'GET', |
|
| 103 | + '/testIndex/testType/_warmer/testName', |
|
| 104 | + array(), |
|
| 105 | + null |
|
| 106 | + ) |
|
| 107 | + ->getMock(); |
|
| 108 | 108 | |
| 109 | 109 | $action = new Get($mockTransport); |
| 110 | 110 | $action->setIndex('testIndex')->setType('testType')->setName('testName')->performRequest(); |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | ->with( |
| 34 | 34 | 'GET', |
| 35 | 35 | '/_warmer', |
| 36 | - array(), |
|
| 36 | + array (), |
|
| 37 | 37 | null |
| 38 | 38 | ) |
| 39 | 39 | ->getMock(); |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | ->with( |
| 52 | 52 | 'GET', |
| 53 | 53 | '/testIndex/_warmer', |
| 54 | - array(), |
|
| 54 | + array (), |
|
| 55 | 55 | null |
| 56 | 56 | ) |
| 57 | 57 | ->getMock(); |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | ->with( |
| 84 | 84 | 'GET', |
| 85 | 85 | '/testIndex/_warmer/testName', |
| 86 | - array(), |
|
| 86 | + array (), |
|
| 87 | 87 | null |
| 88 | 88 | ) |
| 89 | 89 | ->getMock(); |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | ->with( |
| 102 | 102 | 'GET', |
| 103 | 103 | '/testIndex/testType/_warmer/testName', |
| 104 | - array(), |
|
| 104 | + array (), |
|
| 105 | 105 | null |
| 106 | 106 | ) |
| 107 | 107 | ->getMock(); |
@@ -18,15 +18,13 @@ discard block |
||
| 18 | 18 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 |
| 19 | 19 | * @link http://elasticsearch.org |
| 20 | 20 | */ |
| 21 | -class GetTest extends \PHPUnit_Framework_TestCase |
|
| 22 | -{ |
|
| 21 | +class GetTest extends \PHPUnit_Framework_TestCase { |
|
| 23 | 22 | public function tearDown() { |
| 24 | 23 | m::close(); |
| 25 | 24 | } |
| 26 | 25 | |
| 27 | 26 | |
| 28 | - public function testGetNoIndex() |
|
| 29 | - { |
|
| 27 | + public function testGetNoIndex() { |
|
| 30 | 28 | |
| 31 | 29 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 32 | 30 | ->shouldReceive('performRequest')->once() |
@@ -43,8 +41,7 @@ discard block |
||
| 43 | 41 | |
| 44 | 42 | } |
| 45 | 43 | |
| 46 | - public function testGetWithIndex() |
|
| 47 | - { |
|
| 44 | + public function testGetWithIndex() { |
|
| 48 | 45 | |
| 49 | 46 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 50 | 47 | ->shouldReceive('performRequest')->once() |
@@ -65,8 +62,7 @@ discard block |
||
| 65 | 62 | /** |
| 66 | 63 | * @expectedException RuntimeException |
| 67 | 64 | */ |
| 68 | - public function testGetWithIndexAndType() |
|
| 69 | - { |
|
| 65 | + public function testGetWithIndexAndType() { |
|
| 70 | 66 | |
| 71 | 67 | $mockTransport = m::mock('\Elasticsearch\Transport'); |
| 72 | 68 | |
@@ -75,8 +71,7 @@ discard block |
||
| 75 | 71 | |
| 76 | 72 | } |
| 77 | 73 | |
| 78 | - public function testGetWithIndexAndName() |
|
| 79 | - { |
|
| 74 | + public function testGetWithIndexAndName() { |
|
| 80 | 75 | |
| 81 | 76 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 82 | 77 | ->shouldReceive('performRequest')->once() |
@@ -93,8 +88,7 @@ discard block |
||
| 93 | 88 | |
| 94 | 89 | } |
| 95 | 90 | |
| 96 | - public function testGetWithIndexTypeAndName() |
|
| 97 | - { |
|
| 91 | + public function testGetWithIndexTypeAndName() { |
|
| 98 | 92 | |
| 99 | 93 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 100 | 94 | ->shouldReceive('performRequest')->once() |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | 'GET', |
| 35 | 35 | '/_warmer', |
| 36 | 36 | array(), |
| 37 | - null |
|
| 37 | + NULL |
|
| 38 | 38 | ) |
| 39 | 39 | ->getMock(); |
| 40 | 40 | |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | 'GET', |
| 53 | 53 | '/testIndex/_warmer', |
| 54 | 54 | array(), |
| 55 | - null |
|
| 55 | + NULL |
|
| 56 | 56 | ) |
| 57 | 57 | ->getMock(); |
| 58 | 58 | |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | 'GET', |
| 85 | 85 | '/testIndex/_warmer/testName', |
| 86 | 86 | array(), |
| 87 | - null |
|
| 87 | + NULL |
|
| 88 | 88 | ) |
| 89 | 89 | ->getMock(); |
| 90 | 90 | |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | 'GET', |
| 103 | 103 | '/testIndex/testType/_warmer/testName', |
| 104 | 104 | array(), |
| 105 | - null |
|
| 105 | + NULL |
|
| 106 | 106 | ) |
| 107 | 107 | ->getMock(); |
| 108 | 108 | |
@@ -30,14 +30,14 @@ discard block |
||
| 30 | 30 | { |
| 31 | 31 | |
| 32 | 32 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 33 | - ->shouldReceive('performRequest')->once() |
|
| 34 | - ->with( |
|
| 35 | - 'PUT', |
|
| 36 | - '/_warmer/testName', |
|
| 37 | - array(), |
|
| 38 | - null |
|
| 39 | - ) |
|
| 40 | - ->getMock(); |
|
| 33 | + ->shouldReceive('performRequest')->once() |
|
| 34 | + ->with( |
|
| 35 | + 'PUT', |
|
| 36 | + '/_warmer/testName', |
|
| 37 | + array(), |
|
| 38 | + null |
|
| 39 | + ) |
|
| 40 | + ->getMock(); |
|
| 41 | 41 | |
| 42 | 42 | $action = new Put($mockTransport); |
| 43 | 43 | $action->setName('testName')->setBody(array())->performRequest(); |
@@ -77,14 +77,14 @@ discard block |
||
| 77 | 77 | $body = array('field' => 'value'); |
| 78 | 78 | |
| 79 | 79 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 80 | - ->shouldReceive('performRequest')->once() |
|
| 81 | - ->with( |
|
| 82 | - 'PUT', |
|
| 83 | - '/testIndex/_warmer/testName', |
|
| 84 | - array(), |
|
| 85 | - $body |
|
| 86 | - ) |
|
| 87 | - ->getMock(); |
|
| 80 | + ->shouldReceive('performRequest')->once() |
|
| 81 | + ->with( |
|
| 82 | + 'PUT', |
|
| 83 | + '/testIndex/_warmer/testName', |
|
| 84 | + array(), |
|
| 85 | + $body |
|
| 86 | + ) |
|
| 87 | + ->getMock(); |
|
| 88 | 88 | |
| 89 | 89 | $action = new Put($mockTransport); |
| 90 | 90 | $action->setIndex('testIndex')->setName('testName')->setBody($body)->performRequest(); |
@@ -96,14 +96,14 @@ discard block |
||
| 96 | 96 | $body = array('field' => 'value'); |
| 97 | 97 | |
| 98 | 98 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 99 | - ->shouldReceive('performRequest')->once() |
|
| 100 | - ->with( |
|
| 101 | - 'PUT', |
|
| 102 | - '/testIndex/testType/_warmer/testName', |
|
| 103 | - array(), |
|
| 104 | - $body |
|
| 105 | - ) |
|
| 106 | - ->getMock(); |
|
| 99 | + ->shouldReceive('performRequest')->once() |
|
| 100 | + ->with( |
|
| 101 | + 'PUT', |
|
| 102 | + '/testIndex/testType/_warmer/testName', |
|
| 103 | + array(), |
|
| 104 | + $body |
|
| 105 | + ) |
|
| 106 | + ->getMock(); |
|
| 107 | 107 | |
| 108 | 108 | $action = new Put($mockTransport); |
| 109 | 109 | $action->setIndex('testIndex')->setName('testName')->setBody($body)->setType('testType')->performRequest(); |
@@ -34,13 +34,13 @@ discard block |
||
| 34 | 34 | ->with( |
| 35 | 35 | 'PUT', |
| 36 | 36 | '/_warmer/testName', |
| 37 | - array(), |
|
| 37 | + array (), |
|
| 38 | 38 | null |
| 39 | 39 | ) |
| 40 | 40 | ->getMock(); |
| 41 | 41 | |
| 42 | 42 | $action = new Put($mockTransport); |
| 43 | - $action->setName('testName')->setBody(array())->performRequest(); |
|
| 43 | + $action->setName('testName')->setBody(array ())->performRequest(); |
|
| 44 | 44 | |
| 45 | 45 | } |
| 46 | 46 | |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | $mockTransport = m::mock('\Elasticsearch\Transport'); |
| 67 | 67 | |
| 68 | 68 | $action = new Put($mockTransport); |
| 69 | - $action->setIndex('testIndex')->setBody(array())->performRequest(); |
|
| 69 | + $action->setIndex('testIndex')->setBody(array ())->performRequest(); |
|
| 70 | 70 | |
| 71 | 71 | } |
| 72 | 72 | |
@@ -74,14 +74,14 @@ discard block |
||
| 74 | 74 | |
| 75 | 75 | public function testPutWithIndexNameAndBody() |
| 76 | 76 | { |
| 77 | - $body = array('field' => 'value'); |
|
| 77 | + $body = array ('field' => 'value'); |
|
| 78 | 78 | |
| 79 | 79 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 80 | 80 | ->shouldReceive('performRequest')->once() |
| 81 | 81 | ->with( |
| 82 | 82 | 'PUT', |
| 83 | 83 | '/testIndex/_warmer/testName', |
| 84 | - array(), |
|
| 84 | + array (), |
|
| 85 | 85 | $body |
| 86 | 86 | ) |
| 87 | 87 | ->getMock(); |
@@ -93,14 +93,14 @@ discard block |
||
| 93 | 93 | |
| 94 | 94 | public function testPutWithIndexTypeNameAndBody() |
| 95 | 95 | { |
| 96 | - $body = array('field' => 'value'); |
|
| 96 | + $body = array ('field' => 'value'); |
|
| 97 | 97 | |
| 98 | 98 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 99 | 99 | ->shouldReceive('performRequest')->once() |
| 100 | 100 | ->with( |
| 101 | 101 | 'PUT', |
| 102 | 102 | '/testIndex/testType/_warmer/testName', |
| 103 | - array(), |
|
| 103 | + array (), |
|
| 104 | 104 | $body |
| 105 | 105 | ) |
| 106 | 106 | ->getMock(); |
@@ -19,15 +19,13 @@ discard block |
||
| 19 | 19 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 |
| 20 | 20 | * @link http://elasticsearch.org |
| 21 | 21 | */ |
| 22 | -class PutTest extends \PHPUnit_Framework_TestCase |
|
| 23 | -{ |
|
| 22 | +class PutTest extends \PHPUnit_Framework_TestCase { |
|
| 24 | 23 | public function tearDown() { |
| 25 | 24 | m::close(); |
| 26 | 25 | } |
| 27 | 26 | |
| 28 | 27 | |
| 29 | - public function testPutNoIndex() |
|
| 30 | - { |
|
| 28 | + public function testPutNoIndex() { |
|
| 31 | 29 | |
| 32 | 30 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 33 | 31 | ->shouldReceive('performRequest')->once() |
@@ -47,8 +45,7 @@ discard block |
||
| 47 | 45 | /** |
| 48 | 46 | * @expectedException RuntimeException |
| 49 | 47 | */ |
| 50 | - public function testPutNoBody() |
|
| 51 | - { |
|
| 48 | + public function testPutNoBody() { |
|
| 52 | 49 | |
| 53 | 50 | $mockTransport = m::mock('\Elasticsearch\Transport'); |
| 54 | 51 | |
@@ -60,8 +57,7 @@ discard block |
||
| 60 | 57 | /** |
| 61 | 58 | * @expectedException RuntimeException |
| 62 | 59 | */ |
| 63 | - public function testPutNoName() |
|
| 64 | - { |
|
| 60 | + public function testPutNoName() { |
|
| 65 | 61 | |
| 66 | 62 | $mockTransport = m::mock('\Elasticsearch\Transport'); |
| 67 | 63 | |
@@ -72,8 +68,7 @@ discard block |
||
| 72 | 68 | |
| 73 | 69 | |
| 74 | 70 | |
| 75 | - public function testPutWithIndexNameAndBody() |
|
| 76 | - { |
|
| 71 | + public function testPutWithIndexNameAndBody() { |
|
| 77 | 72 | $body = array('field' => 'value'); |
| 78 | 73 | |
| 79 | 74 | $mockTransport = m::mock('\Elasticsearch\Transport') |
@@ -91,8 +86,7 @@ discard block |
||
| 91 | 86 | |
| 92 | 87 | } |
| 93 | 88 | |
| 94 | - public function testPutWithIndexTypeNameAndBody() |
|
| 95 | - { |
|
| 89 | + public function testPutWithIndexTypeNameAndBody() { |
|
| 96 | 90 | $body = array('field' => 'value'); |
| 97 | 91 | |
| 98 | 92 | $mockTransport = m::mock('\Elasticsearch\Transport') |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | 'PUT', |
| 36 | 36 | '/_warmer/testName', |
| 37 | 37 | array(), |
| 38 | - null |
|
| 38 | + NULL |
|
| 39 | 39 | ) |
| 40 | 40 | ->getMock(); |
| 41 | 41 | |
@@ -26,14 +26,14 @@ discard block |
||
| 26 | 26 | public function testValidSegmentsWithNoIndex() |
| 27 | 27 | { |
| 28 | 28 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 29 | - ->shouldReceive('performRequest')->once() |
|
| 30 | - ->with( |
|
| 31 | - 'GET', |
|
| 32 | - '/_segments', |
|
| 33 | - array(), |
|
| 34 | - null |
|
| 35 | - ) |
|
| 36 | - ->getMock(); |
|
| 29 | + ->shouldReceive('performRequest')->once() |
|
| 30 | + ->with( |
|
| 31 | + 'GET', |
|
| 32 | + '/_segments', |
|
| 33 | + array(), |
|
| 34 | + null |
|
| 35 | + ) |
|
| 36 | + ->getMock(); |
|
| 37 | 37 | |
| 38 | 38 | $action = new Segments($mockTransport); |
| 39 | 39 | $action->performRequest(); |
@@ -44,14 +44,14 @@ discard block |
||
| 44 | 44 | { |
| 45 | 45 | |
| 46 | 46 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 47 | - ->shouldReceive('performRequest')->once() |
|
| 48 | - ->with( |
|
| 49 | - 'GET', |
|
| 50 | - '/testIndex/_segments', |
|
| 51 | - array(), |
|
| 52 | - null |
|
| 53 | - ) |
|
| 54 | - ->getMock(); |
|
| 47 | + ->shouldReceive('performRequest')->once() |
|
| 48 | + ->with( |
|
| 49 | + 'GET', |
|
| 50 | + '/testIndex/_segments', |
|
| 51 | + array(), |
|
| 52 | + null |
|
| 53 | + ) |
|
| 54 | + ->getMock(); |
|
| 55 | 55 | |
| 56 | 56 | $action = new Segments($mockTransport); |
| 57 | 57 | $action->setIndex('testIndex') |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | ->with( |
| 31 | 31 | 'GET', |
| 32 | 32 | '/_segments', |
| 33 | - array(), |
|
| 33 | + array (), |
|
| 34 | 34 | null |
| 35 | 35 | ) |
| 36 | 36 | ->getMock(); |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | ->with( |
| 49 | 49 | 'GET', |
| 50 | 50 | '/testIndex/_segments', |
| 51 | - array(), |
|
| 51 | + array (), |
|
| 52 | 52 | null |
| 53 | 53 | ) |
| 54 | 54 | ->getMock(); |
@@ -17,14 +17,12 @@ discard block |
||
| 17 | 17 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 |
| 18 | 18 | * @link http://elasticsearch.org |
| 19 | 19 | */ |
| 20 | -class SegmentsTest extends \PHPUnit_Framework_TestCase |
|
| 21 | -{ |
|
| 20 | +class SegmentsTest extends \PHPUnit_Framework_TestCase { |
|
| 22 | 21 | public function tearDown() { |
| 23 | 22 | m::close(); |
| 24 | 23 | } |
| 25 | 24 | |
| 26 | - public function testValidSegmentsWithNoIndex() |
|
| 27 | - { |
|
| 25 | + public function testValidSegmentsWithNoIndex() { |
|
| 28 | 26 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 29 | 27 | ->shouldReceive('performRequest')->once() |
| 30 | 28 | ->with( |
@@ -40,8 +38,7 @@ discard block |
||
| 40 | 38 | |
| 41 | 39 | } |
| 42 | 40 | |
| 43 | - public function testValidSegmentsWithIndex() |
|
| 44 | - { |
|
| 41 | + public function testValidSegmentsWithIndex() { |
|
| 45 | 42 | |
| 46 | 43 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 47 | 44 | ->shouldReceive('performRequest')->once() |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | 'GET', |
| 32 | 32 | '/_segments', |
| 33 | 33 | array(), |
| 34 | - null |
|
| 34 | + NULL |
|
| 35 | 35 | ) |
| 36 | 36 | ->getMock(); |
| 37 | 37 | |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | 'GET', |
| 50 | 50 | '/testIndex/_segments', |
| 51 | 51 | array(), |
| 52 | - null |
|
| 52 | + NULL |
|
| 53 | 53 | ) |
| 54 | 54 | ->getMock(); |
| 55 | 55 | |
@@ -27,14 +27,14 @@ discard block |
||
| 27 | 27 | public function testValidQueryWithNoIndexNoType() |
| 28 | 28 | { |
| 29 | 29 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 30 | - ->shouldReceive('performRequest')->once() |
|
| 31 | - ->with( |
|
| 32 | - 'GET', |
|
| 33 | - '/_all/_validate/query', |
|
| 34 | - array(), |
|
| 35 | - null |
|
| 36 | - ) |
|
| 37 | - ->getMock(); |
|
| 30 | + ->shouldReceive('performRequest')->once() |
|
| 31 | + ->with( |
|
| 32 | + 'GET', |
|
| 33 | + '/_all/_validate/query', |
|
| 34 | + array(), |
|
| 35 | + null |
|
| 36 | + ) |
|
| 37 | + ->getMock(); |
|
| 38 | 38 | |
| 39 | 39 | $action = new Query($mockTransport); |
| 40 | 40 | $action->performRequest(); |
@@ -45,14 +45,14 @@ discard block |
||
| 45 | 45 | { |
| 46 | 46 | |
| 47 | 47 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 48 | - ->shouldReceive('performRequest')->once() |
|
| 49 | - ->with( |
|
| 50 | - 'GET', |
|
| 51 | - '/testIndex/_validate/query', |
|
| 52 | - array(), |
|
| 53 | - null |
|
| 54 | - ) |
|
| 55 | - ->getMock(); |
|
| 48 | + ->shouldReceive('performRequest')->once() |
|
| 49 | + ->with( |
|
| 50 | + 'GET', |
|
| 51 | + '/testIndex/_validate/query', |
|
| 52 | + array(), |
|
| 53 | + null |
|
| 54 | + ) |
|
| 55 | + ->getMock(); |
|
| 56 | 56 | |
| 57 | 57 | $action = new Query($mockTransport); |
| 58 | 58 | $action->setIndex('testIndex') |
@@ -64,14 +64,14 @@ discard block |
||
| 64 | 64 | { |
| 65 | 65 | |
| 66 | 66 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 67 | - ->shouldReceive('performRequest')->once() |
|
| 68 | - ->with( |
|
| 69 | - 'GET', |
|
| 70 | - '/_all/testType/_validate/query', |
|
| 71 | - array(), |
|
| 72 | - null |
|
| 73 | - ) |
|
| 74 | - ->getMock(); |
|
| 67 | + ->shouldReceive('performRequest')->once() |
|
| 68 | + ->with( |
|
| 69 | + 'GET', |
|
| 70 | + '/_all/testType/_validate/query', |
|
| 71 | + array(), |
|
| 72 | + null |
|
| 73 | + ) |
|
| 74 | + ->getMock(); |
|
| 75 | 75 | |
| 76 | 76 | $action = new Query($mockTransport); |
| 77 | 77 | $action->setType('testType') |
@@ -83,14 +83,14 @@ discard block |
||
| 83 | 83 | { |
| 84 | 84 | |
| 85 | 85 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 86 | - ->shouldReceive('performRequest')->once() |
|
| 87 | - ->with( |
|
| 88 | - 'GET', |
|
| 89 | - '/testIndex/testType/_validate/query', |
|
| 90 | - array(), |
|
| 91 | - null |
|
| 92 | - ) |
|
| 93 | - ->getMock(); |
|
| 86 | + ->shouldReceive('performRequest')->once() |
|
| 87 | + ->with( |
|
| 88 | + 'GET', |
|
| 89 | + '/testIndex/testType/_validate/query', |
|
| 90 | + array(), |
|
| 91 | + null |
|
| 92 | + ) |
|
| 93 | + ->getMock(); |
|
| 94 | 94 | |
| 95 | 95 | $action = new Query($mockTransport); |
| 96 | 96 | $action->setIndex('testIndex')->setType('testType') |
@@ -104,14 +104,14 @@ discard block |
||
| 104 | 104 | $body = array('field' => 'value'); |
| 105 | 105 | |
| 106 | 106 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 107 | - ->shouldReceive('performRequest')->once() |
|
| 108 | - ->with( |
|
| 109 | - 'GET', |
|
| 110 | - '/_all/_validate/query', |
|
| 111 | - array(), |
|
| 112 | - $body |
|
| 113 | - ) |
|
| 114 | - ->getMock(); |
|
| 107 | + ->shouldReceive('performRequest')->once() |
|
| 108 | + ->with( |
|
| 109 | + 'GET', |
|
| 110 | + '/_all/_validate/query', |
|
| 111 | + array(), |
|
| 112 | + $body |
|
| 113 | + ) |
|
| 114 | + ->getMock(); |
|
| 115 | 115 | |
| 116 | 116 | $action = new Query($mockTransport); |
| 117 | 117 | $action->setBody($body) |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | ->with( |
| 32 | 32 | 'GET', |
| 33 | 33 | '/_all/_validate/query', |
| 34 | - array(), |
|
| 34 | + array (), |
|
| 35 | 35 | null |
| 36 | 36 | ) |
| 37 | 37 | ->getMock(); |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | ->with( |
| 50 | 50 | 'GET', |
| 51 | 51 | '/testIndex/_validate/query', |
| 52 | - array(), |
|
| 52 | + array (), |
|
| 53 | 53 | null |
| 54 | 54 | ) |
| 55 | 55 | ->getMock(); |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | ->with( |
| 69 | 69 | 'GET', |
| 70 | 70 | '/_all/testType/_validate/query', |
| 71 | - array(), |
|
| 71 | + array (), |
|
| 72 | 72 | null |
| 73 | 73 | ) |
| 74 | 74 | ->getMock(); |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | ->with( |
| 88 | 88 | 'GET', |
| 89 | 89 | '/testIndex/testType/_validate/query', |
| 90 | - array(), |
|
| 90 | + array (), |
|
| 91 | 91 | null |
| 92 | 92 | ) |
| 93 | 93 | ->getMock(); |
@@ -101,14 +101,14 @@ discard block |
||
| 101 | 101 | public function testValidQueryWithBody() |
| 102 | 102 | { |
| 103 | 103 | |
| 104 | - $body = array('field' => 'value'); |
|
| 104 | + $body = array ('field' => 'value'); |
|
| 105 | 105 | |
| 106 | 106 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 107 | 107 | ->shouldReceive('performRequest')->once() |
| 108 | 108 | ->with( |
| 109 | 109 | 'GET', |
| 110 | 110 | '/_all/_validate/query', |
| 111 | - array(), |
|
| 111 | + array (), |
|
| 112 | 112 | $body |
| 113 | 113 | ) |
| 114 | 114 | ->getMock(); |
@@ -18,14 +18,12 @@ discard block |
||
| 18 | 18 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 |
| 19 | 19 | * @link http://elasticsearch.org |
| 20 | 20 | */ |
| 21 | -class QueryTest extends \PHPUnit_Framework_TestCase |
|
| 22 | -{ |
|
| 21 | +class QueryTest extends \PHPUnit_Framework_TestCase { |
|
| 23 | 22 | public function tearDown() { |
| 24 | 23 | m::close(); |
| 25 | 24 | } |
| 26 | 25 | |
| 27 | - public function testValidQueryWithNoIndexNoType() |
|
| 28 | - { |
|
| 26 | + public function testValidQueryWithNoIndexNoType() { |
|
| 29 | 27 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 30 | 28 | ->shouldReceive('performRequest')->once() |
| 31 | 29 | ->with( |
@@ -41,8 +39,7 @@ discard block |
||
| 41 | 39 | |
| 42 | 40 | } |
| 43 | 41 | |
| 44 | - public function testValidQueryWithIndex() |
|
| 45 | - { |
|
| 42 | + public function testValidQueryWithIndex() { |
|
| 46 | 43 | |
| 47 | 44 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 48 | 45 | ->shouldReceive('performRequest')->once() |
@@ -60,8 +57,7 @@ discard block |
||
| 60 | 57 | |
| 61 | 58 | } |
| 62 | 59 | |
| 63 | - public function testValidQueryWithType() |
|
| 64 | - { |
|
| 60 | + public function testValidQueryWithType() { |
|
| 65 | 61 | |
| 66 | 62 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 67 | 63 | ->shouldReceive('performRequest')->once() |
@@ -79,8 +75,7 @@ discard block |
||
| 79 | 75 | |
| 80 | 76 | } |
| 81 | 77 | |
| 82 | - public function testValidQueryWithIndexAndType() |
|
| 83 | - { |
|
| 78 | + public function testValidQueryWithIndexAndType() { |
|
| 84 | 79 | |
| 85 | 80 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 86 | 81 | ->shouldReceive('performRequest')->once() |
@@ -98,8 +93,7 @@ discard block |
||
| 98 | 93 | |
| 99 | 94 | } |
| 100 | 95 | |
| 101 | - public function testValidQueryWithBody() |
|
| 102 | - { |
|
| 96 | + public function testValidQueryWithBody() { |
|
| 103 | 97 | |
| 104 | 98 | $body = array('field' => 'value'); |
| 105 | 99 | |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | 'GET', |
| 33 | 33 | '/_all/_validate/query', |
| 34 | 34 | array(), |
| 35 | - null |
|
| 35 | + NULL |
|
| 36 | 36 | ) |
| 37 | 37 | ->getMock(); |
| 38 | 38 | |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | 'GET', |
| 51 | 51 | '/testIndex/_validate/query', |
| 52 | 52 | array(), |
| 53 | - null |
|
| 53 | + NULL |
|
| 54 | 54 | ) |
| 55 | 55 | ->getMock(); |
| 56 | 56 | |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | 'GET', |
| 70 | 70 | '/_all/testType/_validate/query', |
| 71 | 71 | array(), |
| 72 | - null |
|
| 72 | + NULL |
|
| 73 | 73 | ) |
| 74 | 74 | ->getMock(); |
| 75 | 75 | |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | 'GET', |
| 89 | 89 | '/testIndex/testType/_validate/query', |
| 90 | 90 | array(), |
| 91 | - null |
|
| 91 | + NULL |
|
| 92 | 92 | ) |
| 93 | 93 | ->getMock(); |
| 94 | 94 | |
@@ -41,14 +41,14 @@ |
||
| 41 | 41 | { |
| 42 | 42 | |
| 43 | 43 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 44 | - ->shouldReceive('performRequest')->once() |
|
| 45 | - ->with( |
|
| 46 | - 'DELETE', |
|
| 47 | - '/_template/testName', |
|
| 48 | - array(), |
|
| 49 | - null |
|
| 50 | - ) |
|
| 51 | - ->getMock(); |
|
| 44 | + ->shouldReceive('performRequest')->once() |
|
| 45 | + ->with( |
|
| 46 | + 'DELETE', |
|
| 47 | + '/_template/testName', |
|
| 48 | + array(), |
|
| 49 | + null |
|
| 50 | + ) |
|
| 51 | + ->getMock(); |
|
| 52 | 52 | |
| 53 | 53 | $action = new Delete($mockTransport); |
| 54 | 54 | $action->setIndex('testIndex')->setName('testName') |
@@ -45,7 +45,7 @@ |
||
| 45 | 45 | ->with( |
| 46 | 46 | 'DELETE', |
| 47 | 47 | '/_template/testName', |
| 48 | - array(), |
|
| 48 | + array (), |
|
| 49 | 49 | null |
| 50 | 50 | ) |
| 51 | 51 | ->getMock(); |
@@ -18,8 +18,7 @@ discard block |
||
| 18 | 18 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 |
| 19 | 19 | * @link http://elasticsearch.org |
| 20 | 20 | */ |
| 21 | -class DeleteTest extends \PHPUnit_Framework_TestCase |
|
| 22 | -{ |
|
| 21 | +class DeleteTest extends \PHPUnit_Framework_TestCase { |
|
| 23 | 22 | public function tearDown() { |
| 24 | 23 | m::close(); |
| 25 | 24 | } |
@@ -27,8 +26,7 @@ discard block |
||
| 27 | 26 | /** |
| 28 | 27 | * @expectedException RuntimeException |
| 29 | 28 | */ |
| 30 | - public function testNoName() |
|
| 31 | - { |
|
| 29 | + public function testNoName() { |
|
| 32 | 30 | |
| 33 | 31 | $mockTransport = m::mock('\Elasticsearch\Transport'); |
| 34 | 32 | |
@@ -37,8 +35,7 @@ discard block |
||
| 37 | 35 | |
| 38 | 36 | } |
| 39 | 37 | |
| 40 | - public function testValidDelete() |
|
| 41 | - { |
|
| 38 | + public function testValidDelete() { |
|
| 42 | 39 | |
| 43 | 40 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 44 | 41 | ->shouldReceive('performRequest')->once() |
@@ -46,7 +46,7 @@ |
||
| 46 | 46 | 'DELETE', |
| 47 | 47 | '/_template/testName', |
| 48 | 48 | array(), |
| 49 | - null |
|
| 49 | + NULL |
|
| 50 | 50 | ) |
| 51 | 51 | ->getMock(); |
| 52 | 52 | |