Skip to content

Commit

Permalink
Update unit tests for new serializer interface
Browse files Browse the repository at this point in the history
  • Loading branch information
polyfractal committed Feb 11, 2014
1 parent d5e5118 commit 1c206ac
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function testDeserializeJSON()
$serializer = new ArrayToJSONSerializer();
$body = '{"field":"value"}';

$ret = $serializer->deserialize($body);
$ret = $serializer->deserialize($body, array());

$body = json_decode($body, true);
$this->assertEquals($body, $ret);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function testDeserializeJSON()
$serializer = new EverythingToJSONSerializer();
$body = '{"field":"value"}';

$ret = $serializer->deserialize($body);
$ret = $serializer->deserialize($body, array());

$body = json_decode($body, true);
$this->assertEquals($body, $ret);
Expand Down
18 changes: 9 additions & 9 deletions tests/Elasticsearch/Tests/TransportTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ public function testPerformRequestNoBody()
$response = array(
'text' => 'texty text',
'status' => '200',
'info' => ''
'info' => array()
);

$mockConnection = m::mock('\Elasticsearch\Connections\AbstractConnection')
Expand All @@ -215,7 +215,7 @@ public function testPerformRequestNoBody()
};

$mockSerializer = m::mock('\Elasticsearch\Serializers\SerializerInterface')
->shouldReceive('deserialize')->with($response['text'])->andReturn('out')->getMock();
->shouldReceive('deserialize')->with($response['text'], array())->andReturn('out')->getMock();



Expand Down Expand Up @@ -256,7 +256,7 @@ public function testPerformRequestWithBody()
$response = array(
'text' => 'texty text',
'status' => '200',
'info' => ''
'info' => array()
);
$serializedBody = 'out_serialized';

Expand All @@ -278,7 +278,7 @@ public function testPerformRequestWithBody()

$mockSerializer = m::mock('\Elasticsearch\Serializers\SerializerInterface')
->shouldReceive('serialize')->with($body)->andReturn($serializedBody)->getMock()
->shouldReceive('deserialize')->with($response['text'])->andReturn('out_deserialize')->getMock();
->shouldReceive('deserialize')->with($response['text'], array())->andReturn('out_deserialize')->getMock();



Expand Down Expand Up @@ -318,7 +318,7 @@ public function testPerformRequestTimeout()
$response = array(
'text' => 'texty text',
'status' => '200',
'info' => ''
'info' => array()
);

$mockConnection = m::mock('\Elasticsearch\Connections\AbstractConnection')
Expand All @@ -338,7 +338,7 @@ public function testPerformRequestTimeout()
};

$mockSerializer = m::mock('\Elasticsearch\Serializers\SerializerInterface')
->shouldReceive('deserialize')->with($response['text'])->andReturn('out')->getMock();
->shouldReceive('deserialize')->with($response['text'], array())->andReturn('out')->getMock();



Expand Down Expand Up @@ -382,7 +382,7 @@ public function testPerformRequestNoNodesAvailable()
$response = array(
'text' => 'texty text',
'status' => '200',
'info' => ''
'info' => array()
);

$mockConnection = m::mock('\Elasticsearch\Connections\AbstractConnection');
Expand Down Expand Up @@ -429,7 +429,7 @@ public function testPerformRequestTransportException()
$response = array(
'text' => 'texty text',
'status' => '200',
'info' => ''
'info' => array()
);

$mockConnection = m::mock('\Elasticsearch\Connections\AbstractConnection')
Expand All @@ -450,7 +450,7 @@ public function testPerformRequestTransportException()
};

$mockSerializer = m::mock('\Elasticsearch\Serializers\SerializerInterface')
->shouldReceive('deserialize')->with($response['text'])->andReturn('out')->getMock();
->shouldReceive('deserialize')->with($response['text'], array())->andReturn('out')->getMock();



Expand Down

0 comments on commit 1c206ac

Please sign in to comment.