mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-09-06 11:32:40 +00:00
Adding fix for Set::extract() when only grabbing numeric keys
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5652 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
1791a378c0
commit
02494a0519
2 changed files with 14 additions and 1 deletions
|
@ -38,6 +38,12 @@ uses('set');
|
|||
*/
|
||||
class SetTest extends UnitTestCase {
|
||||
|
||||
function testNumericKeyExtraction() {
|
||||
$data = array('plugin' => null, 'controller' => '', 'action' => '', 1, 'whatever');
|
||||
$this->assertIdentical(Set::extract($data, '{n}'), array(1, 'whatever'));
|
||||
$this->assertIdentical(Set::diff($data, Set::extract($data, '{n}')), array('plugin' => null, 'controller' => '', 'action' => ''));
|
||||
}
|
||||
|
||||
function testMerge() {
|
||||
// Test that passing in just 1 array returns it "as-is"
|
||||
$r = Set::merge(array('foo'));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue