public function testDeleteFails() { $key = $this->user->pkis->first(); $count = Pki::count(); $this->delete('delete_key', array(), array('id' => 568), array('user' => $this->user->id)); $this->assertEquals($count, Pki::count(array('cache' => false))); $this->assertRedirect(url_for('UserController', 'edit')); }