Skip to content

Commit

Permalink
Allow PUT and PATCH verbs for upload
Browse files Browse the repository at this point in the history
  • Loading branch information
giosh94mhz committed Mar 2, 2015
1 parent 09243d6 commit 3f31f33
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Routing/RouteLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function load($resource, $type = null)
array(),
'',
array(),
array('POST')
array('POST', 'PUT', 'PATCH')
);

if ($options['enable_progress'] === true) {
Expand Down
8 changes: 5 additions & 3 deletions Tests/Controller/AbstractControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,16 @@ public function testCallByDelete()
$this->implTestCallBy('DELETE');
}

public function testCallByPost()
{
$this->implTestCallBy('PATCH');
}

public function testCallByPost()
{
$this->implTestCallBy('POST');
}

/**
* @expectedException Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException
*/
public function testCallByPut()
{
$this->implTestCallBy('PUT');
Expand Down
4 changes: 2 additions & 2 deletions Tests/Routing/RouteLoaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function testRouteLoader()
foreach ($routes as $route) {
$this->assertInstanceOf('Symfony\Component\Routing\Route', $route);
$this->assertEquals('json', $route->getDefault('_format'));
$this->assertEquals(array('POST'), $route->getMethods());
$this->assertContains('POST', $route->getMethods());
}
}

Expand All @@ -56,7 +56,7 @@ public function testPrefixedRoutes()
foreach ($routes as $route) {
$this->assertInstanceOf('Symfony\Component\Routing\Route', $route);
$this->assertEquals('json', $route->getDefault('_format'));
$this->assertEquals(array('POST'), $route->getMethods());
$this->assertContains('POST', $route->getMethods());

$this->assertEquals(0, strpos($route->getPath(), $prefix));
}
Expand Down

0 comments on commit 3f31f33

Please sign in to comment.