From ce348cb32d012fa73b3afc0f066f0dd78813352a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20W=C3=B3js?= Date: Wed, 13 Dec 2023 05:57:29 +0100 Subject: [PATCH] IBX-7276: Renamed ibexa_get_current_user Twig function to ibexa_current_user (#307) --- .../Symfony/Templating/Twig/Extension/UserExtension.php | 2 +- .../_fixtures/user_functions/ibexa_current_user.test | 8 ++++++++ .../_fixtures/user_functions/ibexa_get_current_user.test | 8 -------- 3 files changed, 9 insertions(+), 9 deletions(-) create mode 100644 tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/user_functions/ibexa_current_user.test delete mode 100644 tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/user_functions/ibexa_get_current_user.test diff --git a/src/lib/MVC/Symfony/Templating/Twig/Extension/UserExtension.php b/src/lib/MVC/Symfony/Templating/Twig/Extension/UserExtension.php index 0dbcdd6b7f..b1734c98d6 100644 --- a/src/lib/MVC/Symfony/Templating/Twig/Extension/UserExtension.php +++ b/src/lib/MVC/Symfony/Templating/Twig/Extension/UserExtension.php @@ -30,7 +30,7 @@ public function getFunctions(): array { return [ new TwigFunction( - 'ibexa_get_current_user', + 'ibexa_current_user', [$this, 'getCurrentUser'] ), new TwigFunction( diff --git a/tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/user_functions/ibexa_current_user.test b/tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/user_functions/ibexa_current_user.test new file mode 100644 index 0000000000..4eb566cf9d --- /dev/null +++ b/tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/user_functions/ibexa_current_user.test @@ -0,0 +1,8 @@ +--TEST-- +"ibexa_current_user" function +--TEMPLATE-- +{{ ibexa_current_user().getUserId() }} +--DATA-- +return []; +--EXPECT-- +10 diff --git a/tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/user_functions/ibexa_get_current_user.test b/tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/user_functions/ibexa_get_current_user.test deleted file mode 100644 index 618404bf4b..0000000000 --- a/tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/user_functions/ibexa_get_current_user.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -"ibexa_get_current_user" function ---TEMPLATE-- -{{ ibexa_get_current_user().getUserId() }} ---DATA-- -return []; ---EXPECT-- -10