本文整理匯總了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);
}