4
0

indexControllerTest.php 913 B

123456789101112131415161718192021222324
  1. <?php
  2. declare(strict_types=1);
  3. use PHPUnit\Framework\Attributes\PreserveGlobalState;
  4. use PHPUnit\Framework\Attributes\RunTestsInSeparateProcesses;
  5. #[RunTestsInSeparateProcesses]
  6. #[PreserveGlobalState(false)]
  7. final class indexControllerTest extends \PHPUnit\Framework\TestCase {
  8. public function testUnknownViewModeIsEncodedInNotification(): void {
  9. FreshRSS_Context::initSystem();
  10. FreshRSS_Context::setUserConf(clone FreshRSS_UserConfiguration::default());
  11. FreshRSS_Context::userConf()->view_mode = '<form action="https://example.net/">';
  12. Minz_Translate::init('en');
  13. (new FreshRSS_index_Controller())->indexAction();
  14. $notification = Minz_Request::getNotification();
  15. self::assertNotNull($notification);
  16. self::assertStringContainsString('&lt;form action=&quot;https://example.net/&quot;&gt;', $notification['content']);
  17. self::assertStringNotContainsString('<', $notification['content']);
  18. }
  19. }