Skip to content

Commit

Permalink
[Tests] Fixed breaking changes introduced by twig/twig v3.11.0 (#415)
Browse files Browse the repository at this point in the history
For more details see #415

Key changes:

* [Tests] Dropped Twig template input not triggering deprecation messages

* [Tests] Aligned deprecation message format with twig/twig ^3.11.0
  • Loading branch information
alongosz committed Aug 9, 2024
1 parent 8a676dc commit 1208a1e
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 110 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
--TEST--
"ez_data_attributes_serialize" filter
--DEPRECATION--
Twig Filter "ez_data_attributes_serialize" is deprecated since version 4.0. Use "ibexa_data_attributes_serialize" instead in index.twig at line 2.
Since 4.0: Twig Filter "ez_data_attributes_serialize" is deprecated. Use "ibexa_data_attributes_serialize" instead in index.twig at line 2.
--TEMPLATE--
<a href="/article" {{ data_attributes|ez_data_attributes_serialize }}>Article</a>
--DATA--
Expand All @@ -13,27 +13,3 @@ return [
];
--EXPECT--
<a href="/article" data-my-attr1="value1" data-my-attr2="value2,value3">Article</a>
--DATA--
return [
'data_attributes' => [
'attr' => 'foo" style="background: red',
]
];
--EXPECT--
<a href="/article" data-attr="foo&quot; style=&quot;background: red">Article</a>
--DATA--
return [
'data_attributes' => [
'attr' => true,
]
];
--EXPECT--
<a href="/article" data-attr="true">Article</a>
--DATA--
return [
'data_attributes' => [
'attr' => ['key1' => 'value1', 'key2' => 'value2'],
]
];
--EXPECT--
<a href="/article" data-attr="{&quot;key1&quot;:&quot;value1&quot;,&quot;key2&quot;:&quot;value2&quot;}">Article</a>
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
--TEST--
"twig" filter
--DEPRECATION--
Twig Filter "ez_file_size" is deprecated since version 4.0. Use "ibexa_file_size" instead in index.twig at line 2.
Twig Filter "ez_file_size" is deprecated since version 4.0. Use "ibexa_file_size" instead in index.twig at line 3.
Twig Filter "ez_file_size" is deprecated since version 4.0. Use "ibexa_file_size" instead in index.twig at line 4.
Twig Filter "ez_file_size" is deprecated since version 4.0. Use "ibexa_file_size" instead in index.twig at line 5.
Twig Filter "ez_file_size" is deprecated since version 4.0. Use "ibexa_file_size" instead in index.twig at line 6.
Twig Filter "ez_file_size" is deprecated since version 4.0. Use "ibexa_file_size" instead in index.twig at line 7.
Twig Filter "ez_file_size" is deprecated since version 4.0. Use "ibexa_file_size" instead in index.twig at line 8.
Twig Filter "ez_file_size" is deprecated since version 4.0. Use "ibexa_file_size" instead in index.twig at line 9.
Twig Filter "ez_file_size" is deprecated since version 4.0. Use "ibexa_file_size" instead in index.twig at line 10.
Twig Filter "ez_file_size" is deprecated since version 4.0. Use "ibexa_file_size" instead in index.twig at line 11.
Twig Filter "ez_file_size" is deprecated since version 4.0. Use "ibexa_file_size" instead in index.twig at line 12.
Twig Filter "ez_file_size" is deprecated since version 4.0. Use "ibexa_file_size" instead in index.twig at line 13.
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 ) }}
Expand Down Expand Up @@ -42,37 +42,3 @@ return array()
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
--DATA--
return array()
--CONFIG--
$this->locale = "fre-FR"; return array();
--EXPECT--
10 B French version
1 kB French version
5 kB French version
12 kB French version
152 kB French version
26,15126 MB French version
123,1231 MB French version
456,5 GB French version
789,78979 TB French version
789,7897897898 PB French version
789,79 EB French version
789789789,7898 EB French version
--DATA--
return array()
--CONFIG--
$this->locale = "eng-GB"; return array();
--EXPECT--
10 B English version
1 kB English version
5 kB English version
12 kB English version
152 kB English version
26.15126 MB English version
123.1231 MB English version
456.5 GB English version
789.78979 TB English version
789.7897897898 PB English version
789.79 EB English version
789789789.7898 EB English version
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
--TEST--
"ez_path" function
--DEPRECATION--
Twig Function "ez_path" is deprecated since version 4.0. Use "ibexa_path" instead in index.twig at line 2.
Twig Function "ez_path" is deprecated since version 4.0. Use "ibexa_path" instead in index.twig at line 3.
Twig Function "ez_path" is deprecated since version 4.0. Use "ibexa_path" instead in index.twig at line 4.
Twig Function "ez_path" is deprecated since version 4.0. Use "ibexa_path" instead in index.twig at line 5.
Twig Function "ez_path" is deprecated since version 4.0. Use "ibexa_path" instead in index.twig at line 6.
Twig Function "ez_path" is deprecated since version 4.0. Use "ibexa_path" instead in index.twig at line 7.
Twig Function "ez_path" is deprecated since version 4.0. Use "ibexa_path" instead in index.twig at line 8.
Twig Function "ez_path" is deprecated since version 4.0. Use "ibexa_path" instead in index.twig at line 9.
Twig Function "ez_path" is deprecated since version 4.0. Use "ibexa_path" instead in index.twig at line 10.
Twig Function "ez_path" is deprecated since version 4.0. Use "ibexa_path" instead in index.twig at line 11.
Twig Function "ez_path" is deprecated since version 4.0. Use "ibexa_path" instead in index.twig at line 12.
Twig Function "ez_path" is deprecated since version 4.0. Use "ibexa_path" instead in index.twig at line 13.
Twig Function "ez_path" is deprecated since version 4.0. Use "ibexa_path" instead in index.twig at line 14.
Twig Function "ez_path" is deprecated since version 4.0. Use "ibexa_path" instead in index.twig at line 15.
Twig Function "ez_path" is deprecated since version 4.0. Use "ibexa_path" instead in index.twig at line 16.
Twig Function "ez_path" is deprecated since version 4.0. Use "ibexa_path" instead in index.twig at line 17.
Twig Function "ez_path" is deprecated since version 4.0. Use "ibexa_path" instead in index.twig at line 18.
Twig Function "ez_path" is deprecated since version 4.0. Use "ibexa_path" instead in index.twig at line 19.
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) }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
--TEST--
"twig" filter
--DEPRECATION--
Twig Function "ez_route" is deprecated since version 4.0. Use "ibexa_route" instead in index.twig at line 2.
Twig Function "ez_route" is deprecated since version 4.0. Use "ibexa_route" instead in index.twig at line 3.
Twig Function "ez_route" is deprecated since version 4.0. Use "ibexa_route" instead in index.twig at line 4.
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"} ) %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
--TEST--
"ez_url" function
--DEPRECATION--
Twig Function "ez_url" is deprecated since version 4.0. Use "ibexa_url" instead in index.twig at line 2.
Twig Function "ez_url" is deprecated since version 4.0. Use "ibexa_url" instead in index.twig at line 3.
Twig Function "ez_url" is deprecated since version 4.0. Use "ibexa_url" instead in index.twig at line 4.
Twig Function "ez_url" is deprecated since version 4.0. Use "ibexa_url" instead in index.twig at line 5.
Twig Function "ez_url" is deprecated since version 4.0. Use "ibexa_url" instead in index.twig at line 6.
Twig Function "ez_url" is deprecated since version 4.0. Use "ibexa_url" instead in index.twig at line 7.
Twig Function "ez_url" is deprecated since version 4.0. Use "ibexa_url" instead in index.twig at line 8.
Twig Function "ez_url" is deprecated since version 4.0. Use "ibexa_url" instead in index.twig at line 9.
Twig Function "ez_url" is deprecated since version 4.0. Use "ibexa_url" instead in index.twig at line 10.
Twig Function "ez_url" is deprecated since version 4.0. Use "ibexa_url" instead in index.twig at line 11.
Twig Function "ez_url" is deprecated since version 4.0. Use "ibexa_url" instead in index.twig at line 12.
Twig Function "ez_url" is deprecated since version 4.0. Use "ibexa_url" instead in index.twig at line 13.
Twig Function "ez_url" is deprecated since version 4.0. Use "ibexa_url" instead in index.twig at line 14.
Twig Function "ez_url" is deprecated since version 4.0. Use "ibexa_url" instead in index.twig at line 15.
Twig Function "ez_url" is deprecated since version 4.0. Use "ibexa_url" instead in index.twig at line 16.
Twig Function "ez_url" is deprecated since version 4.0. Use "ibexa_url" instead in index.twig at line 17.
Twig Function "ez_url" is deprecated since version 4.0. Use "ibexa_url" instead in index.twig at line 18.
Twig Function "ez_url" is deprecated since version 4.0. Use "ibexa_url" instead in index.twig at line 19.
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) }}
Expand Down

0 comments on commit 1208a1e

Please sign in to comment.