Skip to content

Commit

Permalink
Fix wrong variable assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Hoffmann committed Jul 10, 2017
1 parent 597e12a commit 3240a28
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/Routing/RouteBuilder.php
Expand Up @@ -508,12 +508,13 @@ protected function _methodRoute($method, $template, $target, $name)
$name = $this->_namePrefix . $name;
}
$options = [
'_method' => $method,
'_ext' => $this->_extensions,
'routeClass' => $this->_routeClass,
'_name' => $name,
];

$target['_method'] = $method;

$route = $this->_makeRoute($template, $target, $options);
$this->_collection->add($route, $options);

Expand Down
4 changes: 2 additions & 2 deletions tests/TestCase/Routing/RouteBuilderTest.php
Expand Up @@ -907,11 +907,11 @@ public function testHttpMethods($method)
'route-name'
);
$this->assertInstanceOf(Route::class, $route, 'Should return a route');
$this->assertSame($method, $route->options['_method']);
$this->assertSame($method, $route->defaults['_method']);
$this->assertSame('app:route-name', $route->options['_name']);
$this->assertSame('/bookmarks/:id', $route->template);
$this->assertEquals(
['plugin' => null, 'controller' => 'Bookmarks', 'action' => 'view'],
['plugin' => null, 'controller' => 'Bookmarks', 'action' => 'view', '_method' => $method],
$route->defaults
);
}
Expand Down

0 comments on commit 3240a28

Please sign in to comment.