当前位置: 首页>>代码示例>>PHP>>正文


PHP UserFactory::entity方法代码示例

本文整理汇总了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);
 }
开发者ID:polidog,项目名称:php-chatwork-api,代码行数:45,代码来源:UserFactoryTest.php


注:本文中的UserFactory::entity方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。