Set up environment for CI

phpcs-errors:0 phpunit-status:successful
This commit is contained in:
2019-11-12 22:32:37 +01:00
committed by Stefan Rohde-Enslin
parent d1f9982dc3
commit ace247fc35
6 changed files with 147 additions and 2 deletions

37
tests/config.xml Normal file
View File

@ -0,0 +1,37 @@
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/|version|/phpunit.xsd"
backupGlobals="true"
backupStaticAttributes="false"
cacheResult="true"
cacheTokens="true"
colors="false"
convertErrorsToExceptions="false"
convertNoticesToExceptions="false"
convertWarningsToExceptions="false"
forceCoversAnnotation="false"
printerClass="PHPUnit\TextUI\ResultPrinter"
processIsolation="true"
stopOnError="true"
stopOnFailure="true"
stopOnIncomplete="true"
stopOnSkipped="true"
stopOnRisky="true"
testSuiteLoaderClass="PHPUnit\Runner\StandardTestSuiteLoader"
timeoutForSmallTests="1"
timeoutForMediumTests="10"
timeoutForLargeTests="60"
verbose="false">
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">../home/</directory>
<directory suffix=".php">../inc/</directory>
<!-- <file>/path/to/file</file>
<exclude>
<directory suffix=".php">/path/to/files</directory>
<file>/path/to/file</file>
</exclude>-->
</whitelist>
</filter>
</phpunit>

29
tests/startPageTest.php Normal file
View File

@ -0,0 +1,29 @@
<?PHP
/**
* This script contains tests for the home page.
*
* @author Joshua Ramon Enslin <joshua@jrenslin.de>
*/
declare(strict_types=1);
// phpcs:disable
use PHPUnit\Framework\TestCase;
final class StartPageTest extends TestCase {
public function testHTMLOutput():void {
include __DIR__ . "/../index.php";
$output = $this->getActualOutput();
$this->assertEquals(
true,
is_string($output)
);
ob_clean();
}
}