本文整理汇总了PHP中UserFactory::entity方法的典型用法代码示例。如果您正苦于以下问题:PHP UserFactory::entity方法的具体用法?PHP UserFactory::entity怎么用?PHP UserFactory::entity使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserFactory
的用法示例。
在下文中一共展示了UserFactory::entity方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: UserFactory
/**
* @test
*/
public function ユーザーエンティティを生成する()
{
$factory = new UserFactory();
$entity = $factory->entity(json_decode('{
"account_id": 123,
"room_id": 322,
"name": "John Smith",
"chatwork_id": "tarochatworkid",
"organization_id": 101,
"organization_name": "Hello Company",
"department": "Marketing",
"title": "CMO",
"url": "http://mycompany.com",
"introduction": "Self Introduction",
"mail": "taro@example.com",
"tel_organization": "XXX-XXXX-XXXX",
"tel_extension": "YYY-YYYY-YYYY",
"tel_mobile": "ZZZ-ZZZZ-ZZZZ",
"skype": "myskype_id",
"facebook": "myfacebook_id",
"twitter": "mytwitter_id",
"avatar_image_url": "https://example.com/abc.png"
}', true));
$this->assertEquals(123, $entity->accountId);
$this->assertEquals(322, $entity->roomId);
$this->assertEquals('John Smith', $entity->name);
$this->assertEquals('tarochatworkid', $entity->chatworkId);
$this->assertEquals(101, $entity->organizationId);
$this->assertEquals('Hello Company', $entity->organizationName);
$this->assertEquals('Marketing', $entity->department);
$this->assertEquals('CMO', $entity->title);
$this->assertEquals('http://mycompany.com', $entity->url);
$this->assertEquals('Self Introduction', $entity->introduction);
$this->assertEquals('taro@example.com', $entity->mail);
$this->assertEquals('XXX-XXXX-XXXX', $entity->telOrganization);
$this->assertEquals('YYY-YYYY-YYYY', $entity->telExtension);
$this->assertEquals('ZZZ-ZZZZ-ZZZZ', $entity->telMobile);
$this->assertEquals('myskype_id', $entity->skype);
$this->assertEquals('myfacebook_id', $entity->facebook);
$this->assertEquals('mytwitter_id', $entity->twitter);
$this->assertEquals('https://example.com/abc.png', $entity->avatarImageUrl);
}