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)); }
/** * 限定公開記事は通知されない */ 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); }