lithium\tests\cases\util\SetTest::testIsNumericArrayCheck PHP Method

testIsNumericArrayCheck() public method

    public function testIsNumericArrayCheck()
    {
        $data = array('one');
        $this->assertTrue(Set::isNumeric(array_keys($data)));
        $data = array(1 => 'one');
        $this->assertFalse(Set::isNumeric($data));
        $data = array('one');
        $this->assertFalse(Set::isNumeric($data));
        $data = array('one' => 'two');
        $this->assertFalse(Set::isNumeric($data));
        $data = array('one' => 1);
        $this->assertTrue(Set::isNumeric($data));
        $data = array(0);
        $this->assertTrue(Set::isNumeric($data));
        $data = array('one', 'two', 'three', 'four', 'five');
        $this->assertTrue(Set::isNumeric(array_keys($data)));
        $data = array(1 => 'one', 2 => 'two', 3 => 'three', 4 => 'four', 5 => 'five');
        $this->assertTrue(Set::isNumeric(array_keys($data)));
        $data = array('1' => 'one', 2 => 'two', 3 => 'three', 4 => 'four', 5 => 'five');
        $this->assertTrue(Set::isNumeric(array_keys($data)));
        $data = array('one', 2 => 'two', 3 => 'three', 4 => 'four', 'a' => 'five');
        $this->assertFalse(Set::isNumeric(array_keys($data)));
        $data = array();
        $this->assertNull(Set::isNumeric($data));
    }