Beispiel #1
0
 public function addGroup(Group $group, array $options = array())
 {
     return GroupMembership::_create($this, $group, $this->getDataStore(), $options);
 }
 /**
  * @expectedException \Stormpath\Resource\ResourceError
  */
 public function testDelete()
 {
     $group = \Stormpath\Resource\Group::instantiate(array('name' => 'Another New Group' . md5(time())));
     self::$directory->createGroup($group);
     $account = \Stormpath\Resource\Account::instantiate(array('givenName' => 'Account Name', 'surname' => 'Surname', 'email' => md5(time()) . '@unknown12345678.kot', 'password' => 'superP4ss'));
     self::$directory->createAccount($account);
     $groupMembership = \Stormpath\Resource\GroupMembership::create(array('account' => $account, 'group' => $group));
     $groupMembership = \Stormpath\Resource\GroupMembership::get($groupMembership->href);
     $this->assertInstanceOf('\\Stormpath\\Resource\\GroupMembership', $groupMembership);
     $this->assertContains('Another New Group', $groupMembership->group->name);
     $this->assertContains('@unknown12345678.kot', $groupMembership->account->email);
     $href = $groupMembership->href;
     $groupMembership->delete();
     \Stormpath\Resource\GroupMembership::get($href);
 }
 public function addAccount(Account $account, array $options = array())
 {
     return GroupMembership::_create($account, $this, $this->getDataStore(), $options);
 }