mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-02-07 12:36:25 +00:00
_lastAction() should also work with named parameters in the url
This commit is contained in:
parent
35d04ecb3d
commit
4c9f1cc154
1 changed files with 38 additions and 0 deletions
|
@ -10648,4 +10648,42 @@ class FormHelperTest extends CakeTestCase {
|
||||||
$this->assertEquals($expected, $result);
|
$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);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue