Ejemplo n.º 1
0
 public function testIsRetireShouldReturnFalse()
 {
     $this->userRoleCriteria->shouldReceive('getByUserId')->andReturn(null);
     $service = new UserRoleService($this->userRoleCriteria);
     $this->assertFalse($service->isRetire(1235));
     $this->userRoleCriteria->shouldReceive('getByUserId')->andReturn((object) ['name' => 'オーナー']);
     $service = new UserRoleService($this->userRoleCriteria);
     $this->assertFalse($service->isRetire(1235));
 }
Ejemplo n.º 2
0
 /**
  * 限定公開記事は通知されない
  */
 public function testShouldNotNotifyWhenItemIsNotPublishedAndLimitation()
 {
     $this->itemRepo->shouldReceive('getByOpenItemId')->andReturn($this->createMockItem("1"));
     $this->userRepo->shouldReceive('getById')->andReturn($this->dummyUser);
     $this->slackUtilMock->shouldNotReceive('postEditMessage');
     $this->slackUtilMock->shouldNotReceive('postCreateMessage');
     $editEvent = new EditEvent('itemId', 'userId');
     $this->handler->onItemEdited($editEvent);
     $createEvent = new CreateEvent('itemId', 'userId');
     $this->handler->onItemCreated($createEvent);
 }