diff --git a/modules/opd_daily_emails/tests/src/Functional/DailyEmailTokenTest.php b/modules/opd_daily_emails/tests/src/Functional/DailyEmailTokenTest.php new file mode 100644 index 000000000..68b20a2d8 --- /dev/null +++ b/modules/opd_daily_emails/tests/src/Functional/DailyEmailTokenTest.php @@ -0,0 +1,45 @@ +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', + ); + } + + private function createDailyEmailNode(array $options): NodeInterface { + return $this->createNode(array_merge( + $options, + [ + 'type' => 'daily_email', + ] + )); + } + +} diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 7c54b408d..2c6634889 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -16,7 +16,7 @@ - +