commit 75a6494a1279b090b874d98fc65d9577fea5fe09 Author: Joel Pittet Date: Sat Jan 25 10:08:33 2014 -0800 add some test diff --git a/core/modules/system/lib/Drupal/system/Tests/Theme/TwigFilterTest.php b/core/modules/system/lib/Drupal/system/Tests/Theme/TwigFilterTest.php new file mode 100644 index 0000000..e69de29 diff --git a/core/modules/system/tests/modules/twig_filter_test/lib/Drupal/twig_filter_test/TwigFilterTestController.php b/core/modules/system/tests/modules/twig_filter_test/lib/Drupal/twig_filter_test/TwigFilterTestController.php new file mode 100644 index 0000000..6d6b750 --- /dev/null +++ b/core/modules/system/tests/modules/twig_filter_test/lib/Drupal/twig_filter_test/TwigFilterTestController.php @@ -0,0 +1,31 @@ + 'twig_filter_test_filter', + '#body' => array( + 'arms' => array('#markup' => ' arms.'), + 'legs' => array('#markup' => ' legs.'), + 'head' => array('#markup' => ' head.'), + 'stomach' => array('#markup' => ' stomach.'), + ), + ); + } + +} diff --git a/core/modules/system/tests/modules/twig_filter_test/templates/twig_filter_test.filter.html.twig b/core/modules/system/tests/modules/twig_filter_test/templates/twig_filter_test.filter.html.twig new file mode 100644 index 0000000..3da1dd4 --- /dev/null +++ b/core/modules/system/tests/modules/twig_filter_test/templates/twig_filter_test.filter.html.twig @@ -0,0 +1,23 @@ +
+ I have no legs: {{ body|without('legs') }} +
+ +
+ Complete with: {{ body }} +
+ +
+ Ok legs only: {{ body.legs }} +
+ +
+ I have no legs or arms: {{ body|without('legs', 'arms') }} +
+ +
+ Ok legs only: {{ body.legs }} +
+ +
+ Complete again: {{ body }} +
diff --git a/core/modules/system/tests/modules/twig_filter_test/twig_filter_test.info.yml b/core/modules/system/tests/modules/twig_filter_test/twig_filter_test.info.yml new file mode 100644 index 0000000..5fff058 --- /dev/null +++ b/core/modules/system/tests/modules/twig_filter_test/twig_filter_test.info.yml @@ -0,0 +1,7 @@ +name: 'Twig Filter Test' +type: module +description: 'Support module for testing Twig filters.' +package: Testing +version: VERSION +core: 8.x +# hidden: true diff --git a/core/modules/system/tests/modules/twig_filter_test/twig_filter_test.module b/core/modules/system/tests/modules/twig_filter_test/twig_filter_test.module new file mode 100644 index 0000000..d4d960a --- /dev/null +++ b/core/modules/system/tests/modules/twig_filter_test/twig_filter_test.module @@ -0,0 +1,19 @@ + array( + 'variables' => array('body' => NULL), + 'template' => 'twig_filter_test.filter', + ), + ); +} + diff --git a/core/modules/system/tests/modules/twig_filter_test/twig_filter_test.routing.yml b/core/modules/system/tests/modules/twig_filter_test/twig_filter_test.routing.yml new file mode 100644 index 0000000..72b649c --- /dev/null +++ b/core/modules/system/tests/modules/twig_filter_test/twig_filter_test.routing.yml @@ -0,0 +1,6 @@ +twig_filter_test.filter: + path: '/twig-filter-test/filter' + defaults: + _content: '\Drupal\twig_filter_test\TwigFilterTestController::testFilterRender' + requirements: + _permission: 'access content'