Skip to content
This repository has been archived by the owner on Feb 26, 2018. It is now read-only.

Commit

Permalink
Merge pull request #54 from bmullican/add_patch_method
Browse files Browse the repository at this point in the history
Added patch method and test
  • Loading branch information
adamwathan committed Aug 7, 2015
2 parents f6d10d7 + cb69833 commit e99a0a0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/AdamWathan/Form/Elements/FormOpen.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ public function put()
return $this->setHiddenMethod('PUT');
}

public function patch()
{
return $this->setHiddenMethod('PATCH');
}

public function delete()
{
return $this->setHiddenMethod('DELETE');
Expand Down
9 changes: 9 additions & 0 deletions tests/FormOpenTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,15 @@ public function testRenderPutFormOpen()
$this->assertEquals($expected, $result);
}

public function testRenderPatchFormOpen()
{
$form = new FormOpen;
$expected = '<form method="POST" action=""><input type="hidden" name="_method" value="PATCH">';
$result = $form->patch()->render();

$this->assertEquals($expected, $result);
}

public function testRenderDeleteFormOpen()
{
$form = new FormOpen;
Expand Down

0 comments on commit e99a0a0

Please sign in to comment.