public function testRemoveAction() { $res = new Response(); $res->addForm('add-item', array('title' => 'Add Item', 'method' => 'POST', 'href' => '/post')); $res->addForm('delete-item', array('title' => 'Delete Item', 'method' => 'DELETE', 'href' => '/post/123')); $res->removeForm('delete-item'); $expected = array('actions' => array(array('name' => 'add-item', 'title' => 'Add Item', 'method' => 'POST', 'href' => '/post'))); $format = new Formatter\Siren($res); $this->assertEquals($expected, $format->toArray()); }
public function testGetFormByRel() { $form = array('method' => 'get', 'href' => 'http://placekitten.com/200/300'); $res = new Response(); $res->addForm('kitten', $form); $formResult = $res->getForm('kitten'); $this->assertEquals($form, $formResult); }