Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobion committed Oct 28, 2018
1 parent 2f2ed17 commit 465b14a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 26 deletions.
28 changes: 4 additions & 24 deletions test/Elastica/Bulk/ResponseSetTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,6 @@ public function testIterator()
}

$this->assertFalse($responseSet->valid());
$this->assertNotInstanceOf(Bulk\Response::class, $responseSet->current());
$this->assertFalse($responseSet->current());

$responseSet->next();

$this->assertFalse($responseSet->valid());
$this->assertNotInstanceOf(Bulk\Response::class, $responseSet->current());
$this->assertFalse($responseSet->current());

$responseSet->rewind();

Expand All @@ -126,21 +118,12 @@ public function isOkDataProvider()
{
list($responseData, $actions) = $this->_getFixture();

$return = [];
$return[] = [$responseData, $actions, true];
yield [$responseData, $actions, true];
$responseData['items'][2]['index']['ok'] = false;
$return[] = [$responseData, $actions, false];

return $return;
yield [$responseData, $actions, false];
}

/**
* @param array $responseData
* @param array $actions
*
* @return ResponseSet
*/
protected function _createResponseSet(array $responseData, array $actions)
protected function _createResponseSet(array $responseData, array $actions): ResponseSet
{
$client = $this->createMock(Client::class);

Expand All @@ -155,10 +138,7 @@ protected function _createResponseSet(array $responseData, array $actions)
return $bulk->send();
}

/**
* @return array
*/
protected function _getFixture()
protected function _getFixture(): array
{
$responseData = [
'took' => 5,
Expand Down
6 changes: 4 additions & 2 deletions test/Elastica/QueryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ public function testSetSort()
$this->assertEquals(2, $resultSet->count());

$first = $resultSet->current()->getData();
$second = $resultSet->next()->getData();
$resultSet->next();
$second = $resultSet->current()->getData();

$this->assertEquals('guschti', $first['firstname']);
$this->assertEquals('nicolas', $second['firstname']);
Expand All @@ -130,7 +131,8 @@ public function testSetSort()
$this->assertEquals(2, $resultSet->count());

$first = $resultSet->current()->getData();
$second = $resultSet->next()->getData();
$resultSet->next();
$second = $resultSet->current()->getData();

$this->assertEquals('nicolas', $first['firstname']);
$this->assertEquals('guschti', $second['firstname']);
Expand Down

0 comments on commit 465b14a

Please sign in to comment.