From 4c929de2d3d51ba13c28ae9ea3375872c73a40ee Mon Sep 17 00:00:00 2001 From: jurgenhaas <juergen@paragon-es.de> Date: Sat, 29 Sep 2018 20:35:10 +0200 Subject: [PATCH] Add PHPUnit test suites kernel and functional-javascript --- src/TestSuite/FunctionalJavascript.php | 27 ++++++++++++++++++++++++++ src/TestSuite/Kernel.php | 27 ++++++++++++++++++++++++++ templates/tests/phpunit.xml.dist | 6 ++++++ 3 files changed, 60 insertions(+) create mode 100644 src/TestSuite/FunctionalJavascript.php create mode 100644 src/TestSuite/Kernel.php diff --git a/src/TestSuite/FunctionalJavascript.php b/src/TestSuite/FunctionalJavascript.php new file mode 100644 index 0000000..638a099 --- /dev/null +++ b/src/TestSuite/FunctionalJavascript.php @@ -0,0 +1,27 @@ +<?php + +namespace LakeDrops\Drupal8ScaffoldDeveloper\TestSuites; + +require_once __DIR__ . '/Base.php'; + +/** + * Discovers tests for the functional test suite. + */ +class FunctionalJavascript extends Base { + + /** + * Factory method which loads up a suite with all functional tests. + * + * @return static + * The test suite. + */ + public static function suite() { + $root = dirname(dirname(dirname(dirname(dirname(__DIR__))))) . '/web'; + + $suite = new static('functional-javascript'); + $suite->addTestsBySuiteNamespace($root, 'FunctionalJavascript'); + + return $suite; + } + +} diff --git a/src/TestSuite/Kernel.php b/src/TestSuite/Kernel.php new file mode 100644 index 0000000..e1317d3 --- /dev/null +++ b/src/TestSuite/Kernel.php @@ -0,0 +1,27 @@ +<?php + +namespace LakeDrops\Drupal8ScaffoldDeveloper\TestSuites; + +require_once __DIR__ . '/Base.php'; + +/** + * Discovers tests for the unit test suite. + */ +class Kernel extends Base { + + /** + * Factory method which loads up a suite with all unit tests. + * + * @return static + * The test suite. + */ + public static function suite() { + $root = dirname(dirname(dirname(dirname(dirname(__DIR__))))) . '/web'; + + $suite = new static('kernel'); + $suite->addTestsBySuiteNamespace($root, 'Kernel'); + + return $suite; + } + +} diff --git a/templates/tests/phpunit.xml.dist b/templates/tests/phpunit.xml.dist index 4aff2ec..ac5797b 100644 --- a/templates/tests/phpunit.xml.dist +++ b/templates/tests/phpunit.xml.dist @@ -39,9 +39,15 @@ <testsuite name="unit"> <file>../vendor/lakedrops/d8-project-scaffold-developer/src/TestSuite/Unit.php</file> </testsuite> + <testsuite name="kernel"> + <file>../vendor/lakedrops/d8-project-scaffold-developer/src/TestSuite/Kernel.php</file> + </testsuite> <testsuite name="functional"> <file>../vendor/lakedrops/d8-project-scaffold-developer/src/TestSuite/Functional.php</file> </testsuite> + <testsuite name="functional-javascript"> + <file>../vendor/lakedrops/d8-project-scaffold-developer/src/TestSuite/FunctionalJavascript.php</file> + </testsuite> </testsuites> <listeners> <listener class="\Drupal\Tests\Listeners\DrupalListener"> -- GitLab