35 lines
887 B
PHP
35 lines
887 B
PHP
<?php
|
|
|
|
namespace Drupal\Tests\opd_daily_emails\Functional;
|
|
|
|
use Drupal\Tests\BrowserTestBase;
|
|
use Drupal\Tests\opd_daily_emails\Traits\DailyEmailTestTrait;
|
|
use Drupal\Tests\token\Functional\TokenTestTrait;
|
|
use Drupal\node\NodeInterface;
|
|
|
|
class DailyEmailTokenTest extends BrowserTestBase {
|
|
|
|
use DailyEmailTestTrait;
|
|
use TokenTestTrait;
|
|
|
|
public $defaultTheme = 'stark';
|
|
|
|
public static $modules = [
|
|
'node',
|
|
'opd_daily_emails',
|
|
];
|
|
|
|
public function test_the_token_returns_the_number_of_sent_daily_emails(): void {
|
|
$this->createDailyEmailNode(['status' => NodeInterface::PUBLISHED]);
|
|
$this->createDailyEmailNode(['status' => NodeInterface::NOT_PUBLISHED]);
|
|
$this->createDailyEmailNode(['status' => NodeInterface::PUBLISHED]);
|
|
|
|
$this->assertToken(
|
|
data: [],
|
|
expected: 2,
|
|
token: 'email-count',
|
|
type: 'opd-daily-emails',
|
|
);
|
|
}
|
|
|
|
}
|