示例#1
0
 public static function getAccountAndMemberGroup()
 {
     return new Group(InverseFunctionalIdentifier::withAccount(AccountFixtures::getTypicalAccount()), null, array(self::getTypicalAgent()));
 }
示例#2
0
 public function getModel()
 {
     $inverseFunctionalIdentifier = null;
     if (null !== $this->mbox) {
         $inverseFunctionalIdentifier = InverseFunctionalIdentifier::withMbox(IRI::fromString($this->mbox));
     } elseif (null !== $this->mboxSha1Sum) {
         $inverseFunctionalIdentifier = InverseFunctionalIdentifier::withMboxSha1Sum($this->mboxSha1Sum);
     } elseif (null !== $this->openId) {
         $inverseFunctionalIdentifier = InverseFunctionalIdentifier::withOpenId($this->openId);
     } elseif (null !== $this->accountName && null !== $this->accountHomePage) {
         $inverseFunctionalIdentifier = InverseFunctionalIdentifier::withAccount(new Account($this->accountName, IRL::fromString($this->accountHomePage)));
     }
     if ('group' === $this->type) {
         $members = array();
         foreach ($this->members as $agent) {
             $members[] = $agent->getModel();
         }
         return new Group($inverseFunctionalIdentifier, $this->name, $members);
     } else {
         return new Agent($inverseFunctionalIdentifier, $this->name);
     }
 }
 function it_is_equal_when_accounts_are_equal()
 {
     $this->beConstructedThrough('withAccount', array(new Account('test', IRL::fromString('https://tincanapi.com'))));
     $this->equals(InverseFunctionalIdentifier::withAccount(new Account('test', IRL::fromString('https://tincanapi.com'))))->shouldReturn(true);
 }