public static function getMboxSha1SumAndMemberGroup() { return new Group(InverseFunctionalIdentifier::withMboxSha1Sum('4e271041e78101311fb37284ef1a1d35c3f1db35'), null, array(self::getTypicalAgent())); }
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_mbox_sha1_sums_are_equal() { $this->beConstructedThrough('withMboxSha1Sum', array('db77b9104b531ecbb0b967f6942549d0ba80fda1')); $this->equals(InverseFunctionalIdentifier::withMboxSha1Sum('db77b9104b531ecbb0b967f6942549d0ba80fda1'))->shouldReturn(true); }