47 lines
960 B
PHP
47 lines
960 B
PHP
<?php
|
|
|
|
namespace Drupal\Tests\opd_daily_emails\Functional;
|
|
|
|
use Drupal\Tests\BrowserTestBase;
|
|
use Drupal\Tests\RandomGeneratorTrait;
|
|
use Drupal\Tests\opd_daily_emails\Traits\DailyEmailTestTrait;
|
|
use Drupal\Tests\token\Functional\TokenTestTrait;
|
|
|
|
class DailyEmailTokenTest extends BrowserTestBase {
|
|
|
|
use DailyEmailTestTrait;
|
|
use RandomGeneratorTrait;
|
|
use TokenTestTrait;
|
|
|
|
public $defaultTheme = 'stark';
|
|
|
|
protected static $modules = [
|
|
'node',
|
|
'opd_daily_emails',
|
|
];
|
|
|
|
public function test_the_token_returns_the_number_of_published_daily_emails(): void {
|
|
$this->createDailyEmailNode(
|
|
isPublished: TRUE,
|
|
title: 'a',
|
|
);
|
|
|
|
$this->createDailyEmailNode(
|
|
isPublished: FALSE,
|
|
title: 'b',
|
|
);
|
|
|
|
$this->createDailyEmailNode(
|
|
isPublished: TRUE,
|
|
title: 'c',
|
|
);
|
|
|
|
$this->assertToken(
|
|
data: [],
|
|
expected: 2,
|
|
token: 'email-count',
|
|
type: 'opd-daily-emails',
|
|
);
|
|
}
|
|
|
|
}
|