@@ -27,14 +27,14 @@ |
||
| 27 | 27 | public function testValidInfo() |
| 28 | 28 | { |
| 29 | 29 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 30 | - ->shouldReceive('performRequest')->once() |
|
| 31 | - ->with( |
|
| 32 | - 'GET', |
|
| 33 | - '/', |
|
| 34 | - array(), |
|
| 35 | - null |
|
| 36 | - ) |
|
| 37 | - ->getMock(); |
|
| 30 | + ->shouldReceive('performRequest')->once() |
|
| 31 | + ->with( |
|
| 32 | + 'GET', |
|
| 33 | + '/', |
|
| 34 | + array(), |
|
| 35 | + null |
|
| 36 | + ) |
|
| 37 | + ->getMock(); |
|
| 38 | 38 | |
| 39 | 39 | $action = new Info($mockTransport); |
| 40 | 40 | $action->performRequest(); |
@@ -31,7 +31,7 @@ |
||
| 31 | 31 | ->with( |
| 32 | 32 | 'GET', |
| 33 | 33 | '/', |
| 34 | - array(), |
|
| 34 | + array (), |
|
| 35 | 35 | null |
| 36 | 36 | ) |
| 37 | 37 | ->getMock(); |
@@ -17,15 +17,13 @@ |
||
| 17 | 17 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 |
| 18 | 18 | * @link http://elasticsearch.org |
| 19 | 19 | */ |
| 20 | -class InfoTest extends \PHPUnit_Framework_TestCase |
|
| 21 | -{ |
|
| 20 | +class InfoTest extends \PHPUnit_Framework_TestCase { |
|
| 22 | 21 | public function tearDown() { |
| 23 | 22 | m::close(); |
| 24 | 23 | } |
| 25 | 24 | |
| 26 | 25 | |
| 27 | - public function testValidInfo() |
|
| 28 | - { |
|
| 26 | + public function testValidInfo() { |
|
| 29 | 27 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 30 | 28 | ->shouldReceive('performRequest')->once() |
| 31 | 29 | ->with( |
@@ -32,7 +32,7 @@ |
||
| 32 | 32 | 'GET', |
| 33 | 33 | '/', |
| 34 | 34 | array(), |
| 35 | - null |
|
| 35 | + NULL |
|
| 36 | 36 | ) |
| 37 | 37 | ->getMock(); |
| 38 | 38 | |
@@ -44,14 +44,14 @@ discard block |
||
| 44 | 44 | $uri = '/_suggest'; |
| 45 | 45 | $body = 'abc'; |
| 46 | 46 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 47 | - ->shouldReceive('performRequest')->once() |
|
| 48 | - ->with( |
|
| 49 | - m::any(), |
|
| 50 | - $uri, |
|
| 51 | - array(), |
|
| 52 | - $body |
|
| 53 | - ) |
|
| 54 | - ->getMock(); |
|
| 47 | + ->shouldReceive('performRequest')->once() |
|
| 48 | + ->with( |
|
| 49 | + m::any(), |
|
| 50 | + $uri, |
|
| 51 | + array(), |
|
| 52 | + $body |
|
| 53 | + ) |
|
| 54 | + ->getMock(); |
|
| 55 | 55 | |
| 56 | 56 | $action = new Suggest($mockTransport); |
| 57 | 57 | $action->setBody($body)->performRequest(); |
@@ -62,14 +62,14 @@ discard block |
||
| 62 | 62 | { |
| 63 | 63 | $body = 'abc'; |
| 64 | 64 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 65 | - ->shouldReceive('performRequest')->once() |
|
| 66 | - ->with( |
|
| 67 | - 'GET', |
|
| 68 | - '/testIndex/_suggest', |
|
| 69 | - array(), |
|
| 70 | - $body |
|
| 71 | - ) |
|
| 72 | - ->getMock(); |
|
| 65 | + ->shouldReceive('performRequest')->once() |
|
| 66 | + ->with( |
|
| 67 | + 'GET', |
|
| 68 | + '/testIndex/_suggest', |
|
| 69 | + array(), |
|
| 70 | + $body |
|
| 71 | + ) |
|
| 72 | + ->getMock(); |
|
| 73 | 73 | |
| 74 | 74 | $action = new Suggest($mockTransport); |
| 75 | 75 | $action->setBody($body)->setIndex('testIndex') |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | */ |
| 32 | 32 | public function testGetURIWithNoIndexOrBody() |
| 33 | 33 | { |
| 34 | - $mockTransport = m::mock('\Elasticsearch\Transport');; |
|
| 34 | + $mockTransport = m::mock('\Elasticsearch\Transport'); ; |
|
| 35 | 35 | |
| 36 | 36 | $action = new Suggest($mockTransport); |
| 37 | 37 | $action->performRequest(); |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | ->with( |
| 49 | 49 | m::any(), |
| 50 | 50 | $uri, |
| 51 | - array(), |
|
| 51 | + array (), |
|
| 52 | 52 | $body |
| 53 | 53 | ) |
| 54 | 54 | ->getMock(); |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | ->with( |
| 67 | 67 | 'GET', |
| 68 | 68 | '/testIndex/_suggest', |
| 69 | - array(), |
|
| 69 | + array (), |
|
| 70 | 70 | $body |
| 71 | 71 | ) |
| 72 | 72 | ->getMock(); |
@@ -19,8 +19,7 @@ discard block |
||
| 19 | 19 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 |
| 20 | 20 | * @link http://elasticsearch.org |
| 21 | 21 | */ |
| 22 | -class SuggestTest extends \PHPUnit_Framework_TestCase |
|
| 23 | -{ |
|
| 22 | +class SuggestTest extends \PHPUnit_Framework_TestCase { |
|
| 24 | 23 | public function tearDown() { |
| 25 | 24 | m::close(); |
| 26 | 25 | } |
@@ -29,8 +28,7 @@ discard block |
||
| 29 | 28 | /** |
| 30 | 29 | * @expectedException RuntimeException |
| 31 | 30 | */ |
| 32 | - public function testGetURIWithNoIndexOrBody() |
|
| 33 | - { |
|
| 31 | + public function testGetURIWithNoIndexOrBody() { |
|
| 34 | 32 | $mockTransport = m::mock('\Elasticsearch\Transport');; |
| 35 | 33 | |
| 36 | 34 | $action = new Suggest($mockTransport); |
@@ -38,8 +36,7 @@ discard block |
||
| 38 | 36 | |
| 39 | 37 | } |
| 40 | 38 | |
| 41 | - public function testGetURIWithNoIndex() |
|
| 42 | - { |
|
| 39 | + public function testGetURIWithNoIndex() { |
|
| 43 | 40 | |
| 44 | 41 | $uri = '/_suggest'; |
| 45 | 42 | $body = 'abc'; |
@@ -58,8 +55,7 @@ discard block |
||
| 58 | 55 | |
| 59 | 56 | } |
| 60 | 57 | |
| 61 | - public function testValidSuggest() |
|
| 62 | - { |
|
| 58 | + public function testValidSuggest() { |
|
| 63 | 59 | $body = 'abc'; |
| 64 | 60 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 65 | 61 | ->shouldReceive('performRequest')->once() |
@@ -30,14 +30,14 @@ discard block |
||
| 30 | 30 | $uri = '/_cluster/health'; |
| 31 | 31 | |
| 32 | 32 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 33 | - ->shouldReceive('performRequest')->once() |
|
| 34 | - ->with( |
|
| 35 | - 'GET', |
|
| 36 | - $uri, |
|
| 37 | - array(), |
|
| 38 | - null |
|
| 39 | - ) |
|
| 40 | - ->getMock(); |
|
| 33 | + ->shouldReceive('performRequest')->once() |
|
| 34 | + ->with( |
|
| 35 | + 'GET', |
|
| 36 | + $uri, |
|
| 37 | + array(), |
|
| 38 | + null |
|
| 39 | + ) |
|
| 40 | + ->getMock(); |
|
| 41 | 41 | |
| 42 | 42 | $action = new Health($mockTransport); |
| 43 | 43 | $action->performRequest(); |
@@ -49,14 +49,14 @@ discard block |
||
| 49 | 49 | $uri = '/_cluster/health/testIndex'; |
| 50 | 50 | |
| 51 | 51 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 52 | - ->shouldReceive('performRequest')->once() |
|
| 53 | - ->with( |
|
| 54 | - 'GET', |
|
| 55 | - $uri, |
|
| 56 | - array(), |
|
| 57 | - null |
|
| 58 | - ) |
|
| 59 | - ->getMock(); |
|
| 52 | + ->shouldReceive('performRequest')->once() |
|
| 53 | + ->with( |
|
| 54 | + 'GET', |
|
| 55 | + $uri, |
|
| 56 | + array(), |
|
| 57 | + null |
|
| 58 | + ) |
|
| 59 | + ->getMock(); |
|
| 60 | 60 | |
| 61 | 61 | $action = new Health($mockTransport); |
| 62 | 62 | $action->setIndex('testIndex') |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | ->with( |
| 35 | 35 | 'GET', |
| 36 | 36 | $uri, |
| 37 | - array(), |
|
| 37 | + array (), |
|
| 38 | 38 | null |
| 39 | 39 | ) |
| 40 | 40 | ->getMock(); |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | ->with( |
| 54 | 54 | 'GET', |
| 55 | 55 | $uri, |
| 56 | - array(), |
|
| 56 | + array (), |
|
| 57 | 57 | null |
| 58 | 58 | ) |
| 59 | 59 | ->getMock(); |
@@ -17,15 +17,13 @@ discard block |
||
| 17 | 17 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 |
| 18 | 18 | * @link http://elasticsearch.org |
| 19 | 19 | */ |
| 20 | -class HealthTest extends \PHPUnit_Framework_TestCase |
|
| 21 | -{ |
|
| 20 | +class HealthTest extends \PHPUnit_Framework_TestCase { |
|
| 22 | 21 | |
| 23 | 22 | public function tearDown() { |
| 24 | 23 | m::close(); |
| 25 | 24 | } |
| 26 | 25 | |
| 27 | - public function testGetURIWithNoIndex() |
|
| 28 | - { |
|
| 26 | + public function testGetURIWithNoIndex() { |
|
| 29 | 27 | |
| 30 | 28 | $uri = '/_cluster/health'; |
| 31 | 29 | |
@@ -44,8 +42,7 @@ discard block |
||
| 44 | 42 | |
| 45 | 43 | } |
| 46 | 44 | |
| 47 | - public function testGetURIWithIndex() |
|
| 48 | - { |
|
| 45 | + public function testGetURIWithIndex() { |
|
| 49 | 46 | $uri = '/_cluster/health/testIndex'; |
| 50 | 47 | |
| 51 | 48 | $mockTransport = m::mock('\Elasticsearch\Transport') |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | 'GET', |
| 36 | 36 | $uri, |
| 37 | 37 | array(), |
| 38 | - null |
|
| 38 | + NULL |
|
| 39 | 39 | ) |
| 40 | 40 | ->getMock(); |
| 41 | 41 | |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | 'GET', |
| 55 | 55 | $uri, |
| 56 | 56 | array(), |
| 57 | - null |
|
| 57 | + NULL |
|
| 58 | 58 | ) |
| 59 | 59 | ->getMock(); |
| 60 | 60 | |
@@ -27,14 +27,14 @@ |
||
| 27 | 27 | public function testValidGet() |
| 28 | 28 | { |
| 29 | 29 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 30 | - ->shouldReceive('performRequest')->once() |
|
| 31 | - ->with( |
|
| 32 | - 'GET', |
|
| 33 | - '/_cluster/settings', |
|
| 34 | - array(), |
|
| 35 | - null |
|
| 36 | - ) |
|
| 37 | - ->getMock(); |
|
| 30 | + ->shouldReceive('performRequest')->once() |
|
| 31 | + ->with( |
|
| 32 | + 'GET', |
|
| 33 | + '/_cluster/settings', |
|
| 34 | + array(), |
|
| 35 | + null |
|
| 36 | + ) |
|
| 37 | + ->getMock(); |
|
| 38 | 38 | |
| 39 | 39 | $action = new Get($mockTransport); |
| 40 | 40 | $action->performRequest(); |
@@ -31,7 +31,7 @@ |
||
| 31 | 31 | ->with( |
| 32 | 32 | 'GET', |
| 33 | 33 | '/_cluster/settings', |
| 34 | - array(), |
|
| 34 | + array (), |
|
| 35 | 35 | null |
| 36 | 36 | ) |
| 37 | 37 | ->getMock(); |
@@ -18,14 +18,12 @@ |
||
| 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 | - public function testValidGet() |
|
| 28 | - { |
|
| 26 | + public function testValidGet() { |
|
| 29 | 27 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 30 | 28 | ->shouldReceive('performRequest')->once() |
| 31 | 29 | ->with( |
@@ -32,7 +32,7 @@ |
||
| 32 | 32 | 'GET', |
| 33 | 33 | '/_cluster/settings', |
| 34 | 34 | array(), |
| 35 | - null |
|
| 35 | + NULL |
|
| 36 | 36 | ) |
| 37 | 37 | ->getMock(); |
| 38 | 38 | |
@@ -30,14 +30,14 @@ discard block |
||
| 30 | 30 | $query['docs'] = '1'; |
| 31 | 31 | |
| 32 | 32 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 33 | - ->shouldReceive('performRequest')->once() |
|
| 34 | - ->with( |
|
| 35 | - m::any(), |
|
| 36 | - m::any(), |
|
| 37 | - array(), |
|
| 38 | - $query |
|
| 39 | - ) |
|
| 40 | - ->getMock(); |
|
| 33 | + ->shouldReceive('performRequest')->once() |
|
| 34 | + ->with( |
|
| 35 | + m::any(), |
|
| 36 | + m::any(), |
|
| 37 | + array(), |
|
| 38 | + $query |
|
| 39 | + ) |
|
| 40 | + ->getMock(); |
|
| 41 | 41 | |
| 42 | 42 | $action = new Put($mockTransport); |
| 43 | 43 | $action->setBody($query) |
@@ -50,14 +50,14 @@ discard block |
||
| 50 | 50 | $Puttings = array('field' => 'value'); |
| 51 | 51 | |
| 52 | 52 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 53 | - ->shouldReceive('performRequest')->once() |
|
| 54 | - ->with( |
|
| 55 | - 'PUT', |
|
| 56 | - '/_cluster/settings', |
|
| 57 | - array(), |
|
| 58 | - $Puttings |
|
| 59 | - ) |
|
| 60 | - ->getMock(); |
|
| 53 | + ->shouldReceive('performRequest')->once() |
|
| 54 | + ->with( |
|
| 55 | + 'PUT', |
|
| 56 | + '/_cluster/settings', |
|
| 57 | + array(), |
|
| 58 | + $Puttings |
|
| 59 | + ) |
|
| 60 | + ->getMock(); |
|
| 61 | 61 | |
| 62 | 62 | $action = new Put($mockTransport); |
| 63 | 63 | $action->setBody($Puttings) |
@@ -68,14 +68,14 @@ discard block |
||
| 68 | 68 | public function testValidPutWithoutBody() |
| 69 | 69 | { |
| 70 | 70 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 71 | - ->shouldReceive('performRequest')->once() |
|
| 72 | - ->with( |
|
| 73 | - 'PUT', |
|
| 74 | - '/_cluster/settings', |
|
| 75 | - array(), |
|
| 76 | - null |
|
| 77 | - ) |
|
| 78 | - ->getMock(); |
|
| 71 | + ->shouldReceive('performRequest')->once() |
|
| 72 | + ->with( |
|
| 73 | + 'PUT', |
|
| 74 | + '/_cluster/settings', |
|
| 75 | + array(), |
|
| 76 | + null |
|
| 77 | + ) |
|
| 78 | + ->getMock(); |
|
| 79 | 79 | |
| 80 | 80 | $action = new Put($mockTransport); |
| 81 | 81 | $action->performRequest(); |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | ->with( |
| 35 | 35 | m::any(), |
| 36 | 36 | m::any(), |
| 37 | - array(), |
|
| 37 | + array (), |
|
| 38 | 38 | $query |
| 39 | 39 | ) |
| 40 | 40 | ->getMock(); |
@@ -47,14 +47,14 @@ discard block |
||
| 47 | 47 | |
| 48 | 48 | public function testValidPutWithBody() |
| 49 | 49 | { |
| 50 | - $Puttings = array('field' => 'value'); |
|
| 50 | + $Puttings = array ('field' => 'value'); |
|
| 51 | 51 | |
| 52 | 52 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 53 | 53 | ->shouldReceive('performRequest')->once() |
| 54 | 54 | ->with( |
| 55 | 55 | 'PUT', |
| 56 | 56 | '/_cluster/settings', |
| 57 | - array(), |
|
| 57 | + array (), |
|
| 58 | 58 | $Puttings |
| 59 | 59 | ) |
| 60 | 60 | ->getMock(); |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | ->with( |
| 73 | 73 | 'PUT', |
| 74 | 74 | '/_cluster/settings', |
| 75 | - array(), |
|
| 75 | + array (), |
|
| 76 | 76 | null |
| 77 | 77 | ) |
| 78 | 78 | ->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 PutTest extends \PHPUnit_Framework_TestCase |
|
| 22 | -{ |
|
| 21 | +class PutTest extends \PHPUnit_Framework_TestCase { |
|
| 23 | 22 | public function tearDown() { |
| 24 | 23 | m::close(); |
| 25 | 24 | } |
| 26 | 25 | |
| 27 | 26 | |
| 28 | - public function testPutBody() |
|
| 29 | - { |
|
| 27 | + public function testPutBody() { |
|
| 30 | 28 | $query['docs'] = '1'; |
| 31 | 29 | |
| 32 | 30 | $mockTransport = m::mock('\Elasticsearch\Transport') |
@@ -45,8 +43,7 @@ discard block |
||
| 45 | 43 | |
| 46 | 44 | } |
| 47 | 45 | |
| 48 | - public function testValidPutWithBody() |
|
| 49 | - { |
|
| 46 | + public function testValidPutWithBody() { |
|
| 50 | 47 | $Puttings = array('field' => 'value'); |
| 51 | 48 | |
| 52 | 49 | $mockTransport = m::mock('\Elasticsearch\Transport') |
@@ -65,8 +62,7 @@ discard block |
||
| 65 | 62 | |
| 66 | 63 | } |
| 67 | 64 | |
| 68 | - public function testValidPutWithoutBody() |
|
| 69 | - { |
|
| 65 | + public function testValidPutWithoutBody() { |
|
| 70 | 66 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 71 | 67 | ->shouldReceive('performRequest')->once() |
| 72 | 68 | ->with( |
@@ -73,7 +73,7 @@ |
||
| 73 | 73 | 'PUT', |
| 74 | 74 | '/_cluster/settings', |
| 75 | 75 | array(), |
| 76 | - null |
|
| 76 | + NULL |
|
| 77 | 77 | ) |
| 78 | 78 | ->getMock(); |
| 79 | 79 | |
@@ -28,14 +28,14 @@ |
||
| 28 | 28 | public function testValidState() |
| 29 | 29 | { |
| 30 | 30 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 31 | - ->shouldReceive('performRequest')->once() |
|
| 32 | - ->with( |
|
| 33 | - 'GET', |
|
| 34 | - '/_cluster/state', |
|
| 35 | - array(), |
|
| 36 | - null |
|
| 37 | - ) |
|
| 38 | - ->getMock(); |
|
| 31 | + ->shouldReceive('performRequest')->once() |
|
| 32 | + ->with( |
|
| 33 | + 'GET', |
|
| 34 | + '/_cluster/state', |
|
| 35 | + array(), |
|
| 36 | + null |
|
| 37 | + ) |
|
| 38 | + ->getMock(); |
|
| 39 | 39 | |
| 40 | 40 | $action = new State($mockTransport); |
| 41 | 41 | $action->performRequest(); |
@@ -32,7 +32,7 @@ |
||
| 32 | 32 | ->with( |
| 33 | 33 | 'GET', |
| 34 | 34 | '/_cluster/state', |
| 35 | - array(), |
|
| 35 | + array (), |
|
| 36 | 36 | null |
| 37 | 37 | ) |
| 38 | 38 | ->getMock(); |
@@ -18,15 +18,13 @@ |
||
| 18 | 18 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 |
| 19 | 19 | * @link http://elasticsearch.org |
| 20 | 20 | */ |
| 21 | -class StateTest extends \PHPUnit_Framework_TestCase |
|
| 22 | -{ |
|
| 21 | +class StateTest extends \PHPUnit_Framework_TestCase { |
|
| 23 | 22 | public function tearDown() { |
| 24 | 23 | m::close(); |
| 25 | 24 | } |
| 26 | 25 | |
| 27 | 26 | |
| 28 | - public function testValidState() |
|
| 29 | - { |
|
| 27 | + public function testValidState() { |
|
| 30 | 28 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 31 | 29 | ->shouldReceive('performRequest')->once() |
| 32 | 30 | ->with( |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | 'GET', |
| 34 | 34 | '/_cluster/state', |
| 35 | 35 | array(), |
| 36 | - null |
|
| 36 | + NULL |
|
| 37 | 37 | ) |
| 38 | 38 | ->getMock(); |
| 39 | 39 | |
@@ -28,14 +28,14 @@ discard block |
||
| 28 | 28 | public function testValidSettingsWithNodeID() |
| 29 | 29 | { |
| 30 | 30 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 31 | - ->shouldReceive('performRequest')->once()->once() |
|
| 32 | - ->with( |
|
| 33 | - 'GET', |
|
| 34 | - '/_cluster/nodes/abc/hotthreads', |
|
| 35 | - array(), |
|
| 36 | - null |
|
| 37 | - ) |
|
| 38 | - ->getMock(); |
|
| 31 | + ->shouldReceive('performRequest')->once()->once() |
|
| 32 | + ->with( |
|
| 33 | + 'GET', |
|
| 34 | + '/_cluster/nodes/abc/hotthreads', |
|
| 35 | + array(), |
|
| 36 | + null |
|
| 37 | + ) |
|
| 38 | + ->getMock(); |
|
| 39 | 39 | |
| 40 | 40 | $action = new HotThreads($mockTransport); |
| 41 | 41 | $action->setNodeID('abc') |
@@ -62,14 +62,14 @@ discard block |
||
| 62 | 62 | public function testValidSettingsWithoutNodeID() |
| 63 | 63 | { |
| 64 | 64 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 65 | - ->shouldReceive('performRequest')->once() |
|
| 66 | - ->with( |
|
| 67 | - 'GET', |
|
| 68 | - '/_cluster/nodes/hotthreads', |
|
| 69 | - array(), |
|
| 70 | - null |
|
| 71 | - ) |
|
| 72 | - ->getMock(); |
|
| 65 | + ->shouldReceive('performRequest')->once() |
|
| 66 | + ->with( |
|
| 67 | + 'GET', |
|
| 68 | + '/_cluster/nodes/hotthreads', |
|
| 69 | + array(), |
|
| 70 | + null |
|
| 71 | + ) |
|
| 72 | + ->getMock(); |
|
| 73 | 73 | |
| 74 | 74 | $action = new HotThreads($mockTransport); |
| 75 | 75 | $action->performRequest(); |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | ->with( |
| 33 | 33 | 'GET', |
| 34 | 34 | '/_cluster/nodes/abc/hotthreads', |
| 35 | - array(), |
|
| 35 | + array (), |
|
| 36 | 36 | null |
| 37 | 37 | ) |
| 38 | 38 | ->getMock(); |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | |
| 56 | 56 | $nodeID = new \stdClass(); |
| 57 | 57 | |
| 58 | - $action->setNodeID($nodeID);; |
|
| 58 | + $action->setNodeID($nodeID); ; |
|
| 59 | 59 | |
| 60 | 60 | } |
| 61 | 61 | |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | ->with( |
| 67 | 67 | 'GET', |
| 68 | 68 | '/_cluster/nodes/hotthreads', |
| 69 | - array(), |
|
| 69 | + array (), |
|
| 70 | 70 | null |
| 71 | 71 | ) |
| 72 | 72 | ->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 HotThreadsTest extends \PHPUnit_Framework_TestCase |
|
| 22 | -{ |
|
| 21 | +class HotThreadsTest extends \PHPUnit_Framework_TestCase { |
|
| 23 | 22 | public function tearDown() { |
| 24 | 23 | m::close(); |
| 25 | 24 | } |
| 26 | 25 | |
| 27 | 26 | |
| 28 | - public function testValidSettingsWithNodeID() |
|
| 29 | - { |
|
| 27 | + public function testValidSettingsWithNodeID() { |
|
| 30 | 28 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 31 | 29 | ->shouldReceive('performRequest')->once()->once() |
| 32 | 30 | ->with( |
@@ -47,8 +45,7 @@ discard block |
||
| 47 | 45 | /** |
| 48 | 46 | * @expectedException InvalidArgumentException |
| 49 | 47 | */ |
| 50 | - public function testValidSettingsWithInvalidNodeID() |
|
| 51 | - { |
|
| 48 | + public function testValidSettingsWithInvalidNodeID() { |
|
| 52 | 49 | $mockTransport = m::mock('\Elasticsearch\Transport'); |
| 53 | 50 | |
| 54 | 51 | $action = new HotThreads($mockTransport); |
@@ -59,8 +56,7 @@ discard block |
||
| 59 | 56 | |
| 60 | 57 | } |
| 61 | 58 | |
| 62 | - public function testValidSettingsWithoutNodeID() |
|
| 63 | - { |
|
| 59 | + public function testValidSettingsWithoutNodeID() { |
|
| 64 | 60 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 65 | 61 | ->shouldReceive('performRequest')->once() |
| 66 | 62 | ->with( |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | 'GET', |
| 34 | 34 | '/_cluster/nodes/abc/hotthreads', |
| 35 | 35 | array(), |
| 36 | - null |
|
| 36 | + NULL |
|
| 37 | 37 | ) |
| 38 | 38 | ->getMock(); |
| 39 | 39 | |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | 'GET', |
| 68 | 68 | '/_cluster/nodes/hotthreads', |
| 69 | 69 | array(), |
| 70 | - null |
|
| 70 | + NULL |
|
| 71 | 71 | ) |
| 72 | 72 | ->getMock(); |
| 73 | 73 | |
@@ -28,14 +28,14 @@ discard block |
||
| 28 | 28 | public function testValidSettingsWithNodeID() |
| 29 | 29 | { |
| 30 | 30 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 31 | - ->shouldReceive('performRequest')->once()->once() |
|
| 32 | - ->with( |
|
| 33 | - 'GET', |
|
| 34 | - '/_nodes/abc', |
|
| 35 | - array(), |
|
| 36 | - null |
|
| 37 | - ) |
|
| 38 | - ->getMock(); |
|
| 31 | + ->shouldReceive('performRequest')->once()->once() |
|
| 32 | + ->with( |
|
| 33 | + 'GET', |
|
| 34 | + '/_nodes/abc', |
|
| 35 | + array(), |
|
| 36 | + null |
|
| 37 | + ) |
|
| 38 | + ->getMock(); |
|
| 39 | 39 | |
| 40 | 40 | $action = new Info($mockTransport); |
| 41 | 41 | $action->setNodeID('abc') |
@@ -63,14 +63,14 @@ discard block |
||
| 63 | 63 | public function testValidSettingsWithoutNodeID() |
| 64 | 64 | { |
| 65 | 65 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 66 | - ->shouldReceive('performRequest')->once() |
|
| 67 | - ->with( |
|
| 68 | - 'GET', |
|
| 69 | - '/_nodes', |
|
| 70 | - array(), |
|
| 71 | - null |
|
| 72 | - ) |
|
| 73 | - ->getMock(); |
|
| 66 | + ->shouldReceive('performRequest')->once() |
|
| 67 | + ->with( |
|
| 68 | + 'GET', |
|
| 69 | + '/_nodes', |
|
| 70 | + array(), |
|
| 71 | + null |
|
| 72 | + ) |
|
| 73 | + ->getMock(); |
|
| 74 | 74 | |
| 75 | 75 | $action = new Info($mockTransport); |
| 76 | 76 | $action->performRequest(); |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | ->with( |
| 33 | 33 | 'GET', |
| 34 | 34 | '/_nodes/abc', |
| 35 | - array(), |
|
| 35 | + array (), |
|
| 36 | 36 | null |
| 37 | 37 | ) |
| 38 | 38 | ->getMock(); |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | ->with( |
| 68 | 68 | 'GET', |
| 69 | 69 | '/_nodes', |
| 70 | - array(), |
|
| 70 | + array (), |
|
| 71 | 71 | null |
| 72 | 72 | ) |
| 73 | 73 | ->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 InfoTest extends \PHPUnit_Framework_TestCase |
|
| 22 | -{ |
|
| 21 | +class InfoTest extends \PHPUnit_Framework_TestCase { |
|
| 23 | 22 | public function tearDown() { |
| 24 | 23 | m::close(); |
| 25 | 24 | } |
| 26 | 25 | |
| 27 | 26 | |
| 28 | - public function testValidSettingsWithNodeID() |
|
| 29 | - { |
|
| 27 | + public function testValidSettingsWithNodeID() { |
|
| 30 | 28 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 31 | 29 | ->shouldReceive('performRequest')->once()->once() |
| 32 | 30 | ->with( |
@@ -47,8 +45,7 @@ discard block |
||
| 47 | 45 | /** |
| 48 | 46 | * @expectedException InvalidArgumentException |
| 49 | 47 | */ |
| 50 | - public function testValidSettingsWithInvalidNodeID() |
|
| 51 | - { |
|
| 48 | + public function testValidSettingsWithInvalidNodeID() { |
|
| 52 | 49 | $mockTransport = m::mock('\Elasticsearch\Transport'); |
| 53 | 50 | |
| 54 | 51 | $action = new Info($mockTransport); |
@@ -60,8 +57,7 @@ discard block |
||
| 60 | 57 | |
| 61 | 58 | } |
| 62 | 59 | |
| 63 | - public function testValidSettingsWithoutNodeID() |
|
| 64 | - { |
|
| 60 | + public function testValidSettingsWithoutNodeID() { |
|
| 65 | 61 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 66 | 62 | ->shouldReceive('performRequest')->once() |
| 67 | 63 | ->with( |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | 'GET', |
| 34 | 34 | '/_nodes/abc', |
| 35 | 35 | array(), |
| 36 | - null |
|
| 36 | + NULL |
|
| 37 | 37 | ) |
| 38 | 38 | ->getMock(); |
| 39 | 39 | |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | 'GET', |
| 69 | 69 | '/_nodes', |
| 70 | 70 | array(), |
| 71 | - null |
|
| 71 | + NULL |
|
| 72 | 72 | ) |
| 73 | 73 | ->getMock(); |
| 74 | 74 | |
@@ -28,14 +28,14 @@ discard block |
||
| 28 | 28 | public function testValidSettingsWithNodeID() |
| 29 | 29 | { |
| 30 | 30 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 31 | - ->shouldReceive('performRequest')->once()->once() |
|
| 32 | - ->with( |
|
| 33 | - 'POST', |
|
| 34 | - '/_cluster/nodes/abc/_shutdown', |
|
| 35 | - array(), |
|
| 36 | - null |
|
| 37 | - ) |
|
| 38 | - ->getMock(); |
|
| 31 | + ->shouldReceive('performRequest')->once()->once() |
|
| 32 | + ->with( |
|
| 33 | + 'POST', |
|
| 34 | + '/_cluster/nodes/abc/_shutdown', |
|
| 35 | + array(), |
|
| 36 | + null |
|
| 37 | + ) |
|
| 38 | + ->getMock(); |
|
| 39 | 39 | |
| 40 | 40 | $action = new Shutdown($mockTransport); |
| 41 | 41 | $action->setNodeID('abc') |
@@ -63,14 +63,14 @@ discard block |
||
| 63 | 63 | public function testValidSettingsWithoutNodeID() |
| 64 | 64 | { |
| 65 | 65 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 66 | - ->shouldReceive('performRequest')->once() |
|
| 67 | - ->with( |
|
| 68 | - 'POST', |
|
| 69 | - '/_shutdown', |
|
| 70 | - array(), |
|
| 71 | - null |
|
| 72 | - ) |
|
| 73 | - ->getMock(); |
|
| 66 | + ->shouldReceive('performRequest')->once() |
|
| 67 | + ->with( |
|
| 68 | + 'POST', |
|
| 69 | + '/_shutdown', |
|
| 70 | + array(), |
|
| 71 | + null |
|
| 72 | + ) |
|
| 73 | + ->getMock(); |
|
| 74 | 74 | |
| 75 | 75 | $action = new Shutdown($mockTransport); |
| 76 | 76 | $action->performRequest(); |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | ->with( |
| 33 | 33 | 'POST', |
| 34 | 34 | '/_cluster/nodes/abc/_shutdown', |
| 35 | - array(), |
|
| 35 | + array (), |
|
| 36 | 36 | null |
| 37 | 37 | ) |
| 38 | 38 | ->getMock(); |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | ->with( |
| 68 | 68 | 'POST', |
| 69 | 69 | '/_shutdown', |
| 70 | - array(), |
|
| 70 | + array (), |
|
| 71 | 71 | null |
| 72 | 72 | ) |
| 73 | 73 | ->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 ShutdownTest extends \PHPUnit_Framework_TestCase |
|
| 22 | -{ |
|
| 21 | +class ShutdownTest extends \PHPUnit_Framework_TestCase { |
|
| 23 | 22 | public function tearDown() { |
| 24 | 23 | m::close(); |
| 25 | 24 | } |
| 26 | 25 | |
| 27 | 26 | |
| 28 | - public function testValidSettingsWithNodeID() |
|
| 29 | - { |
|
| 27 | + public function testValidSettingsWithNodeID() { |
|
| 30 | 28 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 31 | 29 | ->shouldReceive('performRequest')->once()->once() |
| 32 | 30 | ->with( |
@@ -47,8 +45,7 @@ discard block |
||
| 47 | 45 | /** |
| 48 | 46 | * @expectedException InvalidArgumentException |
| 49 | 47 | */ |
| 50 | - public function testValidSettingsWithInvalidNodeID() |
|
| 51 | - { |
|
| 48 | + public function testValidSettingsWithInvalidNodeID() { |
|
| 52 | 49 | $mockTransport = m::mock('\Elasticsearch\Transport'); |
| 53 | 50 | |
| 54 | 51 | $action = new Shutdown($mockTransport); |
@@ -60,8 +57,7 @@ discard block |
||
| 60 | 57 | |
| 61 | 58 | } |
| 62 | 59 | |
| 63 | - public function testValidSettingsWithoutNodeID() |
|
| 64 | - { |
|
| 60 | + public function testValidSettingsWithoutNodeID() { |
|
| 65 | 61 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 66 | 62 | ->shouldReceive('performRequest')->once() |
| 67 | 63 | ->with( |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | 'POST', |
| 34 | 34 | '/_cluster/nodes/abc/_shutdown', |
| 35 | 35 | array(), |
| 36 | - null |
|
| 36 | + NULL |
|
| 37 | 37 | ) |
| 38 | 38 | ->getMock(); |
| 39 | 39 | |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | 'POST', |
| 69 | 69 | '/_shutdown', |
| 70 | 70 | array(), |
| 71 | - null |
|
| 71 | + NULL |
|
| 72 | 72 | ) |
| 73 | 73 | ->getMock(); |
| 74 | 74 | |