99use PhpMyAdmin \I18n \TextDirection ;
1010use PhpMyAdmin \Template ;
1111use PhpMyAdmin \Tests \AbstractTestCase ;
12- use PhpMyAdmin \Twig \PmaGlobalVariable ;
1312use PhpMyAdmin \Version ;
1413use PHPUnit \Framework \Attributes \CoversClass ;
1514use ReflectionProperty ;
16- use RuntimeException ;
1715use Twig \Error \RuntimeError ;
1816use Twig \Loader \FilesystemLoader ;
1917
20- #[CoversClass(PmaGlobalVariable ::class)]
18+ #[CoversClass(Template ::class)]
2119final class PmaGlobalVariableTest extends AbstractTestCase
2220{
2321 protected function setUp (): void
@@ -36,32 +34,13 @@ protected function tearDown(): void
3634 (new ReflectionProperty (Template::class, 'twig ' ))->setValue (null , null );
3735 }
3836
39- public function testUndefinedVariable (): void
40- {
41- self ::expectException (RuntimeException::class);
42- self ::expectExceptionMessage ('The "pma.undefined_variable" variable is not available. ' );
43- /**
44- * @psalm-suppress UndefinedMagicMethod
45- * @phpstan-ignore-next-line
46- */
47- (new PmaGlobalVariable ())->undefined_variable ();
48- }
49-
50- public function testVersion (): void
51- {
52- self ::assertSame (Version::VERSION , (new PmaGlobalVariable ())->version ());
53- }
54-
55- public function testTextDir (): void
56- {
57- LanguageManager::$ textDirection = TextDirection::LeftToRight;
58- self ::assertSame ('ltr ' , (new PmaGlobalVariable ())->text_dir ());
59- }
60-
6137 public function testUndefinedVariableFromTwig (): void
6238 {
6339 self ::expectException (RuntimeError::class);
64- self ::expectExceptionMessage ('The "pma.undefined_variable" variable is not available. ' );
40+ self ::expectExceptionMessage (
41+ 'Key "undefined_variable" for sequence/mapping with keys "version, text_dir" does not exist '
42+ . ' in "pma_global_variable/undefined_variable.twig" at line 1. ' ,
43+ );
6544 (new Template (new Config ()))->render ('pma_global_variable/undefined_variable ' , []);
6645 }
6746
0 commit comments