/** * @expectedException yii\base\InvalidValueException */ public function test_SendMail_noBehaviorOwner() { $es = new EmailSupport(); $es->sendEmail(['data' => 'msg content', 'subject' => 'msg subject', 'type' => 'notification']); }
public function behaviors() { return [EmailSupport::className(), 'verb' => ['class' => \yii\filters\VerbFilter::class, 'actions' => ['about' => ['GET'], 'index' => ['GET'], 'books' => ['GET'], 'cover' => ['GET'], 'manage' => ['POST']]], 'access' => ['class' => \yii\filters\AccessControl::class, 'only' => ['login', 'logout', 'books'], 'rules' => [['allow' => true, 'actions' => ['login', 'books'], 'roles' => ['?']], ['allow' => true, 'actions' => ['logout', 'manage'], 'roles' => ['@']]]]]; }