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:
renan.saddam 2008-07-31 16:33:56 +00:00
parent f6d269a9e0
commit 93c29a1f3a

View file

@ -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)));