mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Added tests to cover numeric array comparison. Refs #5179
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7394 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
f6d269a9e0
commit
93c29a1f3a
1 changed files with 18 additions and 0 deletions
|
@ -104,6 +104,24 @@ class SetTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
function testNumericArrayCheck() {
|
||||
$data = array('one');
|
||||
$this->assertTrue(Set::numeric(array_keys($data)));
|
||||
|
||||
$data = array(1 => 'one');
|
||||
$this->assertFalse(Set::numeric($data));
|
||||
|
||||
$data = array('one');
|
||||
$this->assertFalse(Set::numeric($data));
|
||||
|
||||
$data = array('one' => 'two');
|
||||
$this->assertFalse(Set::numeric($data));
|
||||
|
||||
$data = array('one' => 1);
|
||||
$this->assertTrue(Set::numeric($data));
|
||||
|
||||
$data = array(0);
|
||||
$this->assertTrue(Set::numeric($data));
|
||||
|
||||
$data = array('one', 'two', 'three', 'four', 'five');
|
||||
$this->assertTrue(Set::numeric(array_keys($data)));
|
||||
|
||||
|
|
Loading…
Reference in a new issue