Skip to content

Commit

Permalink
_lastAction() should also work with named parameters in the url
Browse files Browse the repository at this point in the history
  • Loading branch information
tersmitten committed Sep 20, 2016
1 parent 35d04ec commit 4c9f1cc
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions lib/Cake/Test/Case/View/Helper/FormHelperTest.php
Expand Up @@ -10648,4 +10648,42 @@ public function testInputDefaults() {
$this->assertEquals($expected, $result);
}

/**
* Tests `_lastAction`.
*
* With named, numeric value
*
* @return void
*/
public function testLastActionWithNamedNumeric() {
$here = '/users/index/page:1';

$this->Form->request->here = $here;
$this->Form->create('User');

$expected = $here;
$actual = $this->Form->_lastAction;

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

/**
* Tests `_lastAction`.
*
* With named, string value
*
* @return void
*/
public function testLastActionWithNamedString() {
$here = '/users/index/foo:bar';

$this->Form->request->here = $here;
$this->Form->create('User');

$expected = $here;
$actual = $this->Form->_lastAction;

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

}

0 comments on commit 4c9f1cc

Please sign in to comment.