_lastAction() should also work with named parameters in the url

This commit is contained in:
Mischa ter Smitten 2016-09-20 15:07:36 +02:00
parent 35d04ecb3d
commit 4c9f1cc154

View file

@ -10648,4 +10648,42 @@ class FormHelperTest extends CakeTestCase {
$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);
}
}