mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-09-10 13:32:44 +00:00
Add tests for #2433
This commit is contained in:
parent
764e368dc3
commit
edcfe2d3a8
1 changed files with 20 additions and 0 deletions
|
@ -828,6 +828,26 @@ class HashTest extends CakeTestCase {
|
|||
$this->assertEquals(5, $result[3]['id']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test that attribute matchers don't cause errors on scalar data.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testExtractAttributeEqualityOnScalarValue() {
|
||||
$data = array(
|
||||
'Entity' => array(
|
||||
'id' => 1 ,
|
||||
'data1' => 'value',
|
||||
)
|
||||
);
|
||||
$result = Hash::extract($data, 'Entity[id=1].data1');
|
||||
$this->assertEquals(array('value'), $result);
|
||||
|
||||
$data = array('Entity' => false );
|
||||
$result = Hash::extract($data, 'Entity[id=1].data1');
|
||||
$this->assertEquals(array(), $result);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test comparison operators.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue