mirror of
https://github.com/humhub/humhub.git
synced 2025-01-29 20:38:26 +01:00
Fix WebTargetRenderTest
This commit is contained in:
parent
4f95737334
commit
5869295ea4
@ -14,7 +14,7 @@ class MailTargetRenderTest extends HumHubDbTestCase
|
||||
|
||||
public function testDefaultView()
|
||||
{
|
||||
$notification = notifications\TestedMailViewNotification::instance();
|
||||
$notification = notifications\TestNotification::instance();
|
||||
$target = Yii::$app->notification->getTarget(MailTarget::class);
|
||||
$renderer = $target->getRenderer();
|
||||
$this->assertContains('<h1>TestedMailViewNotificationHTML</h1>', $renderer->render($notification));
|
||||
|
@ -2,6 +2,8 @@
|
||||
|
||||
namespace humhub\modules\notification\tests\codeception\unit\rendering;
|
||||
|
||||
use humhub\modules\post\models\Post;
|
||||
use humhub\modules\user\models\User;
|
||||
use Yii;
|
||||
use tests\codeception\_support\HumHubDbTestCase;
|
||||
use Codeception\Specify;
|
||||
@ -14,7 +16,9 @@ class WebTargetRenderTest extends HumHubDbTestCase
|
||||
|
||||
public function testDefaultView()
|
||||
{
|
||||
$notification = notifications\TestedMailViewNotification::instance();
|
||||
$notification = notifications\TestNotification::instance()->about(Post::findOne(['id' => 1]));
|
||||
$notification->send(User::findOne(['id' => 1]));
|
||||
|
||||
$target = Yii::$app->notification->getTarget(WebTarget::class);
|
||||
$renderer = $target->getRenderer();
|
||||
$result = $renderer->render($notification);
|
||||
@ -24,8 +28,10 @@ class WebTargetRenderTest extends HumHubDbTestCase
|
||||
|
||||
public function testOverwriteViewFile()
|
||||
{
|
||||
$notification = notifications\TestedMailViewNotification::instance();
|
||||
$notification = notifications\TestNotification::instance()->about(Post::findOne(['id' => 1]));
|
||||
$notification->send(User::findOne(['id' => 1]));
|
||||
$notification->viewName = 'special';
|
||||
$notification->saveRecord(User::findOne(['id' => 1]));
|
||||
$target = Yii::$app->notification->getTarget(WebTarget::class);
|
||||
$renderer = $target->getRenderer();
|
||||
$result = $renderer->render($notification);
|
||||
|
@ -7,8 +7,12 @@ namespace humhub\modules\notification\tests\codeception\unit\rendering\notificat
|
||||
*
|
||||
* @author buddha
|
||||
*/
|
||||
class TestedMailViewNotification extends \humhub\modules\notification\components\BaseNotification
|
||||
class TestNotification extends \humhub\modules\notification\components\BaseNotification
|
||||
{
|
||||
public $moduleId = 'notification';
|
||||
public $requireOriginator = false;
|
||||
public $requireSource = false;
|
||||
|
||||
public function html()
|
||||
{
|
||||
return '<h1>TestedMailViewNotificationHTML</h1>';
|
Loading…
x
Reference in New Issue
Block a user