lithium\tests\cases\data\model\RelationshipTest::testBelongsToKey PHP Method

testBelongsToKey() public method

public testBelongsToKey ( )
    public function testBelongsToKey()
    {
        $config = array('from' => $this->_gallery, 'to' => $this->_image, 'type' => 'belongsTo', 'fieldName' => 'images');
        $relation = new Relationship($config + array('key' => 'gallery_id'));
        $expected = array('gallery_id' => 'id');
        $this->assertEqual($expected, $relation->key());
        $relation = new Relationship($config + array('key' => array('gallery_id' => 'id')));
        $this->assertEqual($expected, $relation->key());
    }