Esempio n. 1
0
 /**
  * Resolve and set default subscribers
  */
 protected function resolveAndSetDefaultSubscribers()
 {
     //Add requested by user as default subscriber
     if ($this->requestedByUser->id > 0) {
         TasksUtil::addSubscriber($this->requestedByUser, $this, false);
     }
     TasksUtil::addSubscriber($this->owner, $this, false);
 }
 /**
  * @covers resolveAndRenderTaskCardDetailsSubscribersContent
  */
 public function testResolveAndRenderTaskCardDetailsSubscribersContent()
 {
     $hellodear = UserTestHelper::createBasicUser('hellodear');
     $task = new Task();
     $task->name = 'MyCardTest';
     $task->owner = $hellodear;
     $this->assertTrue($task->save());
     $task = Task::getById($task->id);
     $user = Yii::app()->user->userModel;
     TasksUtil::addSubscriber($hellodear, $task);
     $this->assertTrue($task->save());
     $content = TasksUtil::resolveAndRenderTaskCardDetailsSubscribersContent($task);
     $this->assertContains('gravatar', $content);
     $this->assertContains('users/default/details', $content);
     $this->assertContains('hellodear', $content);
     $this->assertContains('task-owner', $content);
 }