From 4ac6b8e9a51102e65da03580377afaa1d4bc1677 Mon Sep 17 00:00:00 2001 From: Joshua Ramon Enslin Date: Mon, 11 Nov 2019 12:13:52 +0100 Subject: [PATCH] Add test for start page phpcs-errors:1646 phpunit-status:successful --- .gitignore | 3 +++ composer.json | 5 +++++ index.php | 2 +- scripts/checkCodeQuality.sh | 40 ++++++++++++++++++++++++++++++++++ tests/apisRandomImagesTest.php | 30 +++++++++++++++++++++++++ tests/config.xml | 37 +++++++++++++++++++++++++++++++ 6 files changed, 116 insertions(+), 1 deletion(-) create mode 100644 composer.json create mode 100644 scripts/checkCodeQuality.sh create mode 100644 tests/apisRandomImagesTest.php create mode 100644 tests/config.xml diff --git a/.gitignore b/.gitignore index 5112f1d..e0ee4a6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,10 @@ /csv +/composer.lock /translation-importer /values/langfiles *.swp *.swo commonservices +/vendor/ /xml +.phpunit.result.cache diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..cbadbc6 --- /dev/null +++ b/composer.json @@ -0,0 +1,5 @@ +{ + "require-dev": { + "phpunit/phpunit": "^8.4" + } +} diff --git a/index.php b/index.php index f31fe66..da6d05f 100644 --- a/index.php +++ b/index.php @@ -79,7 +79,7 @@ foreach ($availableFields as $headline => $fields) { echo "
  • + */ +declare(strict_types=1); + +// phpcs:disable + +use PHPUnit\Framework\TestCase; + +final class StartPageLoadsTest extends TestCase { + + public function testHTMLOutput():void { + + ob_start(); + include __DIR__ . "/../index.php"; + $output = $this->getActualOutput(); + + $this->assertEquals( + true, + is_string($output) + ); + + ob_clean(); + + } + +} diff --git a/tests/config.xml b/tests/config.xml new file mode 100644 index 0000000..b828b98 --- /dev/null +++ b/tests/config.xml @@ -0,0 +1,37 @@ + + + + ../home/ + ../inc/ + + + + +