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

testCheck() public method

public testCheck ( )
    public function testCheck()
    {
        $set = array('My Index 1' => array('First' => 'The first item'));
        $result = Set::check($set, 'My Index 1.First');
        $this->assertTrue($result);
        $this->assertTrue(Set::check($set, 'My Index 1'));
        $this->assertNotEmpty(Set::check($set, array()));
        $set = array('My Index 1' => array('First' => array('Second' => array('Third' => array('Fourth' => 'Heavy. Nesting.')))));
        $this->assertTrue(Set::check($set, 'My Index 1.First.Second'));
        $this->assertTrue(Set::check($set, 'My Index 1.First.Second.Third'));
        $this->assertTrue(Set::check($set, 'My Index 1.First.Second.Third.Fourth'));
        $this->assertFalse(Set::check($set, 'My Index 1.First.Seconds.Third.Fourth'));
    }