From 78236ffc31a89164f156639a47801d423eed71af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dawid=20Parafi=C5=84ski?= Date: Thu, 7 Nov 2024 14:03:54 +0100 Subject: [PATCH] IBX-8805: Dropped deprecated Twig Functions&Filters (#450) * IBX-8805: Dropped deprecated Twig Functions&Filters * dropped old fixtures --- .../Resources/views/content_fields.html.twig | 2 +- .../Twig/Extension/ContentExtension.php | 56 ------------- .../Extension/DataAttributesExtension.php | 9 --- .../Extension/FieldRenderingExtension.php | 20 ----- .../Twig/Extension/FileSizeExtension.php | 8 -- .../Twig/Extension/ImageExtension.php | 18 ----- .../Extension/QueryRenderingExtension.php | 18 ----- .../Twig/Extension/RenderContentExtension.php | 9 --- .../Twig/Extension/RenderExtension.php | 9 --- .../Extension/RenderLocationExtension.php | 9 --- .../Twig/Extension/RoutingExtension.php | 26 ------ .../Twig/Extension/FileSizeExtensionTest.php | 2 +- .../content_functions/ez_content_name.test | 35 -------- .../_fixtures/content_functions/ez_field.test | 49 ------------ .../ez_field_description.test | 49 ------------ .../content_functions/ez_field_name.test | 49 ------------ .../content_functions/ez_field_value.test | 49 ------------ .../content_functions/ez_is_field_empty.test | 80 ------------------- .../ez_render_field.test | 73 ----------------- .../ez_render_field_exception.test | 23 ------ .../ez_render_fielddefinition_settings.test | 25 ------ .../filters/ez_data_attributes_serialize.test | 15 ---- .../functions/ez_file_size/ez_file_size.test | 44 ---------- .../ibexa_file_size.test | 0 .../ez_render_content_query.test | 36 --------- .../ez_render_content_query_esi.test | 36 --------- .../ez_render_location_query.test | 36 --------- .../ez_render_location_query_esi.test | 36 --------- .../_fixtures/routing_functions/ez_path.test | 74 ----------------- .../_fixtures/routing_functions/ez_route.test | 25 ------ .../_fixtures/routing_functions/ez_url.test | 74 ----------------- 31 files changed, 2 insertions(+), 992 deletions(-) delete mode 100644 tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/content_functions/ez_content_name.test delete mode 100644 tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/content_functions/ez_field.test delete mode 100644 tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/content_functions/ez_field_description.test delete mode 100644 tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/content_functions/ez_field_name.test delete mode 100644 tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/content_functions/ez_field_value.test delete mode 100644 tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/content_functions/ez_is_field_empty.test delete mode 100644 tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/field_rendering_functions/ez_render_field.test delete mode 100644 tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/field_rendering_functions/ez_render_field_exception.test delete mode 100644 tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/field_rendering_functions/ez_render_fielddefinition_settings.test delete mode 100644 tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/filters/ez_data_attributes_serialize.test delete mode 100644 tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/functions/ez_file_size/ez_file_size.test rename tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/functions/{ez_file_size => ibexa_file_size}/ibexa_file_size.test (100%) delete mode 100644 tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/query_rendering_functions/ez_render_content_query.test delete mode 100644 tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/query_rendering_functions/ez_render_content_query_esi.test delete mode 100644 tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/query_rendering_functions/ez_render_location_query.test delete mode 100644 tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/query_rendering_functions/ez_render_location_query_esi.test delete mode 100644 tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/routing_functions/ez_path.test delete mode 100644 tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/routing_functions/ez_route.test delete mode 100644 tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/routing_functions/ez_url.test diff --git a/src/bundle/Core/Resources/views/content_fields.html.twig b/src/bundle/Core/Resources/views/content_fields.html.twig index 19626c2303..69be1e117c 100644 --- a/src/bundle/Core/Resources/views/content_fields.html.twig +++ b/src/bundle/Core/Resources/views/content_fields.html.twig @@ -5,7 +5,7 @@ # - \Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo contentInfo the contentInfo to which the field belongs to # - \Ibexa\Contracts\Core\Repository\Values\Content\VersionInfo versionInfo the versionInfo to which the field belongs to # - mixed fieldSettings settings of the field (depends on the fieldtype) - # - array parameters options passed to ez_render_field under the parameters key + # - array parameters options passed to ibexa_render_field under the parameters key # - array attr the attributes to add the generate HTML, contains at least a "class" entry # containing -field #} diff --git a/src/lib/MVC/Symfony/Templating/Twig/Extension/ContentExtension.php b/src/lib/MVC/Symfony/Templating/Twig/Extension/ContentExtension.php index 781c6db17c..b064af4def 100644 --- a/src/lib/MVC/Symfony/Templating/Twig/Extension/ContentExtension.php +++ b/src/lib/MVC/Symfony/Templating/Twig/Extension/ContentExtension.php @@ -62,50 +62,18 @@ public function __construct( public function getFunctions() { return [ - new TwigFunction( - 'ez_content_name', - [$this, 'getTranslatedContentName'], - [ - 'deprecated' => '4.0', - 'alternative' => 'ibexa_content_name', - ] - ), new TwigFunction( 'ibexa_content_name', [$this, 'getTranslatedContentName'] ), - new TwigFunction( - 'ez_field_value', - [$this, 'getTranslatedFieldValue'], - [ - 'deprecated' => '4.0', - 'alternative' => 'ibexa_field_value', - ] - ), new TwigFunction( 'ibexa_field_value', [$this, 'getTranslatedFieldValue'] ), - new TwigFunction( - 'ez_field', - [$this, 'getTranslatedField'], - [ - 'deprecated' => '4.0', - 'alternative' => 'ibexa_field', - ] - ), new TwigFunction( 'ibexa_field', [$this, 'getTranslatedField'] ), - new TwigFunction( - 'ez_field_is_empty', - [$this, 'isFieldEmpty'], - [ - 'deprecated' => '4.0', - 'alternative' => 'ibexa_field_is_empty', - ] - ), new TwigFunction( 'ibexa_has_field', [$this, 'hasField'] @@ -114,26 +82,10 @@ public function getFunctions() 'ibexa_field_is_empty', [$this, 'isFieldEmpty'] ), - new TwigFunction( - 'ez_field_name', - [$this, 'getTranslatedFieldDefinitionName'], - [ - 'deprecated' => '4.0', - 'alternative' => 'ibexa_field_name', - ] - ), new TwigFunction( 'ibexa_field_name', [$this, 'getTranslatedFieldDefinitionName'] ), - new TwigFunction( - 'ez_field_description', - [$this, 'getTranslatedFieldDefinitionDescription'], - [ - 'deprecated' => '4.0', - 'alternative' => 'ibexa_field_description', - ] - ), new TwigFunction( 'ibexa_field_description', [$this, 'getTranslatedFieldDefinitionDescription'] @@ -142,14 +94,6 @@ public function getFunctions() 'ibexa_field_group_name', [$this, 'getFieldGroupName'] ), - new TwigFunction( - 'ez_content_field_identifier_first_filled_image', - [$this, 'getFirstFilledImageFieldIdentifier'], - [ - 'deprecated' => '4.0', - 'alternative' => 'ibexa_content_field_identifier_first_filled_image', - ] - ), new TwigFunction( 'ibexa_content_field_identifier_first_filled_image', [$this, 'getFirstFilledImageFieldIdentifier'] diff --git a/src/lib/MVC/Symfony/Templating/Twig/Extension/DataAttributesExtension.php b/src/lib/MVC/Symfony/Templating/Twig/Extension/DataAttributesExtension.php index 6fd90f50ad..c059f7797c 100644 --- a/src/lib/MVC/Symfony/Templating/Twig/Extension/DataAttributesExtension.php +++ b/src/lib/MVC/Symfony/Templating/Twig/Extension/DataAttributesExtension.php @@ -24,15 +24,6 @@ class DataAttributesExtension extends AbstractExtension public function getFilters(): array { return [ - new TwigFilter( - 'ez_data_attributes_serialize', - [$this, 'serializeDataAttributes'], - [ - 'is_safe' => ['html'], - 'deprecated' => '4.0', - 'alternative' => 'ibexa_data_attributes_serialize', - ] - ), new TwigFilter( 'ibexa_data_attributes_serialize', [$this, 'serializeDataAttributes'], diff --git a/src/lib/MVC/Symfony/Templating/Twig/Extension/FieldRenderingExtension.php b/src/lib/MVC/Symfony/Templating/Twig/Extension/FieldRenderingExtension.php index ea2820c699..4e07c87018 100644 --- a/src/lib/MVC/Symfony/Templating/Twig/Extension/FieldRenderingExtension.php +++ b/src/lib/MVC/Symfony/Templating/Twig/Extension/FieldRenderingExtension.php @@ -64,31 +64,11 @@ public function getFunctions() }; return [ - new TwigFunction( - 'ez_render_field', - $renderFieldCallable, - [ - 'is_safe' => ['html'], - 'needs_environment' => true, - 'deprecated' => '4.0', - 'alternative' => 'ibexa_render_field', - ] - ), new TwigFunction( 'ibexa_render_field', $renderFieldCallable, ['is_safe' => ['html'], 'needs_environment' => true] ), - new TwigFunction( - 'ez_render_field_definition_settings', - $renderFieldDefinitionSettingsCallable, - [ - 'is_safe' => ['html'], - 'needs_environment' => true, - 'deprecated' => '4.0', - 'alternative' => 'ibexa_render_field_definition_settings', - ] - ), new TwigFunction( 'ibexa_render_field_definition_settings', $renderFieldDefinitionSettingsCallable, diff --git a/src/lib/MVC/Symfony/Templating/Twig/Extension/FileSizeExtension.php b/src/lib/MVC/Symfony/Templating/Twig/Extension/FileSizeExtension.php index 10ec36c376..e097aac4a7 100644 --- a/src/lib/MVC/Symfony/Templating/Twig/Extension/FileSizeExtension.php +++ b/src/lib/MVC/Symfony/Templating/Twig/Extension/FileSizeExtension.php @@ -75,14 +75,6 @@ private function getLocale() public function getFilters() { return [ - new TwigFilter( - 'ez_file_size', - [$this, 'sizeFilter'], - [ - 'deprecated' => '4.0', - 'alternative' => 'ibexa_file_size', - ] - ), new TwigFilter( 'ibexa_file_size', [$this, 'sizeFilter'] diff --git a/src/lib/MVC/Symfony/Templating/Twig/Extension/ImageExtension.php b/src/lib/MVC/Symfony/Templating/Twig/Extension/ImageExtension.php index 86ef0ab649..113aeee275 100644 --- a/src/lib/MVC/Symfony/Templating/Twig/Extension/ImageExtension.php +++ b/src/lib/MVC/Symfony/Templating/Twig/Extension/ImageExtension.php @@ -34,29 +34,11 @@ public function __construct(VariationHandler $imageVariationService, AssetMapper public function getFunctions() { return [ - new TwigFunction( - 'ez_image_alias', - [$this, 'getImageVariation'], - [ - 'is_safe' => ['html'], - 'deprecated' => '4.0', - 'alternative' => 'ibexa_image_alias', - ] - ), new TwigFunction( 'ibexa_image_alias', [$this, 'getImageVariation'], ['is_safe' => ['html']] ), - new TwigFunction( - 'ez_content_field_identifier_image_asset', - [$this, 'getImageAssetContentFieldIdentifier'], - [ - 'is_safe' => ['html'], - 'deprecated' => '4.0', - 'alternative' => 'ibexa_content_field_identifier_image_asset', - ] - ), new TwigFunction( 'ibexa_content_field_identifier_image_asset', [$this, 'getImageAssetContentFieldIdentifier'], diff --git a/src/lib/MVC/Symfony/Templating/Twig/Extension/QueryRenderingExtension.php b/src/lib/MVC/Symfony/Templating/Twig/Extension/QueryRenderingExtension.php index 8e4e53cbf2..5f3d465192 100644 --- a/src/lib/MVC/Symfony/Templating/Twig/Extension/QueryRenderingExtension.php +++ b/src/lib/MVC/Symfony/Templating/Twig/Extension/QueryRenderingExtension.php @@ -46,29 +46,11 @@ public function getFunctions(): array }; return [ - new TwigFunction( - 'ez_render_*_query', - $typeCallable, - [ - 'is_safe' => ['html'], - 'deprecated' => '4.0', - 'alternative' => 'ibexa_render_*_query', - ] - ), new TwigFunction( 'ibexa_render_*_query', $typeCallable, ['is_safe' => ['html']] ), - new TwigFunction( - 'ez_render_*_query_*', - $typeAndRendererCallable, - [ - 'is_safe' => ['html'], - 'deprecated' => '4.0', - 'alternative' => 'ibexa_render_*_query_', - ] - ), new TwigFunction( 'ibexa_render_*_query_*', $typeAndRendererCallable, diff --git a/src/lib/MVC/Symfony/Templating/Twig/Extension/RenderContentExtension.php b/src/lib/MVC/Symfony/Templating/Twig/Extension/RenderContentExtension.php index 25ae6de87e..cbd9fd8056 100644 --- a/src/lib/MVC/Symfony/Templating/Twig/Extension/RenderContentExtension.php +++ b/src/lib/MVC/Symfony/Templating/Twig/Extension/RenderContentExtension.php @@ -38,15 +38,6 @@ public function __construct( public function getFunctions(): array { return [ - new TwigFunction( - 'ez_render_content', - [$this, 'renderContent'], - [ - 'is_safe' => ['html'], - 'deprecated' => '4.0', - 'alternative' => 'ibexa_render_content', - ] - ), new TwigFunction( 'ibexa_render_content', [$this, 'renderContent'], diff --git a/src/lib/MVC/Symfony/Templating/Twig/Extension/RenderExtension.php b/src/lib/MVC/Symfony/Templating/Twig/Extension/RenderExtension.php index 13421a3d31..d5a9086cc9 100644 --- a/src/lib/MVC/Symfony/Templating/Twig/Extension/RenderExtension.php +++ b/src/lib/MVC/Symfony/Templating/Twig/Extension/RenderExtension.php @@ -39,15 +39,6 @@ public function __construct( public function getFunctions(): array { return [ - new TwigFunction( - 'ez_render', - [$this, 'render'], - [ - 'is_safe' => ['html'], - 'deprecated' => '4.0', - 'alternative' => 'ibexa_render', - ] - ), new TwigFunction( 'ibexa_render', [$this, 'render'], diff --git a/src/lib/MVC/Symfony/Templating/Twig/Extension/RenderLocationExtension.php b/src/lib/MVC/Symfony/Templating/Twig/Extension/RenderLocationExtension.php index c0b838ddb3..f81b67ef15 100644 --- a/src/lib/MVC/Symfony/Templating/Twig/Extension/RenderLocationExtension.php +++ b/src/lib/MVC/Symfony/Templating/Twig/Extension/RenderLocationExtension.php @@ -38,15 +38,6 @@ public function __construct( public function getFunctions(): array { return [ - new TwigFunction( - 'ez_render_location', - [$this, 'renderLocation'], - [ - 'is_safe' => ['html'], - 'deprecated' => '4.0', - 'alternative' => 'ibexa_render_location', - ] - ), new TwigFunction( 'ibexa_render_location', [$this, 'renderLocation'], diff --git a/src/lib/MVC/Symfony/Templating/Twig/Extension/RoutingExtension.php b/src/lib/MVC/Symfony/Templating/Twig/Extension/RoutingExtension.php index a759af0cb5..82b6ef46ff 100644 --- a/src/lib/MVC/Symfony/Templating/Twig/Extension/RoutingExtension.php +++ b/src/lib/MVC/Symfony/Templating/Twig/Extension/RoutingExtension.php @@ -43,27 +43,10 @@ public function __construct( public function getFunctions(): array { return [ - new TwigFunction( - 'ez_route', - [$this, 'getRouteReference'], - [ - 'deprecated' => '4.0', - 'alternative' => 'ibexa_route', - ] - ), new TwigFunction( 'ibexa_route', [$this, 'getRouteReference'] ), - new TwigFunction( - 'ez_path', - [$this, 'getPath'], - [ - 'is_safe_callback' => [$this, 'isUrlGenerationSafe'], - 'deprecated' => '4.0', - 'alternative' => 'ibexa_path', - ] - ), new TwigFunction( 'ibexa_path', [$this, 'getPath'], @@ -71,15 +54,6 @@ public function getFunctions(): array 'is_safe_callback' => [$this, 'isUrlGenerationSafe'], ] ), - new TwigFunction( - 'ez_url', - [$this, 'getUrl'], - [ - 'is_safe_callback' => [$this, 'isUrlGenerationSafe'], - 'deprecated' => '4.0', - 'alternative' => 'ibexa_url', - ] - ), new TwigFunction( 'ibexa_url', [$this, 'getUrl'], diff --git a/tests/lib/MVC/Symfony/Templating/Twig/Extension/FileSizeExtensionTest.php b/tests/lib/MVC/Symfony/Templating/Twig/Extension/FileSizeExtensionTest.php index 2ee4c4ef46..aa8476419e 100644 --- a/tests/lib/MVC/Symfony/Templating/Twig/Extension/FileSizeExtensionTest.php +++ b/tests/lib/MVC/Symfony/Templating/Twig/Extension/FileSizeExtensionTest.php @@ -76,7 +76,7 @@ protected function getExtensions() */ protected function getFixturesDir() { - return __DIR__ . '/_fixtures/functions/ez_file_size'; + return __DIR__ . '/_fixtures/functions/ibexa_file_size'; } /** diff --git a/tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/content_functions/ez_content_name.test b/tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/content_functions/ez_content_name.test deleted file mode 100644 index 88e6fb2b38..0000000000 --- a/tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/content_functions/ez_content_name.test +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -"ez_content_name" function ---TEMPLATE-- -{{ ez_content_name( content ) }} -{{ ez_content_name( content, "eng-GB" ) }} - ---DATA-- -return array( - 'content' => $this->getContent( - 'article', - array(), - array( - 'eng-US' => 'American', - 'fre-FR' => 'French' - ) - ) -) ---EXPECT-- -French -French - ---DATA-- -return array( - 'content' => $this->getContent( - 'article', - array(), - array( - 'eng-GB' => 'British', - 'eng-US' => 'American' - ) - ) -) ---EXPECT-- -American -British diff --git a/tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/content_functions/ez_field.test b/tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/content_functions/ez_field.test deleted file mode 100644 index 28ead38efd..0000000000 --- a/tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/content_functions/ez_field.test +++ /dev/null @@ -1,49 +0,0 @@ ---TEST-- -"ez_field" function ---TEMPLATE-- -{{ ez_field( content, "testfield" ).value }} -{{ ez_field( content, "testfield", "eng-GB" ).value }} - ---DATA-- -return array( - 'content' => $this->getContent( - 'article', - array( - 'ezstring' => array( - 'id' => 5, - 'fieldDefIdentifier' => 'testfield', - 'value' => 'foo2', - 'languageCode' => 'fre-FR' - ) - ) - ) -) ---EXPECT-- -foo2 -foo2 - ---DATA-- -return array( - 'content' => $this->getContent( - 'article', - array( - 'ezstring' => array( - array( - 'id' => 5, - 'fieldDefIdentifier' => 'testfield', - 'value' => 'bar3', - 'languageCode' => 'eng-GB' - ), - array( - 'id' => 5, - 'fieldDefIdentifier' => 'testfield', - 'value' => 'foo2', - 'languageCode' => 'fre-FR' - ), - ) - ) - ) -) ---EXPECT-- -foo2 -bar3 diff --git a/tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/content_functions/ez_field_description.test b/tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/content_functions/ez_field_description.test deleted file mode 100644 index 4cf367a387..0000000000 --- a/tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/content_functions/ez_field_description.test +++ /dev/null @@ -1,49 +0,0 @@ ---TEST-- -"ez_field_description" function ---TEMPLATE-- -{{ ez_field_description( content, 'testfield' ) }} -{{ ez_field_description( content, 'testfield', "eng-GB" ) }} - ---DATA-- -return array( - 'content' => $this->getContent( - 'article', - array( - 'ezstring' => array( - 'id' => 5, - 'fieldDefIdentifier' => 'testfield', - 'value' => 'foo2', - 'languageCode' => 'fre-FR', - 'fieldDefDescriptions' => array( - 'eng-US' => 'American description', - 'fre-FR' => 'French description', - ) - ) - ) - ) -) ---EXPECT-- -French description -French description - ---DATA-- -return array( - 'content' => $this->getContent( - 'article', - array( - 'ezstring' => array( - 'id' => 5, - 'fieldDefIdentifier' => 'testfield', - 'value' => 'foo2', - 'languageCode' => 'fre-FR', - 'fieldDefDescriptions' => array( - 'eng-GB' => 'British description', - 'eng-US' => 'American description', - ) - ) - ) - ) -) ---EXPECT-- -American description -British description diff --git a/tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/content_functions/ez_field_name.test b/tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/content_functions/ez_field_name.test deleted file mode 100644 index a650008d88..0000000000 --- a/tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/content_functions/ez_field_name.test +++ /dev/null @@ -1,49 +0,0 @@ ---TEST-- -"ez_field_name" function ---TEMPLATE-- -{{ ez_field_name( content, 'testfield' ) }} -{{ ez_field_name( content, 'testfield', "eng-GB" ) }} - ---DATA-- -return array( - 'content' => $this->getContent( - 'article', - array( - 'ezstring' => array( - 'id' => 5, - 'fieldDefIdentifier' => 'testfield', - 'value' => 'foo2', - 'languageCode' => 'fre-FR', - 'fieldDefNames' => array( - 'eng-US' => 'American name', - 'fre-FR' => 'French name', - ) - ) - ) - ) -) ---EXPECT-- -French name -French name - ---DATA-- -return array( - 'content' => $this->getContent( - 'article', - array( - 'ezstring' => array( - 'id' => 5, - 'fieldDefIdentifier' => 'testfield', - 'value' => 'foo2', - 'languageCode' => 'fre-FR', - 'fieldDefNames' => array( - 'eng-GB' => 'British name', - 'eng-US' => 'American name', - ) - ) - ) - ) -) ---EXPECT-- -American name -British name diff --git a/tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/content_functions/ez_field_value.test b/tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/content_functions/ez_field_value.test deleted file mode 100644 index 5bc40c14c4..0000000000 --- a/tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/content_functions/ez_field_value.test +++ /dev/null @@ -1,49 +0,0 @@ ---TEST-- -"ez_field_value" function ---TEMPLATE-- -{{ ez_field_value( content, "testfield" ) }} -{{ ez_field_value( content, "testfield", "eng-GB" ) }} - ---DATA-- -return array( - 'content' => $this->getContent( - 'article', - array( - 'ezstring' => array( - 'id' => 5, - 'fieldDefIdentifier' => 'testfield', - 'value' => 'foo2', - 'languageCode' => 'fre-FR' - ) - ) - ) -) ---EXPECT-- -foo2 -foo2 - ---DATA-- -return array( - 'content' => $this->getContent( - 'article', - array( - 'ezstring' => array( - array( - 'id' => 5, - 'fieldDefIdentifier' => 'testfield', - 'value' => 'bar3', - 'languageCode' => 'eng-GB' - ), - array( - 'id' => 5, - 'fieldDefIdentifier' => 'testfield', - 'value' => 'foo2', - 'languageCode' => 'fre-FR' - ), - ) - ) - ) -) ---EXPECT-- -foo2 -bar3 diff --git a/tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/content_functions/ez_is_field_empty.test b/tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/content_functions/ez_is_field_empty.test deleted file mode 100644 index 7130bd95e5..0000000000 --- a/tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/content_functions/ez_is_field_empty.test +++ /dev/null @@ -1,80 +0,0 @@ ---TEST-- -"ez_field_is_empty" function ---TEMPLATE-- -{% if ez_field_is_empty( content, field ) %} - empty -{% else %} - not empty -{% endif %} - ---DATA-- -return array( - 'content' => $this->getContent( - 'data', - array( - 'ezdata' => array( - 'id' => 5, - 'fieldDefIdentifier' => 'testfield', - 'value' => 'foo2', - 'languageCode' => 'fre-FR' - ) - ) - ), - 'field' => $this->getField( false )->fieldDefIdentifier -) ---EXPECT-- -not empty - ---DATA-- -return array( - 'content' => $this->getContent( - 'data', - array( - 'ezdata' => array( - 'id' => 5, - 'fieldDefIdentifier' => 'testfield', - 'value' => 'foo2', - 'languageCode' => 'fre-FR' - ) - ) - ), - 'field' => $this->getField( true )->fieldDefIdentifier -) ---EXPECT-- -empty - ---DATA-- -return array( - 'content' => $this->getContent( - 'data', - array( - 'ezdata' => array( - 'id' => 5, - 'fieldDefIdentifier' => 'testfield', - 'value' => 'foo2', - 'languageCode' => 'fre-FR' - ) - ) - ), - 'field' => $this->getField( false ) -) ---EXPECT-- -not empty - ---DATA-- -return array( - 'content' => $this->getContent( - 'data', - array( - 'ezdata' => array( - 'id' => 5, - 'fieldDefIdentifier' => 'testfield', - 'value' => 'foo2', - 'languageCode' => 'fre-FR' - ) - ) - ), - 'field' => $this->getField( true ) -) ---EXPECT-- -empty diff --git a/tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/field_rendering_functions/ez_render_field.test b/tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/field_rendering_functions/ez_render_field.test deleted file mode 100644 index a402f0f118..0000000000 --- a/tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/field_rendering_functions/ez_render_field.test +++ /dev/null @@ -1,73 +0,0 @@ ---TEST-- -"ez_render_field" function ---TEMPLATE-- -{% extends 'templates/base.html.twig' %} -{% block content %} -{{ ez_render_field( nooverride, 'testfield' ) }} -{{ ez_render_field( overrides, 'testfield' ) }} -{{ ez_render_field( notdefault, 'testfield' ) }} -{{ ez_render_field( data, 'testfield' ) }} -{{ ez_render_field( data, 'testfield', {'attr': {'class': 'added'}} ) }} -{{ ez_render_field( data, 'testfield', {'parameters': { 'key1' : 1, 'key2': 2, 'key3': 3 }} ) }} -{{ ez_render_field( data, 'testfield', {'parameters': [ 3, 2, 1]} ) }} -{{ ez_render_field( data, 'testfield', {'parameters': [ 3, 2, 1], 'template': "templates/fields_localoverride.html.twig"} ) }} -{{ ez_render_field( data, 'testfield', {'parameters': [ 3, 2, 1], 'template': _self} ) }}{% endblock %} -{% block ezdata_field %}SELF OVERRIDE field id: 5 contentInfo id: 42 versionInfo versionNo: 64 attr class: ezdata-field parameters:3, 2, 1{% endblock %} ---DATA-- -return array( - 'nooverride' => $this->getContent( - 'nooverride', - array( - 'eznooverride' => array( - 'id' => 2, - 'fieldDefIdentifier' => 'testfield', - 'value' => 'foo2', - 'languageCode' => 'fre-FR' - ), - ) - ), - 'overrides' => $this->getContent( - 'overrides', - array( - 'ezoverride' => array( - 'id' => 3, - 'fieldDefIdentifier' => 'testfield', - 'value' => 'foo2', - 'languageCode' => 'fre-FR' - ), - ) - ), - 'notdefault' => $this->getContent( - 'notdefault', - array( - 'eznotdefault' => array( - 'id' => 4, - 'fieldDefIdentifier' => 'testfield', - 'value' => 'foo2', - 'languageCode' => 'fre-FR' - ), - ) - ), - 'data' => $this->getContent( - 'data', - array( - 'ezdata' => array( - 'id' => 5, - 'fieldDefIdentifier' => 'testfield', - 'value' => 'foo2', - 'languageCode' => 'fre-FR' - ), - ) - ) - -) ---EXPECT-- -default (no override) -override2 -not default -field id: 5 contentInfo id: 42 versionInfo versionNo: 64 attr class: ezdata-field parameters:empty -field id: 5 contentInfo id: 42 versionInfo versionNo: 64 attr class: added ezdata-field parameters:empty -field id: 5 contentInfo id: 42 versionInfo versionNo: 64 attr class: ezdata-field parameters:1, 2, 3 -field id: 5 contentInfo id: 42 versionInfo versionNo: 64 attr class: ezdata-field parameters:3, 2, 1 -LOCAL OVERRIDE field id: 5 contentInfo id: 42 versionInfo versionNo: 64 attr class: ezdata-field parameters:3, 2, 1 -SELF OVERRIDE field id: 5 contentInfo id: 42 versionInfo versionNo: 64 attr class: ezdata-field parameters:3, 2, 1 diff --git a/tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/field_rendering_functions/ez_render_field_exception.test b/tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/field_rendering_functions/ez_render_field_exception.test deleted file mode 100644 index 1c6582ca1c..0000000000 --- a/tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/field_rendering_functions/ez_render_field_exception.test +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -Exception for "ez_render_field" function ---TEMPLATE-- -{% extends 'templates/base.html.twig' %} -{% block content %} -{{ ez_render_field( notexisting, 'testfield' ) }} -{% endblock %} ---DATA-- -return array( - 'notexisting' => $this->getContent( - 'notexisting', - array( - 'notexisting' => array( - 'id' => 2, - 'fieldDefIdentifier' => 'testfield', - 'value' => 'foo2', - 'languageCode' => 'fre-FR' - ), - ) - ) -) ---EXCEPTION-- -An exception has been thrown during the rendering of a template ("Cannot find 'notexisting_field' template block.") in "index.twig" at line 4. diff --git a/tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/field_rendering_functions/ez_render_fielddefinition_settings.test b/tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/field_rendering_functions/ez_render_fielddefinition_settings.test deleted file mode 100644 index c27564499a..0000000000 --- a/tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/field_rendering_functions/ez_render_fielddefinition_settings.test +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -"ez_render_field_definition_settings" function ---TEMPLATE-- -{{ ez_render_field_definition_settings( nooverride ) }} -{{ ez_render_field_definition_settings( overrides ) }} -{{ ez_render_field_definition_settings( notdefault ) }} -{{ ez_render_field_definition_settings( withdata ) }} -{{ ez_render_field_definition_settings( notexisting ) }} ---DATA-- -return array( - 'nooverride' => $this->getFieldDefinition( 'eznooverride' ), - 'overrides' => $this->getFieldDefinition( 'ezoverride' ), - 'notdefault' => $this->getFieldDefinition( 'eznotdefaulttemplate' ), - 'withdata' => $this->getFieldDefinition( - 'ezwithdata', 42, - array( 'frameworks' => array( 'YUI3', 'jQuery' ) ) - ), - 'notexisting' => $this->getFieldDefinition( 'eznotexisting' ) -) ---EXPECT-- -default (no override) -override2 -not default -42 ezwithdata YUI3, jQuery - diff --git a/tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/filters/ez_data_attributes_serialize.test b/tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/filters/ez_data_attributes_serialize.test deleted file mode 100644 index ec2eefd0f6..0000000000 --- a/tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/filters/ez_data_attributes_serialize.test +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -"ez_data_attributes_serialize" filter ---DEPRECATION-- -Since 4.0: Twig Filter "ez_data_attributes_serialize" is deprecated. Use "ibexa_data_attributes_serialize" instead in index.twig at line 2. ---TEMPLATE-- -Article ---DATA-- -return [ - 'data_attributes' => [ - 'my-attr1' => 'value1', - 'my-attr2' => 'value2,value3', - ] -]; ---EXPECT-- -Article diff --git a/tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/functions/ez_file_size/ez_file_size.test b/tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/functions/ez_file_size/ez_file_size.test deleted file mode 100644 index 726e6b2c7c..0000000000 --- a/tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/functions/ez_file_size/ez_file_size.test +++ /dev/null @@ -1,44 +0,0 @@ ---TEST-- -"twig" filter ---DEPRECATION-- -Since 4.0: Twig Filter "ez_file_size" is deprecated. Use "ibexa_file_size" instead in index.twig at line 2. -Since 4.0: Twig Filter "ez_file_size" is deprecated. Use "ibexa_file_size" instead in index.twig at line 3. -Since 4.0: Twig Filter "ez_file_size" is deprecated. Use "ibexa_file_size" instead in index.twig at line 4. -Since 4.0: Twig Filter "ez_file_size" is deprecated. Use "ibexa_file_size" instead in index.twig at line 5. -Since 4.0: Twig Filter "ez_file_size" is deprecated. Use "ibexa_file_size" instead in index.twig at line 6. -Since 4.0: Twig Filter "ez_file_size" is deprecated. Use "ibexa_file_size" instead in index.twig at line 7. -Since 4.0: Twig Filter "ez_file_size" is deprecated. Use "ibexa_file_size" instead in index.twig at line 8. -Since 4.0: Twig Filter "ez_file_size" is deprecated. Use "ibexa_file_size" instead in index.twig at line 9. -Since 4.0: Twig Filter "ez_file_size" is deprecated. Use "ibexa_file_size" instead in index.twig at line 10. -Since 4.0: Twig Filter "ez_file_size" is deprecated. Use "ibexa_file_size" instead in index.twig at line 11. -Since 4.0: Twig Filter "ez_file_size" is deprecated. Use "ibexa_file_size" instead in index.twig at line 12. -Since 4.0: Twig Filter "ez_file_size" is deprecated. Use "ibexa_file_size" instead in index.twig at line 13. ---TEMPLATE-- -{{ 10|ez_file_size( 2 ) }} -{{ 1024|ez_file_size( 0 ) }} -{{ 5120|ez_file_size( 3 ) }} -{{ 12288|ez_file_size( 1 ) }} -{{ 155648|ez_file_size( 0 ) }} -{{ 27421583|ez_file_size( 5 ) }} -{{ 129103927|ez_file_size( 4 ) }} -{{ 490163142656|ez_file_size( 1 ) }} -{{ 868383057603765|ez_file_size( 6 ) }} -{{ 889224250749591400|ez_file_size( 10 ) }} -{{ 910565875123441600000|ez_file_size( 2 ) }} -{{ 910565632767581700000000000|ez_file_size( 4 ) }} ---DATA-- -$this->setConfigurationLocale( array( 'wrong local' ), 'eng-GB' ); -return array() ---EXPECT-- -10 B wrong local so we take the default one which is en-GB here -1 kB wrong local so we take the default one which is en-GB here -5 kB wrong local so we take the default one which is en-GB here -12 kB wrong local so we take the default one which is en-GB here -152 kB wrong local so we take the default one which is en-GB here -26.15126 MB wrong local so we take the default one which is en-GB here -123.1231 MB wrong local so we take the default one which is en-GB here -456.5 GB wrong local so we take the default one which is en-GB here -789.78979 TB wrong local so we take the default one which is en-GB here -789.7897897898 PB wrong local so we take the default one which is en-GB here -789.79 EB wrong local so we take the default one which is en-GB here -789789789.7898 EB wrong local so we take the default one which is en-GB here diff --git a/tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/functions/ez_file_size/ibexa_file_size.test b/tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/functions/ibexa_file_size/ibexa_file_size.test similarity index 100% rename from tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/functions/ez_file_size/ibexa_file_size.test rename to tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/functions/ibexa_file_size/ibexa_file_size.test diff --git a/tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/query_rendering_functions/ez_render_content_query.test b/tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/query_rendering_functions/ez_render_content_query.test deleted file mode 100644 index 93d7f5f4de..0000000000 --- a/tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/query_rendering_functions/ez_render_content_query.test +++ /dev/null @@ -1,36 +0,0 @@ ---TEST-- -"ez_render_content_query" function ---TEMPLATE-- -{{ ez_render_content_query({ - 'query': { - 'query_type': 'LatestBlogPost', - }, - 'template': 'latest_blog_post.html.twig', -}) }} ---DATA-- -return array() ---EXPECT-- -array ( - 0 => - \Symfony\Component\HttpKernel\Controller\ControllerReference::__set_state(array( - 'controller' => 'ibexa_query_render::renderQuery', - 'attributes' => - array ( - 'options' => - array ( - 'query' => - array ( - 'query_type' => 'LatestBlogPost', - ), - 'template' => 'latest_blog_post.html.twig', - ), - ), - 'query' => - array ( - ), - )), - 1 => 'inline', - 2 => - array ( - ), -) diff --git a/tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/query_rendering_functions/ez_render_content_query_esi.test b/tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/query_rendering_functions/ez_render_content_query_esi.test deleted file mode 100644 index 41c83b4f6c..0000000000 --- a/tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/query_rendering_functions/ez_render_content_query_esi.test +++ /dev/null @@ -1,36 +0,0 @@ ---TEST-- -"ez_render_content_query_esi" function ---TEMPLATE-- -{{ ez_render_content_query_esi({ - 'query': { - 'query_type': 'LatestBlogPost', - }, - 'template': 'latest_blog_post.html.twig', -}) }} ---DATA-- -return array() ---EXPECT-- -array ( - 0 => - \Symfony\Component\HttpKernel\Controller\ControllerReference::__set_state(array( - 'controller' => 'ibexa_query_render::renderQuery', - 'attributes' => - array ( - 'options' => - array ( - 'query' => - array ( - 'query_type' => 'LatestBlogPost', - ), - 'template' => 'latest_blog_post.html.twig', - ), - ), - 'query' => - array ( - ), - )), - 1 => 'esi', - 2 => - array ( - ), -) diff --git a/tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/query_rendering_functions/ez_render_location_query.test b/tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/query_rendering_functions/ez_render_location_query.test deleted file mode 100644 index 1b2ad20022..0000000000 --- a/tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/query_rendering_functions/ez_render_location_query.test +++ /dev/null @@ -1,36 +0,0 @@ ---TEST-- -"ez_render_location_query" function ---TEMPLATE-- -{{ ez_render_location_query({ - 'query': { - 'query_type': 'LatestBlogPost', - }, - 'template': 'latest_blog_post.html.twig', -}) }} ---DATA-- -return array() ---EXPECT-- -array ( - 0 => - \Symfony\Component\HttpKernel\Controller\ControllerReference::__set_state(array( - 'controller' => 'ibexa_query_render::renderQuery', - 'attributes' => - array ( - 'options' => - array ( - 'query' => - array ( - 'query_type' => 'LatestBlogPost', - ), - 'template' => 'latest_blog_post.html.twig', - ), - ), - 'query' => - array ( - ), - )), - 1 => 'inline', - 2 => - array ( - ), -) diff --git a/tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/query_rendering_functions/ez_render_location_query_esi.test b/tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/query_rendering_functions/ez_render_location_query_esi.test deleted file mode 100644 index 878942f4a0..0000000000 --- a/tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/query_rendering_functions/ez_render_location_query_esi.test +++ /dev/null @@ -1,36 +0,0 @@ ---TEST-- -"ez_render_location_query_esi" function ---TEMPLATE-- -{{ ez_render_location_query_esi({ - 'query': { - 'query_type': 'LatestBlogPost', - }, - 'template': 'latest_blog_post.html.twig', -}) }} ---DATA-- -return array() ---EXPECT-- -array ( - 0 => - \Symfony\Component\HttpKernel\Controller\ControllerReference::__set_state(array( - 'controller' => 'ibexa_query_render::renderQuery', - 'attributes' => - array ( - 'options' => - array ( - 'query' => - array ( - 'query_type' => 'LatestBlogPost', - ), - 'template' => 'latest_blog_post.html.twig', - ), - ), - 'query' => - array ( - ), - )), - 1 => 'esi', - 2 => - array ( - ), -) diff --git a/tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/routing_functions/ez_path.test b/tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/routing_functions/ez_path.test deleted file mode 100644 index 3a26493fc4..0000000000 --- a/tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/routing_functions/ez_path.test +++ /dev/null @@ -1,74 +0,0 @@ ---TEST-- -"ez_path" function ---DEPRECATION-- -Since 4.0: Twig Function "ez_path" is deprecated. Use "ibexa_path" instead in index.twig at line 2. -Since 4.0: Twig Function "ez_path" is deprecated. Use "ibexa_path" instead in index.twig at line 3. -Since 4.0: Twig Function "ez_path" is deprecated. Use "ibexa_path" instead in index.twig at line 4. -Since 4.0: Twig Function "ez_path" is deprecated. Use "ibexa_path" instead in index.twig at line 5. -Since 4.0: Twig Function "ez_path" is deprecated. Use "ibexa_path" instead in index.twig at line 6. -Since 4.0: Twig Function "ez_path" is deprecated. Use "ibexa_path" instead in index.twig at line 7. -Since 4.0: Twig Function "ez_path" is deprecated. Use "ibexa_path" instead in index.twig at line 8. -Since 4.0: Twig Function "ez_path" is deprecated. Use "ibexa_path" instead in index.twig at line 9. -Since 4.0: Twig Function "ez_path" is deprecated. Use "ibexa_path" instead in index.twig at line 10. -Since 4.0: Twig Function "ez_path" is deprecated. Use "ibexa_path" instead in index.twig at line 11. -Since 4.0: Twig Function "ez_path" is deprecated. Use "ibexa_path" instead in index.twig at line 12. -Since 4.0: Twig Function "ez_path" is deprecated. Use "ibexa_path" instead in index.twig at line 13. -Since 4.0: Twig Function "ez_path" is deprecated. Use "ibexa_path" instead in index.twig at line 14. -Since 4.0: Twig Function "ez_path" is deprecated. Use "ibexa_path" instead in index.twig at line 15. -Since 4.0: Twig Function "ez_path" is deprecated. Use "ibexa_path" instead in index.twig at line 16. -Since 4.0: Twig Function "ez_path" is deprecated. Use "ibexa_path" instead in index.twig at line 17. -Since 4.0: Twig Function "ez_path" is deprecated. Use "ibexa_path" instead in index.twig at line 18. -Since 4.0: Twig Function "ez_path" is deprecated. Use "ibexa_path" instead in index.twig at line 19. ---TEMPLATE-- -{{ ez_path(location) }} -{{ ez_path(location, {}, true) }} -{{ ez_path(location, {'foo': 'foo'}) }} -{{ ez_path(content) }} -{{ ez_path(content, {}, true) }} -{{ ez_path(content, {'foo': 'foo'}) }} -{{ ez_path(content_info) }} -{{ ez_path(content_info, {}, true) }} -{{ ez_path(content_info, {'foo': 'foo'}) }} -{{ ez_path(content_aware) }} -{{ ez_path(content_aware, {}, true) }} -{{ ez_path(content_aware, {'foo': 'foo'}) }} -{{ ez_path(route_ref) }} -{{ ez_path(route_ref, {}, true) }} -{{ ez_path(route_ref, {'baz': 'baz'}) }} -{{ ez_path(unsupported_object) }} -{{ ez_path(unsupported_object, {}, true) }} -{{ ez_path(unsupported_object, {'baz': 'baz'}) }} ---DATA-- -return [ - 'location' => $this->getExampleLocation(54), - 'content' => $this->getExampleContent(2), - 'content_info' => $this->getExampleContentInfo(2), - 'content_aware' => $this->getExampleContentAware(64), - 'route_ref' => $this->getExampleRouteReference( - 'example_route', - [ - 'foo' => 'foo', - 'bar' => 'bar' - ] - ), - 'unsupported_object' => $this->getExampleUnsupportedObject(), -]; ---EXPECT-- -{"$name":"ibexa.url.alias","$parameters":{"locationId":54},"$referenceType":1} -{"$name":"ibexa.url.alias","$parameters":{"locationId":54},"$referenceType":2} -{"$name":"ibexa.url.alias","$parameters":{"foo":"foo","locationId":54},"$referenceType":1} -{"$name":"ibexa.url.alias","$parameters":{"contentId":2},"$referenceType":1} -{"$name":"ibexa.url.alias","$parameters":{"contentId":2},"$referenceType":2} -{"$name":"ibexa.url.alias","$parameters":{"foo":"foo","contentId":2},"$referenceType":1} -{"$name":"ibexa.url.alias","$parameters":{"contentId":2},"$referenceType":1} -{"$name":"ibexa.url.alias","$parameters":{"contentId":2},"$referenceType":2} -{"$name":"ibexa.url.alias","$parameters":{"foo":"foo","contentId":2},"$referenceType":1} -{"$name":"ibexa.url.alias","$parameters":{"contentId":64},"$referenceType":1} -{"$name":"ibexa.url.alias","$parameters":{"contentId":64},"$referenceType":2} -{"$name":"ibexa.url.alias","$parameters":{"foo":"foo","contentId":64},"$referenceType":1} -{"$name":"example_route","$parameters":{"foo":"foo","bar":"bar"},"$referenceType":1} -{"$name":"example_route","$parameters":{"foo":"foo","bar":"bar"},"$referenceType":2} -{"$name":"example_route","$parameters":{"baz":"baz","foo":"foo","bar":"bar"},"$referenceType":1} -{"$name":"","$parameters":{"_route_object":{"foo":"foo","bar":"bar"}},"$referenceType":1} -{"$name":"","$parameters":{"_route_object":{"foo":"foo","bar":"bar"}},"$referenceType":2} -{"$name":"","$parameters":{"baz":"baz","_route_object":{"foo":"foo","bar":"bar"}},"$referenceType":1} diff --git a/tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/routing_functions/ez_route.test b/tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/routing_functions/ez_route.test deleted file mode 100644 index 084741ded6..0000000000 --- a/tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/routing_functions/ez_route.test +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -"twig" filter ---DEPRECATION-- -Since 4.0: Twig Function "ez_route" is deprecated. Use "ibexa_route" instead in index.twig at line 2. -Since 4.0: Twig Function "ez_route" is deprecated. Use "ibexa_route" instead in index.twig at line 3. -Since 4.0: Twig Function "ez_route" is deprecated. Use "ibexa_route" instead in index.twig at line 4. ---TEMPLATE-- -{% set route_ref1 = ez_route( "foo_route" ) %} -{% set route_ref2 = ez_route( "bar_route", {"some": "thing"} ) %} -{% set route_ref3 = ez_route( "route_66", {"direction": "highway to hell"} ) %} -{{ route_ref1.route }} -{{ route_ref1.get( "param", "test" ) }} -{{ route_ref2.route }} -{{ route_ref2.get( "some" ) }} -{{ route_ref3.route }} -{{ route_ref3.get( "direction", "highway to hell" ) }} ---DATA-- -return array(); ---EXPECT-- -foo_route -test -bar_route -thing -route_66 -highway to hell diff --git a/tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/routing_functions/ez_url.test b/tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/routing_functions/ez_url.test deleted file mode 100644 index b63e601cb6..0000000000 --- a/tests/lib/MVC/Symfony/Templating/Twig/Extension/_fixtures/routing_functions/ez_url.test +++ /dev/null @@ -1,74 +0,0 @@ ---TEST-- -"ez_url" function ---DEPRECATION-- -Since 4.0: Twig Function "ez_url" is deprecated. Use "ibexa_url" instead in index.twig at line 2. -Since 4.0: Twig Function "ez_url" is deprecated. Use "ibexa_url" instead in index.twig at line 3. -Since 4.0: Twig Function "ez_url" is deprecated. Use "ibexa_url" instead in index.twig at line 4. -Since 4.0: Twig Function "ez_url" is deprecated. Use "ibexa_url" instead in index.twig at line 5. -Since 4.0: Twig Function "ez_url" is deprecated. Use "ibexa_url" instead in index.twig at line 6. -Since 4.0: Twig Function "ez_url" is deprecated. Use "ibexa_url" instead in index.twig at line 7. -Since 4.0: Twig Function "ez_url" is deprecated. Use "ibexa_url" instead in index.twig at line 8. -Since 4.0: Twig Function "ez_url" is deprecated. Use "ibexa_url" instead in index.twig at line 9. -Since 4.0: Twig Function "ez_url" is deprecated. Use "ibexa_url" instead in index.twig at line 10. -Since 4.0: Twig Function "ez_url" is deprecated. Use "ibexa_url" instead in index.twig at line 11. -Since 4.0: Twig Function "ez_url" is deprecated. Use "ibexa_url" instead in index.twig at line 12. -Since 4.0: Twig Function "ez_url" is deprecated. Use "ibexa_url" instead in index.twig at line 13. -Since 4.0: Twig Function "ez_url" is deprecated. Use "ibexa_url" instead in index.twig at line 14. -Since 4.0: Twig Function "ez_url" is deprecated. Use "ibexa_url" instead in index.twig at line 15. -Since 4.0: Twig Function "ez_url" is deprecated. Use "ibexa_url" instead in index.twig at line 16. -Since 4.0: Twig Function "ez_url" is deprecated. Use "ibexa_url" instead in index.twig at line 17. -Since 4.0: Twig Function "ez_url" is deprecated. Use "ibexa_url" instead in index.twig at line 18. -Since 4.0: Twig Function "ez_url" is deprecated. Use "ibexa_url" instead in index.twig at line 19. ---TEMPLATE-- -{{ ez_url(location) }} -{{ ez_url(location, {}, true) }} -{{ ez_url(location, {'foo': 'foo'}) }} -{{ ez_url(content) }} -{{ ez_url(content, {}, true) }} -{{ ez_url(content, {'foo': 'foo'}) }} -{{ ez_url(content_info) }} -{{ ez_url(content_info, {}, true) }} -{{ ez_url(content_info, {'foo': 'foo'}) }} -{{ ez_url(content_aware) }} -{{ ez_url(content_aware, {}, true) }} -{{ ez_url(content_aware, {'foo': 'foo'}) }} -{{ ez_url(route_ref) }} -{{ ez_url(route_ref, {}, true) }} -{{ ez_url(route_ref, {'baz': 'baz'}) }} -{{ ez_url(unsupported_object) }} -{{ ez_url(unsupported_object, {}, true) }} -{{ ez_url(unsupported_object, {'baz': 'baz'}) }} ---DATA-- -return [ - 'location' => $this->getExampleLocation(54), - 'content' => $this->getExampleContent(2), - 'content_info' => $this->getExampleContentInfo(2), - 'content_aware' => $this->getExampleContentAware(64), - 'route_ref' => $this->getExampleRouteReference( - 'example_route', - [ - 'foo' => 'foo', - 'bar' => 'bar' - ] - ), - 'unsupported_object' => $this->getExampleUnsupportedObject(), -]; ---EXPECT-- -{"$name":"ibexa.url.alias","$parameters":{"locationId":54},"$referenceType":0} -{"$name":"ibexa.url.alias","$parameters":{"locationId":54},"$referenceType":3} -{"$name":"ibexa.url.alias","$parameters":{"foo":"foo","locationId":54},"$referenceType":0} -{"$name":"ibexa.url.alias","$parameters":{"contentId":2},"$referenceType":0} -{"$name":"ibexa.url.alias","$parameters":{"contentId":2},"$referenceType":3} -{"$name":"ibexa.url.alias","$parameters":{"foo":"foo","contentId":2},"$referenceType":0} -{"$name":"ibexa.url.alias","$parameters":{"contentId":2},"$referenceType":0} -{"$name":"ibexa.url.alias","$parameters":{"contentId":2},"$referenceType":3} -{"$name":"ibexa.url.alias","$parameters":{"foo":"foo","contentId":2},"$referenceType":0} -{"$name":"ibexa.url.alias","$parameters":{"contentId":64},"$referenceType":0} -{"$name":"ibexa.url.alias","$parameters":{"contentId":64},"$referenceType":3} -{"$name":"ibexa.url.alias","$parameters":{"foo":"foo","contentId":64},"$referenceType":0} -{"$name":"example_route","$parameters":{"foo":"foo","bar":"bar"},"$referenceType":0} -{"$name":"example_route","$parameters":{"foo":"foo","bar":"bar"},"$referenceType":3} -{"$name":"example_route","$parameters":{"baz":"baz","foo":"foo","bar":"bar"},"$referenceType":0} -{"$name":"","$parameters":{"_route_object":{"foo":"foo","bar":"bar"}},"$referenceType":0} -{"$name":"","$parameters":{"_route_object":{"foo":"foo","bar":"bar"}},"$referenceType":3} -{"$name":"","$parameters":{"baz":"baz","_route_object":{"foo":"foo","bar":"bar"}},"$referenceType":0}