Skip to content
This repository has been archived by the owner on Jan 21, 2020. It is now read-only.

Commit

Permalink
Added data to deleteList tests and backwards compatiblity
Browse files Browse the repository at this point in the history
  • Loading branch information
TomHAnderson committed Jan 20, 2015
1 parent 92031a9 commit b28fd58
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion test/RestControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function setUp()
$this->resource = $resource = new Resource();
$controller->setResource($resource);
}

public function testReturnsErrorResponseWhenPageSizeExceedsMax()
{
$items = array(
Expand Down Expand Up @@ -217,6 +217,17 @@ public function testTrueFromDeleteCollectionReturnsResponseWithNoContent()
return true;
});

$result = $this->controller->deleteList(array(1, 2, 3));
$this->assertInstanceOf('Zend\Http\Response', $result);
$this->assertEquals(204, $result->getStatusCode());
}

public function testDeleteCollectionBackwardsCompatibleWithNoData()
{
$this->resource->getEventManager()->attach('deleteList', function ($e) {
return true;
});

$result = $this->controller->deleteList();
$this->assertInstanceOf('Zend\Http\Response', $result);
$this->assertEquals(204, $result->getStatusCode());
Expand Down

0 comments on commit b28fd58

Please sign in to comment.