@@ -30,14 +30,14 @@ discard block |
||
| 30 | 30 | { |
| 31 | 31 | $body = array('field' => 'value'); |
| 32 | 32 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 33 | - ->shouldReceive('performRequest')->once() |
|
| 34 | - ->with( |
|
| 35 | - 'POST', |
|
| 36 | - '/_aliases', |
|
| 37 | - array(), |
|
| 38 | - $body |
|
| 39 | - ) |
|
| 40 | - ->getMock(); |
|
| 33 | + ->shouldReceive('performRequest')->once() |
|
| 34 | + ->with( |
|
| 35 | + 'POST', |
|
| 36 | + '/_aliases', |
|
| 37 | + array(), |
|
| 38 | + $body |
|
| 39 | + ) |
|
| 40 | + ->getMock(); |
|
| 41 | 41 | |
| 42 | 42 | $action = new Update($mockTransport); |
| 43 | 43 | $action->setBody($body)->performRequest(); |
@@ -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 | - '/_aliases', |
|
| 55 | - array(), |
|
| 56 | - null |
|
| 57 | - ) |
|
| 58 | - ->getMock(); |
|
| 51 | + ->shouldReceive('performRequest')->once() |
|
| 52 | + ->with( |
|
| 53 | + 'GET', |
|
| 54 | + '/_aliases', |
|
| 55 | + array(), |
|
| 56 | + null |
|
| 57 | + ) |
|
| 58 | + ->getMock(); |
|
| 59 | 59 | |
| 60 | 60 | $action = new Get($mockTransport); |
| 61 | 61 | $action->performRequest(); |
@@ -66,14 +66,14 @@ discard block |
||
| 66 | 66 | { |
| 67 | 67 | |
| 68 | 68 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 69 | - ->shouldReceive('performRequest')->once() |
|
| 70 | - ->with( |
|
| 71 | - 'GET', |
|
| 72 | - '/testIndex/_aliases', |
|
| 73 | - array(), |
|
| 74 | - null |
|
| 75 | - ) |
|
| 76 | - ->getMock(); |
|
| 69 | + ->shouldReceive('performRequest')->once() |
|
| 70 | + ->with( |
|
| 71 | + 'GET', |
|
| 72 | + '/testIndex/_aliases', |
|
| 73 | + array(), |
|
| 74 | + null |
|
| 75 | + ) |
|
| 76 | + ->getMock(); |
|
| 77 | 77 | |
| 78 | 78 | $action = new Get($mockTransport); |
| 79 | 79 | $action->setIndex('testIndex')->performRequest(); |
@@ -28,13 +28,13 @@ discard block |
||
| 28 | 28 | |
| 29 | 29 | public function testSetArrayBody() |
| 30 | 30 | { |
| 31 | - $body = array('field' => 'value'); |
|
| 31 | + $body = array ('field' => 'value'); |
|
| 32 | 32 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 33 | 33 | ->shouldReceive('performRequest')->once() |
| 34 | 34 | ->with( |
| 35 | 35 | 'POST', |
| 36 | 36 | '/_aliases', |
| 37 | - array(), |
|
| 37 | + array (), |
|
| 38 | 38 | $body |
| 39 | 39 | ) |
| 40 | 40 | ->getMock(); |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | ->with( |
| 53 | 53 | 'GET', |
| 54 | 54 | '/_aliases', |
| 55 | - array(), |
|
| 55 | + array (), |
|
| 56 | 56 | null |
| 57 | 57 | ) |
| 58 | 58 | ->getMock(); |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | ->with( |
| 71 | 71 | 'GET', |
| 72 | 72 | '/testIndex/_aliases', |
| 73 | - array(), |
|
| 73 | + array (), |
|
| 74 | 74 | null |
| 75 | 75 | ) |
| 76 | 76 | ->getMock(); |
@@ -20,14 +20,12 @@ discard block |
||
| 20 | 20 | * @link http://elasticsearch.org |
| 21 | 21 | */ |
| 22 | 22 | |
| 23 | -class AliasesTest extends \PHPUnit_Framework_TestCase |
|
| 24 | -{ |
|
| 23 | +class AliasesTest extends \PHPUnit_Framework_TestCase { |
|
| 25 | 24 | public function tearDown() { |
| 26 | 25 | m::close(); |
| 27 | 26 | } |
| 28 | 27 | |
| 29 | - public function testSetArrayBody() |
|
| 30 | - { |
|
| 28 | + public function testSetArrayBody() { |
|
| 31 | 29 | $body = array('field' => 'value'); |
| 32 | 30 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 33 | 31 | ->shouldReceive('performRequest')->once() |
@@ -44,8 +42,7 @@ discard block |
||
| 44 | 42 | |
| 45 | 43 | } |
| 46 | 44 | |
| 47 | - public function testValidAliasesWithoutIndex() |
|
| 48 | - { |
|
| 45 | + public function testValidAliasesWithoutIndex() { |
|
| 49 | 46 | |
| 50 | 47 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 51 | 48 | ->shouldReceive('performRequest')->once() |
@@ -62,8 +59,7 @@ discard block |
||
| 62 | 59 | |
| 63 | 60 | } |
| 64 | 61 | |
| 65 | - public function testValidAliasesWithIndex() |
|
| 66 | - { |
|
| 62 | + public function testValidAliasesWithIndex() { |
|
| 67 | 63 | |
| 68 | 64 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 69 | 65 | ->shouldReceive('performRequest')->once() |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | 'GET', |
| 54 | 54 | '/_aliases', |
| 55 | 55 | array(), |
| 56 | - null |
|
| 56 | + NULL |
|
| 57 | 57 | ) |
| 58 | 58 | ->getMock(); |
| 59 | 59 | |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | 'GET', |
| 72 | 72 | '/testIndex/_aliases', |
| 73 | 73 | array(), |
| 74 | - null |
|
| 74 | + NULL |
|
| 75 | 75 | ) |
| 76 | 76 | ->getMock(); |
| 77 | 77 | |
@@ -27,14 +27,14 @@ discard block |
||
| 27 | 27 | public function testNoIndexOrName() |
| 28 | 28 | { |
| 29 | 29 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 30 | - ->shouldReceive('performRequest')->once() |
|
| 31 | - ->with( |
|
| 32 | - 'GET', |
|
| 33 | - '/_alias', |
|
| 34 | - array(), |
|
| 35 | - null |
|
| 36 | - ) |
|
| 37 | - ->getMock(); |
|
| 30 | + ->shouldReceive('performRequest')->once() |
|
| 31 | + ->with( |
|
| 32 | + 'GET', |
|
| 33 | + '/_alias', |
|
| 34 | + array(), |
|
| 35 | + null |
|
| 36 | + ) |
|
| 37 | + ->getMock(); |
|
| 38 | 38 | |
| 39 | 39 | $action = new Get($mockTransport); |
| 40 | 40 | $action->performRequest(); |
@@ -45,14 +45,14 @@ discard block |
||
| 45 | 45 | public function testNoName() |
| 46 | 46 | { |
| 47 | 47 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 48 | - ->shouldReceive('performRequest')->once() |
|
| 49 | - ->with( |
|
| 50 | - 'GET', |
|
| 51 | - '/testIndex/_alias', |
|
| 52 | - array(), |
|
| 53 | - null |
|
| 54 | - ) |
|
| 55 | - ->getMock(); |
|
| 48 | + ->shouldReceive('performRequest')->once() |
|
| 49 | + ->with( |
|
| 50 | + 'GET', |
|
| 51 | + '/testIndex/_alias', |
|
| 52 | + array(), |
|
| 53 | + null |
|
| 54 | + ) |
|
| 55 | + ->getMock(); |
|
| 56 | 56 | |
| 57 | 57 | $action = new Get($mockTransport); |
| 58 | 58 | $action->setIndex('testIndex')->performRequest(); |
@@ -63,14 +63,14 @@ discard block |
||
| 63 | 63 | { |
| 64 | 64 | |
| 65 | 65 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 66 | - ->shouldReceive('performRequest')->once() |
|
| 67 | - ->with( |
|
| 68 | - 'GET', |
|
| 69 | - '/testIndex/_alias/testName', |
|
| 70 | - array(), |
|
| 71 | - null |
|
| 72 | - ) |
|
| 73 | - ->getMock(); |
|
| 66 | + ->shouldReceive('performRequest')->once() |
|
| 67 | + ->with( |
|
| 68 | + 'GET', |
|
| 69 | + '/testIndex/_alias/testName', |
|
| 70 | + array(), |
|
| 71 | + null |
|
| 72 | + ) |
|
| 73 | + ->getMock(); |
|
| 74 | 74 | |
| 75 | 75 | $action = new Get($mockTransport); |
| 76 | 76 | $action->setIndex('testIndex')->setName('testName') |
@@ -82,14 +82,14 @@ discard block |
||
| 82 | 82 | { |
| 83 | 83 | |
| 84 | 84 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 85 | - ->shouldReceive('performRequest')->once() |
|
| 86 | - ->with( |
|
| 87 | - 'GET', |
|
| 88 | - '/_alias/testName', |
|
| 89 | - array(), |
|
| 90 | - null |
|
| 91 | - ) |
|
| 92 | - ->getMock(); |
|
| 85 | + ->shouldReceive('performRequest')->once() |
|
| 86 | + ->with( |
|
| 87 | + 'GET', |
|
| 88 | + '/_alias/testName', |
|
| 89 | + array(), |
|
| 90 | + null |
|
| 91 | + ) |
|
| 92 | + ->getMock(); |
|
| 93 | 93 | |
| 94 | 94 | $action = new Get($mockTransport); |
| 95 | 95 | $action->setName('testName') |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | ->with( |
| 32 | 32 | 'GET', |
| 33 | 33 | '/_alias', |
| 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/_alias', |
| 52 | - array(), |
|
| 52 | + array (), |
|
| 53 | 53 | null |
| 54 | 54 | ) |
| 55 | 55 | ->getMock(); |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | ->with( |
| 68 | 68 | 'GET', |
| 69 | 69 | '/testIndex/_alias/testName', |
| 70 | - array(), |
|
| 70 | + array (), |
|
| 71 | 71 | null |
| 72 | 72 | ) |
| 73 | 73 | ->getMock(); |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | ->with( |
| 87 | 87 | 'GET', |
| 88 | 88 | '/_alias/testName', |
| 89 | - array(), |
|
| 89 | + array (), |
|
| 90 | 90 | null |
| 91 | 91 | ) |
| 92 | 92 | ->getMock(); |
@@ -18,14 +18,12 @@ discard block |
||
| 18 | 18 | * @link http://elasticsearch.org |
| 19 | 19 | */ |
| 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 testNoIndexOrName() |
|
| 28 | - { |
|
| 26 | + public function testNoIndexOrName() { |
|
| 29 | 27 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 30 | 28 | ->shouldReceive('performRequest')->once() |
| 31 | 29 | ->with( |
@@ -42,8 +40,7 @@ discard block |
||
| 42 | 40 | } |
| 43 | 41 | |
| 44 | 42 | |
| 45 | - public function testNoName() |
|
| 46 | - { |
|
| 43 | + public function testNoName() { |
|
| 47 | 44 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 48 | 45 | ->shouldReceive('performRequest')->once() |
| 49 | 46 | ->with( |
@@ -59,8 +56,7 @@ discard block |
||
| 59 | 56 | |
| 60 | 57 | } |
| 61 | 58 | |
| 62 | - public function testValidGetWithIndex() |
|
| 63 | - { |
|
| 59 | + public function testValidGetWithIndex() { |
|
| 64 | 60 | |
| 65 | 61 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 66 | 62 | ->shouldReceive('performRequest')->once() |
@@ -78,8 +74,7 @@ discard block |
||
| 78 | 74 | |
| 79 | 75 | } |
| 80 | 76 | |
| 81 | - public function testValidGetWithoutIndex() |
|
| 82 | - { |
|
| 77 | + public function testValidGetWithoutIndex() { |
|
| 83 | 78 | |
| 84 | 79 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 85 | 80 | ->shouldReceive('performRequest')->once() |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | 'GET', |
| 33 | 33 | '/_alias', |
| 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/_alias', |
| 52 | 52 | array(), |
| 53 | - null |
|
| 53 | + NULL |
|
| 54 | 54 | ) |
| 55 | 55 | ->getMock(); |
| 56 | 56 | |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | 'GET', |
| 69 | 69 | '/testIndex/_alias/testName', |
| 70 | 70 | array(), |
| 71 | - null |
|
| 71 | + NULL |
|
| 72 | 72 | ) |
| 73 | 73 | ->getMock(); |
| 74 | 74 | |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | 'GET', |
| 88 | 88 | '/_alias/testName', |
| 89 | 89 | array(), |
| 90 | - null |
|
| 90 | + NULL |
|
| 91 | 91 | ) |
| 92 | 92 | ->getMock(); |
| 93 | 93 | |
@@ -32,14 +32,14 @@ discard block |
||
| 32 | 32 | { |
| 33 | 33 | $body = array('field' => 'value'); |
| 34 | 34 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 35 | - ->shouldReceive('performRequest')->once() |
|
| 36 | - ->with( |
|
| 37 | - 'PUT', |
|
| 38 | - '/testIndex/_alias/testName', |
|
| 39 | - array(), |
|
| 40 | - $body |
|
| 41 | - ) |
|
| 42 | - ->getMock(); |
|
| 35 | + ->shouldReceive('performRequest')->once() |
|
| 36 | + ->with( |
|
| 37 | + 'PUT', |
|
| 38 | + '/testIndex/_alias/testName', |
|
| 39 | + array(), |
|
| 40 | + $body |
|
| 41 | + ) |
|
| 42 | + ->getMock(); |
|
| 43 | 43 | |
| 44 | 44 | $action = new Put($mockTransport); |
| 45 | 45 | $action->setBody($body)->setIndex('testIndex')->setName('testName')->performRequest(); |
@@ -88,14 +88,14 @@ discard block |
||
| 88 | 88 | { |
| 89 | 89 | $body = array('field' => 'value'); |
| 90 | 90 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 91 | - ->shouldReceive('performRequest')->once() |
|
| 92 | - ->with( |
|
| 93 | - 'PUT', |
|
| 94 | - '/testIndex/_alias/testName', |
|
| 95 | - array(), |
|
| 96 | - $body |
|
| 97 | - ) |
|
| 98 | - ->getMock(); |
|
| 91 | + ->shouldReceive('performRequest')->once() |
|
| 92 | + ->with( |
|
| 93 | + 'PUT', |
|
| 94 | + '/testIndex/_alias/testName', |
|
| 95 | + array(), |
|
| 96 | + $body |
|
| 97 | + ) |
|
| 98 | + ->getMock(); |
|
| 99 | 99 | |
| 100 | 100 | $action = new Put($mockTransport); |
| 101 | 101 | $action->setBody($body)->setIndex('testIndex')->setName('testName') |
@@ -30,13 +30,13 @@ discard block |
||
| 30 | 30 | |
| 31 | 31 | public function testSetArrayBody() |
| 32 | 32 | { |
| 33 | - $body = array('field' => 'value'); |
|
| 33 | + $body = array ('field' => 'value'); |
|
| 34 | 34 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 35 | 35 | ->shouldReceive('performRequest')->once() |
| 36 | 36 | ->with( |
| 37 | 37 | 'PUT', |
| 38 | 38 | '/testIndex/_alias/testName', |
| 39 | - array(), |
|
| 39 | + array (), |
|
| 40 | 40 | $body |
| 41 | 41 | ) |
| 42 | 42 | ->getMock(); |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | */ |
| 62 | 62 | public function testNoIndex() |
| 63 | 63 | { |
| 64 | - $body = array('field' => 'value'); |
|
| 64 | + $body = array ('field' => 'value'); |
|
| 65 | 65 | $mockTransport = m::mock('\Elasticsearch\Transport'); |
| 66 | 66 | |
| 67 | 67 | $action = new Put($mockTransport); |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | */ |
| 75 | 75 | public function testNoName() |
| 76 | 76 | { |
| 77 | - $body = array('field' => 'value'); |
|
| 77 | + $body = array ('field' => 'value'); |
|
| 78 | 78 | $mockTransport = m::mock('\Elasticsearch\Transport'); |
| 79 | 79 | |
| 80 | 80 | $action = new Put($mockTransport); |
@@ -86,13 +86,13 @@ discard block |
||
| 86 | 86 | |
| 87 | 87 | public function testValidPutWithIndexBodyAndName() |
| 88 | 88 | { |
| 89 | - $body = array('field' => 'value'); |
|
| 89 | + $body = array ('field' => 'value'); |
|
| 90 | 90 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 91 | 91 | ->shouldReceive('performRequest')->once() |
| 92 | 92 | ->with( |
| 93 | 93 | 'PUT', |
| 94 | 94 | '/testIndex/_alias/testName', |
| 95 | - array(), |
|
| 95 | + array (), |
|
| 96 | 96 | $body |
| 97 | 97 | ) |
| 98 | 98 | ->getMock(); |
@@ -21,15 +21,13 @@ discard block |
||
| 21 | 21 | * @link http://elasticsearch.org |
| 22 | 22 | */ |
| 23 | 23 | |
| 24 | -class PutTest extends \PHPUnit_Framework_TestCase |
|
| 25 | -{ |
|
| 24 | +class PutTest extends \PHPUnit_Framework_TestCase { |
|
| 26 | 25 | public function tearDown() { |
| 27 | 26 | m::close(); |
| 28 | 27 | } |
| 29 | 28 | |
| 30 | 29 | |
| 31 | - public function testSetArrayBody() |
|
| 32 | - { |
|
| 30 | + public function testSetArrayBody() { |
|
| 33 | 31 | $body = array('field' => 'value'); |
| 34 | 32 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 35 | 33 | ->shouldReceive('performRequest')->once() |
@@ -49,8 +47,7 @@ discard block |
||
| 49 | 47 | /** |
| 50 | 48 | * @expectedException RuntimeException |
| 51 | 49 | */ |
| 52 | - public function testNoBody() |
|
| 53 | - { |
|
| 50 | + public function testNoBody() { |
|
| 54 | 51 | $mockTransport = m::mock('\Elasticsearch\Transport'); |
| 55 | 52 | $action = new Put($mockTransport); |
| 56 | 53 | $action->performRequest(); |
@@ -59,8 +56,7 @@ discard block |
||
| 59 | 56 | /** |
| 60 | 57 | * @expectedException RuntimeException |
| 61 | 58 | */ |
| 62 | - public function testNoIndex() |
|
| 63 | - { |
|
| 59 | + public function testNoIndex() { |
|
| 64 | 60 | $body = array('field' => 'value'); |
| 65 | 61 | $mockTransport = m::mock('\Elasticsearch\Transport'); |
| 66 | 62 | |
@@ -72,8 +68,7 @@ discard block |
||
| 72 | 68 | /** |
| 73 | 69 | * @expectedException RuntimeException |
| 74 | 70 | */ |
| 75 | - public function testNoName() |
|
| 76 | - { |
|
| 71 | + public function testNoName() { |
|
| 77 | 72 | $body = array('field' => 'value'); |
| 78 | 73 | $mockTransport = m::mock('\Elasticsearch\Transport'); |
| 79 | 74 | |
@@ -84,8 +79,7 @@ discard block |
||
| 84 | 79 | } |
| 85 | 80 | |
| 86 | 81 | |
| 87 | - public function testValidPutWithIndexBodyAndName() |
|
| 88 | - { |
|
| 82 | + public function testValidPutWithIndexBodyAndName() { |
|
| 89 | 83 | $body = array('field' => 'value'); |
| 90 | 84 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 91 | 85 | ->shouldReceive('performRequest')->once() |
@@ -26,14 +26,14 @@ discard block |
||
| 26 | 26 | public function testValidStatusWithNoIndex() |
| 27 | 27 | { |
| 28 | 28 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 29 | - ->shouldReceive('performRequest')->once() |
|
| 30 | - ->with( |
|
| 31 | - 'GET', |
|
| 32 | - '/_status', |
|
| 33 | - array(), |
|
| 34 | - null |
|
| 35 | - ) |
|
| 36 | - ->getMock(); |
|
| 29 | + ->shouldReceive('performRequest')->once() |
|
| 30 | + ->with( |
|
| 31 | + 'GET', |
|
| 32 | + '/_status', |
|
| 33 | + array(), |
|
| 34 | + null |
|
| 35 | + ) |
|
| 36 | + ->getMock(); |
|
| 37 | 37 | |
| 38 | 38 | $action = new Status($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/_status', |
|
| 51 | - array(), |
|
| 52 | - null |
|
| 53 | - ) |
|
| 54 | - ->getMock(); |
|
| 47 | + ->shouldReceive('performRequest')->once() |
|
| 48 | + ->with( |
|
| 49 | + 'GET', |
|
| 50 | + '/testIndex/_status', |
|
| 51 | + array(), |
|
| 52 | + null |
|
| 53 | + ) |
|
| 54 | + ->getMock(); |
|
| 55 | 55 | |
| 56 | 56 | $action = new Status($mockTransport); |
| 57 | 57 | $action->setIndex('testIndex') |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | ->with( |
| 31 | 31 | 'GET', |
| 32 | 32 | '/_status', |
| 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/_status', |
| 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 StatusTest extends \PHPUnit_Framework_TestCase |
|
| 21 | -{ |
|
| 20 | +class StatusTest extends \PHPUnit_Framework_TestCase { |
|
| 22 | 21 | public function tearDown() { |
| 23 | 22 | m::close(); |
| 24 | 23 | } |
| 25 | 24 | |
| 26 | - public function testValidStatusWithNoIndex() |
|
| 27 | - { |
|
| 25 | + public function testValidStatusWithNoIndex() { |
|
| 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 testValidStatusWithIndex() |
|
| 44 | - { |
|
| 41 | + public function testValidStatusWithIndex() { |
|
| 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 | '/_status', |
| 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/_status', |
| 51 | 51 | array(), |
| 52 | - null |
|
| 52 | + NULL |
|
| 53 | 53 | ) |
| 54 | 54 | ->getMock(); |
| 55 | 55 | |
@@ -53,14 +53,14 @@ discard block |
||
| 53 | 53 | { |
| 54 | 54 | |
| 55 | 55 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 56 | - ->shouldReceive('performRequest')->once() |
|
| 57 | - ->with( |
|
| 58 | - 'PUT', |
|
| 59 | - '/testIndex/', |
|
| 60 | - array(), |
|
| 61 | - null |
|
| 62 | - ) |
|
| 63 | - ->getMock(); |
|
| 56 | + ->shouldReceive('performRequest')->once() |
|
| 57 | + ->with( |
|
| 58 | + 'PUT', |
|
| 59 | + '/testIndex/', |
|
| 60 | + array(), |
|
| 61 | + null |
|
| 62 | + ) |
|
| 63 | + ->getMock(); |
|
| 64 | 64 | |
| 65 | 65 | $action = new Create($mockTransport); |
| 66 | 66 | $action->setIndex('testIndex') |
@@ -74,14 +74,14 @@ discard block |
||
| 74 | 74 | $body = array('settings' => 'values'); |
| 75 | 75 | |
| 76 | 76 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 77 | - ->shouldReceive('performRequest')->once() |
|
| 78 | - ->with( |
|
| 79 | - 'PUT', |
|
| 80 | - '/testIndex/', |
|
| 81 | - array(), |
|
| 82 | - $body |
|
| 83 | - ) |
|
| 84 | - ->getMock(); |
|
| 77 | + ->shouldReceive('performRequest')->once() |
|
| 78 | + ->with( |
|
| 79 | + 'PUT', |
|
| 80 | + '/testIndex/', |
|
| 81 | + array(), |
|
| 82 | + $body |
|
| 83 | + ) |
|
| 84 | + ->getMock(); |
|
| 85 | 85 | |
| 86 | 86 | $action = new Create($mockTransport); |
| 87 | 87 | $action->setIndex('testIndex') |
@@ -99,14 +99,14 @@ discard block |
||
| 99 | 99 | ); |
| 100 | 100 | |
| 101 | 101 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 102 | - ->shouldReceive('performRequest')->once() |
|
| 103 | - ->with( |
|
| 104 | - 'POST', |
|
| 105 | - '/testIndex/', |
|
| 106 | - array(), |
|
| 107 | - $body |
|
| 108 | - ) |
|
| 109 | - ->getMock(); |
|
| 102 | + ->shouldReceive('performRequest')->once() |
|
| 103 | + ->with( |
|
| 104 | + 'POST', |
|
| 105 | + '/testIndex/', |
|
| 106 | + array(), |
|
| 107 | + $body |
|
| 108 | + ) |
|
| 109 | + ->getMock(); |
|
| 110 | 110 | |
| 111 | 111 | $action = new Create($mockTransport); |
| 112 | 112 | $action->setIndex('testIndex') |
@@ -27,12 +27,12 @@ discard block |
||
| 27 | 27 | |
| 28 | 28 | public function testSetBody() |
| 29 | 29 | { |
| 30 | - $body = array('field' => 'value'); |
|
| 30 | + $body = array ('field' => 'value'); |
|
| 31 | 31 | |
| 32 | - $mockTransport = m::mock('\Elasticsearch\Transport');; |
|
| 32 | + $mockTransport = m::mock('\Elasticsearch\Transport'); ; |
|
| 33 | 33 | |
| 34 | 34 | $action = new Create($mockTransport); |
| 35 | - $action->setBody($body);; |
|
| 35 | + $action->setBody($body); ; |
|
| 36 | 36 | |
| 37 | 37 | } |
| 38 | 38 | |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | ->with( |
| 58 | 58 | 'PUT', |
| 59 | 59 | '/testIndex/', |
| 60 | - array(), |
|
| 60 | + array (), |
|
| 61 | 61 | null |
| 62 | 62 | ) |
| 63 | 63 | ->getMock(); |
@@ -71,14 +71,14 @@ discard block |
||
| 71 | 71 | public function testValidCreateWithBodyNoMappings() |
| 72 | 72 | { |
| 73 | 73 | |
| 74 | - $body = array('settings' => 'values'); |
|
| 74 | + $body = array ('settings' => 'values'); |
|
| 75 | 75 | |
| 76 | 76 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 77 | 77 | ->shouldReceive('performRequest')->once() |
| 78 | 78 | ->with( |
| 79 | 79 | 'PUT', |
| 80 | 80 | '/testIndex/', |
| 81 | - array(), |
|
| 81 | + array (), |
|
| 82 | 82 | $body |
| 83 | 83 | ) |
| 84 | 84 | ->getMock(); |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | public function testValidCreateWithBodyWithMappings() |
| 94 | 94 | { |
| 95 | 95 | |
| 96 | - $body = array( |
|
| 96 | + $body = array ( |
|
| 97 | 97 | 'settings' => 'values', |
| 98 | 98 | 'mappings' => 'values' |
| 99 | 99 | ); |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | ->with( |
| 104 | 104 | 'POST', |
| 105 | 105 | '/testIndex/', |
| 106 | - array(), |
|
| 106 | + array (), |
|
| 107 | 107 | $body |
| 108 | 108 | ) |
| 109 | 109 | ->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 CreateTest extends \PHPUnit_Framework_TestCase |
|
| 23 | -{ |
|
| 22 | +class CreateTest extends \PHPUnit_Framework_TestCase { |
|
| 24 | 23 | public function tearDown() { |
| 25 | 24 | m::close(); |
| 26 | 25 | } |
| 27 | 26 | |
| 28 | - public function testSetBody() |
|
| 29 | - { |
|
| 27 | + public function testSetBody() { |
|
| 30 | 28 | $body = array('field' => 'value'); |
| 31 | 29 | |
| 32 | 30 | $mockTransport = m::mock('\Elasticsearch\Transport');; |
@@ -39,8 +37,7 @@ discard block |
||
| 39 | 37 | /** |
| 40 | 38 | * @expectedException RuntimeException |
| 41 | 39 | */ |
| 42 | - public function testNoIndex() |
|
| 43 | - { |
|
| 40 | + public function testNoIndex() { |
|
| 44 | 41 | |
| 45 | 42 | $mockTransport = m::mock('\Elasticsearch\Transport'); |
| 46 | 43 | |
@@ -49,8 +46,7 @@ discard block |
||
| 49 | 46 | |
| 50 | 47 | } |
| 51 | 48 | |
| 52 | - public function testValidCreateNoBody() |
|
| 53 | - { |
|
| 49 | + public function testValidCreateNoBody() { |
|
| 54 | 50 | |
| 55 | 51 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 56 | 52 | ->shouldReceive('performRequest')->once() |
@@ -68,8 +64,7 @@ discard block |
||
| 68 | 64 | |
| 69 | 65 | } |
| 70 | 66 | |
| 71 | - public function testValidCreateWithBodyNoMappings() |
|
| 72 | - { |
|
| 67 | + public function testValidCreateWithBodyNoMappings() { |
|
| 73 | 68 | |
| 74 | 69 | $body = array('settings' => 'values'); |
| 75 | 70 | |
@@ -90,8 +85,7 @@ discard block |
||
| 90 | 85 | |
| 91 | 86 | } |
| 92 | 87 | |
| 93 | - public function testValidCreateWithBodyWithMappings() |
|
| 94 | - { |
|
| 88 | + public function testValidCreateWithBodyWithMappings() { |
|
| 95 | 89 | |
| 96 | 90 | $body = array( |
| 97 | 91 | 'settings' => 'values', |
@@ -58,7 +58,7 @@ |
||
| 58 | 58 | 'PUT', |
| 59 | 59 | '/testIndex/', |
| 60 | 60 | array(), |
| 61 | - null |
|
| 61 | + NULL |
|
| 62 | 62 | ) |
| 63 | 63 | ->getMock(); |
| 64 | 64 | |
@@ -30,14 +30,14 @@ discard block |
||
| 30 | 30 | $body = 'abc'; |
| 31 | 31 | |
| 32 | 32 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 33 | - ->shouldReceive('performRequest')->once() |
|
| 34 | - ->with( |
|
| 35 | - m::any(), |
|
| 36 | - m::any(), |
|
| 37 | - array(), |
|
| 38 | - $body |
|
| 39 | - ) |
|
| 40 | - ->getMock(); |
|
| 33 | + ->shouldReceive('performRequest')->once() |
|
| 34 | + ->with( |
|
| 35 | + m::any(), |
|
| 36 | + m::any(), |
|
| 37 | + array(), |
|
| 38 | + $body |
|
| 39 | + ) |
|
| 40 | + ->getMock(); |
|
| 41 | 41 | |
| 42 | 42 | $action = new Analyze($mockTransport); |
| 43 | 43 | $action->setBody($body) |
@@ -51,14 +51,14 @@ discard block |
||
| 51 | 51 | $uri = '/_analyze'; |
| 52 | 52 | |
| 53 | 53 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 54 | - ->shouldReceive('performRequest')->once() |
|
| 55 | - ->with( |
|
| 56 | - 'GET', |
|
| 57 | - $uri, |
|
| 58 | - array(), |
|
| 59 | - m::any() |
|
| 60 | - ) |
|
| 61 | - ->getMock(); |
|
| 54 | + ->shouldReceive('performRequest')->once() |
|
| 55 | + ->with( |
|
| 56 | + 'GET', |
|
| 57 | + $uri, |
|
| 58 | + array(), |
|
| 59 | + m::any() |
|
| 60 | + ) |
|
| 61 | + ->getMock(); |
|
| 62 | 62 | |
| 63 | 63 | $action = new Analyze($mockTransport); |
| 64 | 64 | $action->performRequest(); |
@@ -70,14 +70,14 @@ discard block |
||
| 70 | 70 | $uri = '/testIndex/_analyze'; |
| 71 | 71 | |
| 72 | 72 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 73 | - ->shouldReceive('performRequest')->once() |
|
| 74 | - ->with( |
|
| 75 | - 'GET', |
|
| 76 | - $uri, |
|
| 77 | - array(), |
|
| 78 | - m::any() |
|
| 79 | - ) |
|
| 80 | - ->getMock(); |
|
| 73 | + ->shouldReceive('performRequest')->once() |
|
| 74 | + ->with( |
|
| 75 | + 'GET', |
|
| 76 | + $uri, |
|
| 77 | + array(), |
|
| 78 | + m::any() |
|
| 79 | + ) |
|
| 80 | + ->getMock(); |
|
| 81 | 81 | |
| 82 | 82 | $action = new Analyze($mockTransport); |
| 83 | 83 | $action->setIndex('testIndex') |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | ->with( |
| 35 | 35 | m::any(), |
| 36 | 36 | m::any(), |
| 37 | - array(), |
|
| 37 | + array (), |
|
| 38 | 38 | $body |
| 39 | 39 | ) |
| 40 | 40 | ->getMock(); |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | ->with( |
| 56 | 56 | 'GET', |
| 57 | 57 | $uri, |
| 58 | - array(), |
|
| 58 | + array (), |
|
| 59 | 59 | m::any() |
| 60 | 60 | ) |
| 61 | 61 | ->getMock(); |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | ->with( |
| 75 | 75 | 'GET', |
| 76 | 76 | $uri, |
| 77 | - array(), |
|
| 77 | + array (), |
|
| 78 | 78 | m::any() |
| 79 | 79 | ) |
| 80 | 80 | ->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 AnalyzeTest extends \PHPUnit_Framework_TestCase |
|
| 22 | -{ |
|
| 21 | +class AnalyzeTest extends \PHPUnit_Framework_TestCase { |
|
| 23 | 22 | |
| 24 | 23 | public function tearDown() { |
| 25 | 24 | m::close(); |
| 26 | 25 | } |
| 27 | 26 | |
| 28 | - public function testSetBody() |
|
| 29 | - { |
|
| 27 | + public function testSetBody() { |
|
| 30 | 28 | $body = 'abc'; |
| 31 | 29 | |
| 32 | 30 | $mockTransport = m::mock('\Elasticsearch\Transport') |
@@ -45,8 +43,7 @@ discard block |
||
| 45 | 43 | |
| 46 | 44 | } |
| 47 | 45 | |
| 48 | - public function testGetURIWithNoIndex() |
|
| 49 | - { |
|
| 46 | + public function testGetURIWithNoIndex() { |
|
| 50 | 47 | |
| 51 | 48 | $uri = '/_analyze'; |
| 52 | 49 | |
@@ -65,8 +62,7 @@ discard block |
||
| 65 | 62 | |
| 66 | 63 | } |
| 67 | 64 | |
| 68 | - public function testGetURIWithIndex() |
|
| 69 | - { |
|
| 65 | + public function testGetURIWithIndex() { |
|
| 70 | 66 | $uri = '/testIndex/_analyze'; |
| 71 | 67 | |
| 72 | 68 | $mockTransport = m::mock('\Elasticsearch\Transport') |
@@ -27,14 +27,14 @@ discard block |
||
| 27 | 27 | public function testValidSegmentsWithNoIndex() |
| 28 | 28 | { |
| 29 | 29 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 30 | - ->shouldReceive('performRequest')->once() |
|
| 31 | - ->with( |
|
| 32 | - 'GET', |
|
| 33 | - '/_settings', |
|
| 34 | - array(), |
|
| 35 | - null |
|
| 36 | - ) |
|
| 37 | - ->getMock(); |
|
| 30 | + ->shouldReceive('performRequest')->once() |
|
| 31 | + ->with( |
|
| 32 | + 'GET', |
|
| 33 | + '/_settings', |
|
| 34 | + array(), |
|
| 35 | + null |
|
| 36 | + ) |
|
| 37 | + ->getMock(); |
|
| 38 | 38 | |
| 39 | 39 | $action = new Get($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/_settings', |
|
| 52 | - array(), |
|
| 53 | - null |
|
| 54 | - ) |
|
| 55 | - ->getMock(); |
|
| 48 | + ->shouldReceive('performRequest')->once() |
|
| 49 | + ->with( |
|
| 50 | + 'GET', |
|
| 51 | + '/testIndex/_settings', |
|
| 52 | + array(), |
|
| 53 | + null |
|
| 54 | + ) |
|
| 55 | + ->getMock(); |
|
| 56 | 56 | |
| 57 | 57 | $action = new Get($mockTransport); |
| 58 | 58 | $action->setIndex('testIndex') |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | ->with( |
| 32 | 32 | 'GET', |
| 33 | 33 | '/_settings', |
| 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/_settings', |
| 52 | - array(), |
|
| 52 | + array (), |
|
| 53 | 53 | null |
| 54 | 54 | ) |
| 55 | 55 | ->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 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 testValidSegmentsWithNoIndex() |
|
| 28 | - { |
|
| 26 | + public function testValidSegmentsWithNoIndex() { |
|
| 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 testValidSegmentsWithIndex() |
|
| 45 | - { |
|
| 42 | + public function testValidSegmentsWithIndex() { |
|
| 46 | 43 | |
| 47 | 44 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 48 | 45 | ->shouldReceive('performRequest')->once() |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | 'GET', |
| 33 | 33 | '/_settings', |
| 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/_settings', |
| 52 | 52 | array(), |
| 53 | - null |
|
| 53 | + NULL |
|
| 54 | 54 | ) |
| 55 | 55 | ->getMock(); |
| 56 | 56 | |
@@ -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) |
@@ -49,14 +49,14 @@ discard block |
||
| 49 | 49 | { |
| 50 | 50 | $body['docs'] = '1'; |
| 51 | 51 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 52 | - ->shouldReceive('performRequest')->once() |
|
| 53 | - ->with( |
|
| 54 | - 'PUT', |
|
| 55 | - '/_settings', |
|
| 56 | - array(), |
|
| 57 | - array('docs' => 1) |
|
| 58 | - ) |
|
| 59 | - ->getMock(); |
|
| 52 | + ->shouldReceive('performRequest')->once() |
|
| 53 | + ->with( |
|
| 54 | + 'PUT', |
|
| 55 | + '/_settings', |
|
| 56 | + array(), |
|
| 57 | + array('docs' => 1) |
|
| 58 | + ) |
|
| 59 | + ->getMock(); |
|
| 60 | 60 | |
| 61 | 61 | $action = new Put($mockTransport); |
| 62 | 62 | $action->setBody($body)->performRequest(); |
@@ -67,14 +67,14 @@ discard block |
||
| 67 | 67 | { |
| 68 | 68 | $body['docs'] = '1'; |
| 69 | 69 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 70 | - ->shouldReceive('performRequest')->once() |
|
| 71 | - ->with( |
|
| 72 | - 'PUT', |
|
| 73 | - '/testIndex/_settings', |
|
| 74 | - array(), |
|
| 75 | - array('docs' => 1) |
|
| 76 | - ) |
|
| 77 | - ->getMock(); |
|
| 70 | + ->shouldReceive('performRequest')->once() |
|
| 71 | + ->with( |
|
| 72 | + 'PUT', |
|
| 73 | + '/testIndex/_settings', |
|
| 74 | + array(), |
|
| 75 | + array('docs' => 1) |
|
| 76 | + ) |
|
| 77 | + ->getMock(); |
|
| 78 | 78 | |
| 79 | 79 | $action = new Put($mockTransport); |
| 80 | 80 | $action->setBody($body)->setIndex('testIndex') |
@@ -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(); |
@@ -53,8 +53,8 @@ discard block |
||
| 53 | 53 | ->with( |
| 54 | 54 | 'PUT', |
| 55 | 55 | '/_settings', |
| 56 | - array(), |
|
| 57 | - array('docs' => 1) |
|
| 56 | + array (), |
|
| 57 | + array ('docs' => 1) |
|
| 58 | 58 | ) |
| 59 | 59 | ->getMock(); |
| 60 | 60 | |
@@ -71,8 +71,8 @@ discard block |
||
| 71 | 71 | ->with( |
| 72 | 72 | 'PUT', |
| 73 | 73 | '/testIndex/_settings', |
| 74 | - array(), |
|
| 75 | - array('docs' => 1) |
|
| 74 | + array (), |
|
| 75 | + array ('docs' => 1) |
|
| 76 | 76 | ) |
| 77 | 77 | ->getMock(); |
| 78 | 78 | |
@@ -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 testSetBody() |
|
| 29 | - { |
|
| 27 | + public function testSetBody() { |
|
| 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 testValidSegmentsWithNoIndex() |
|
| 49 | - { |
|
| 46 | + public function testValidSegmentsWithNoIndex() { |
|
| 50 | 47 | $body['docs'] = '1'; |
| 51 | 48 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 52 | 49 | ->shouldReceive('performRequest')->once() |
@@ -63,8 +60,7 @@ discard block |
||
| 63 | 60 | |
| 64 | 61 | } |
| 65 | 62 | |
| 66 | - public function testValidSegmentsWithIndex() |
|
| 67 | - { |
|
| 63 | + public function testValidSegmentsWithIndex() { |
|
| 68 | 64 | $body['docs'] = '1'; |
| 69 | 65 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 70 | 66 | ->shouldReceive('performRequest')->once() |
@@ -67,14 +67,14 @@ |
||
| 67 | 67 | { |
| 68 | 68 | |
| 69 | 69 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 70 | - ->shouldReceive('performRequest')->once() |
|
| 71 | - ->with( |
|
| 72 | - 'DELETE', |
|
| 73 | - '/testIndex/testType/_mapping', |
|
| 74 | - array(), |
|
| 75 | - null |
|
| 76 | - ) |
|
| 77 | - ->getMock(); |
|
| 70 | + ->shouldReceive('performRequest')->once() |
|
| 71 | + ->with( |
|
| 72 | + 'DELETE', |
|
| 73 | + '/testIndex/testType/_mapping', |
|
| 74 | + array(), |
|
| 75 | + null |
|
| 76 | + ) |
|
| 77 | + ->getMock(); |
|
| 78 | 78 | |
| 79 | 79 | $action = new Delete($mockTransport); |
| 80 | 80 | $action->setIndex('testIndex')->setType('testType') |
@@ -71,7 +71,7 @@ |
||
| 71 | 71 | ->with( |
| 72 | 72 | 'DELETE', |
| 73 | 73 | '/testIndex/testType/_mapping', |
| 74 | - array(), |
|
| 74 | + array (), |
|
| 75 | 75 | null |
| 76 | 76 | ) |
| 77 | 77 | ->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 testNoIndexOrType() |
|
| 31 | - { |
|
| 29 | + public function testNoIndexOrType() { |
|
| 32 | 30 | |
| 33 | 31 | $mockTransport = m::mock('\Elasticsearch\Transport'); |
| 34 | 32 | |
@@ -40,8 +38,7 @@ discard block |
||
| 40 | 38 | /** |
| 41 | 39 | * @expectedException RuntimeException |
| 42 | 40 | */ |
| 43 | - public function testNoIndex() |
|
| 44 | - { |
|
| 41 | + public function testNoIndex() { |
|
| 45 | 42 | |
| 46 | 43 | $mockTransport = m::mock('\Elasticsearch\Transport'); |
| 47 | 44 | |
@@ -53,8 +50,7 @@ discard block |
||
| 53 | 50 | /** |
| 54 | 51 | * @expectedException RuntimeException |
| 55 | 52 | */ |
| 56 | - public function testNoType() |
|
| 57 | - { |
|
| 53 | + public function testNoType() { |
|
| 58 | 54 | |
| 59 | 55 | $mockTransport = m::mock('\Elasticsearch\Transport'); |
| 60 | 56 | |
@@ -63,8 +59,7 @@ discard block |
||
| 63 | 59 | |
| 64 | 60 | } |
| 65 | 61 | |
| 66 | - public function testValidDeleteWith() |
|
| 67 | - { |
|
| 62 | + public function testValidDeleteWith() { |
|
| 68 | 63 | |
| 69 | 64 | $mockTransport = m::mock('\Elasticsearch\Transport') |
| 70 | 65 | ->shouldReceive('performRequest')->once() |
@@ -72,7 +72,7 @@ |
||
| 72 | 72 | 'DELETE', |
| 73 | 73 | '/testIndex/testType/_mapping', |
| 74 | 74 | array(), |
| 75 | - null |
|
| 75 | + NULL |
|
| 76 | 76 | ) |
| 77 | 77 | ->getMock(); |
| 78 | 78 | |