lithium\tests\cases\data\entity\DocumentTest::testSetNested PHP Метод

testSetNested() публичный Метод

public testSetNested ( )
    public function testSetNested()
    {
        $doc = new Document(array('model' => $this->_model));
        $doc->_id = 123;
        $doc->name = 'father';
        $doc->set(array('child' => array('_id' => 124, 'name' => 'child')));
        $this->assertEqual('father', $doc->name);
        $this->assertInternalType('object', $doc->child, 'children is not an object');
        $this->assertInstanceOf('lithium\\data\\entity\\Document', $doc->child);
        $this->skipIf(!$doc->child instanceof Document, 'Child is not of the type Document');
        $expected = 124;
        $result = $doc->child->_id;
        $this->assertEqual($expected, $result);
        $expected = 'child';
        $result = $doc->child->name;
        $this->assertEqual($expected, $result);
    }