本文整理汇总了PHP中PhoneNumber::getAssociated方法的典型用法代码示例。如果您正苦于以下问题:PHP PhoneNumber::getAssociated方法的具体用法?PHP PhoneNumber::getAssociated怎么用?PHP PhoneNumber::getAssociated使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PhoneNumber
的用法示例。
在下文中一共展示了PhoneNumber::getAssociated方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testGetAssociated
/**
* Test that getAssociated can translate document mappings into well know CakePHP association names
*
*/
public function testGetAssociated()
{
$user = new User();
$result = $user->getAssociated();
$this->assertEquals('hasOne', $result['Address']['type']);
$this->assertTrue($result['Address']['embedded']);
$this->assertEquals('hasOne', $result['Account']['type']);
$this->assertTrue($result['Account']['reference']);
$this->assertEquals('hasMany', $result['PhoneNumber']['type']);
$this->assertTrue($result['PhoneNumber']['embedded']);
$number = new PhoneNumber();
$expected = array('OwningUser' => array('type' => 'belongsTo'));
$result = $number->getAssociated();
$this->assertEquals('belongsTo', $result['OwningUser']['type']);
$this->assertTrue($result['OwningUser']['reference']);
}