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

testHasManyKey() public method

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