public function testMakeRecipientsForStaticRole() { $role = new Role(); $role->name = 'some group'; $role->users->add(User::getById(self::$sarahUserId)); $role->users->add(User::getById(self::$bobbyUserId)); $saved = $role->save(); $this->assertTrue($saved); $form = new StaticRoleWorkflowEmailMessageRecipientForm('WorkflowModelTestItem', Workflow::TYPE_ON_SAVE); $form->roleId = $role->id; $model = new WorkflowModelTestItem(); $recipients = $form->makeRecipients($model, Yii::app()->user->userModel); $this->assertEquals(2, count($recipients)); $this->assertEquals('sarah sarahson', $recipients[0]->toName); $this->assertEquals('*****@*****.**', $recipients[0]->toAddress); $this->assertEquals(self::$sarahUserId, $recipients[0]->personsOrAccounts[0]->id); $this->assertEquals('bobby bobbyson', $recipients[1]->toName); $this->assertEquals('*****@*****.**', $recipients[1]->toAddress); $this->assertEquals(self::$bobbyUserId, $recipients[1]->personsOrAccounts[0]->id); }