Пример #1
0
 public function setUp()
 {
     parent::setUp();
     $this->my_user = aUser()->withId(101)->build();
     $this->none_user = aUser()->withId(100)->build();
     $this->collection = mock('User\\XML\\Import\\ReadyToBeImportedUsersCollection');
     $this->user_manager = mock('UserManager');
     stub($this->user_manager)->getUserAnonymous()->returns(anAnonymousUser()->build());
     stub($this->user_manager)->getUserByUserName('None')->returns($this->none_user);
     $this->mapping = new Mapping($this->user_manager, $this->collection, mock('Logger'));
 }
Пример #2
0
 function itThrowAnExceptionIfUserIsNotValid()
 {
     $group_id = 300;
     $ugroup_id = 200;
     $ugroup = new UGroup(array('group_id' => $group_id, 'ugroup_id' => $ugroup_id));
     $this->expectException();
     $user = anAnonymousUser()->build();
     $ugroup->removeUser($user);
 }