public function testWhenDeleteFails() { $resourceId = 998; $errors = array('error'); $this->validator->expects($this->once())->method('ValidateDeleteRequest')->with($this->equalTo($resourceId))->will($this->returnValue($errors)); $response = $this->controller->Delete($resourceId, $this->session); $this->assertFalse($response->WasSuccessful()); $this->assertEquals($errors, $response->Errors()); $this->assertEmpty($response->ResourceId()); }