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

testRemove() public method

public testRemove ( )
    public function testRemove()
    {
        $a = array('pages' => array('name' => 'page'), 'files' => array('name' => 'files'));
        $result = Set::remove($a, 'files', array('name' => 'files'));
        $expected = array('pages' => array('name' => 'page'));
        $this->assertIdentical($expected, $result);
        $a = array('pages' => array(array('name' => 'main'), array('name' => 'about', 'vars' => array('title' => 'page title'))));
        $result = Set::remove($a, 'pages.1.vars', array('title' => 'page title'));
        $expected = array('pages' => array(array('name' => 'main'), array('name' => 'about')));
        $this->assertIdentical($expected, $result);
        $result = Set::remove($a, 'pages.2.vars', array('title' => 'page title'));
        $expected = $a;
        $this->assertIdentical($expected, $result);
    }