From 61158ff80260300eba633785f49b3edc138acae2 Mon Sep 17 00:00:00 2001 From: netkas <netkas@n64.cc> Date: Tue, 17 Sep 2024 22:17:13 -0400 Subject: [PATCH] Added PhpUnit configuration --- .idea/php.xml | 5 +++++ bootstrap.php | 9 +++++++++ phpunit.xml | 11 +++++++++++ 3 files changed, 25 insertions(+) create mode 100644 bootstrap.php create mode 100644 phpunit.xml diff --git a/.idea/php.xml b/.idea/php.xml index b79a929..aafe326 100644 --- a/.idea/php.xml +++ b/.idea/php.xml @@ -26,6 +26,11 @@ <component name="PhpStanOptionsConfiguration"> <option name="transferred" value="true" /> </component> + <component name="PhpUnit"> + <phpunit_settings> + <PhpUnitSettings load_method="PHPUNIT_PHAR" custom_loader_path="" phpunit_phar_path="$USER_HOME$/phpunit.phar" /> + </phpunit_settings> + </component> <component name="PsalmOptionsConfiguration"> <option name="transferred" value="true" /> </component> diff --git a/bootstrap.php b/bootstrap.php new file mode 100644 index 0000000..a637173 --- /dev/null +++ b/bootstrap.php @@ -0,0 +1,9 @@ +<?php + + $autoload_path = __DIR__ . DIRECTORY_SEPARATOR . 'src' . DIRECTORY_SEPARATOR . 'ncc' . DIRECTORY_SEPARATOR . 'autoload.php'; + if(!file_exists($autoload_path)) + { + throw new Exception("Autoload file not found"); + } + + require $autoload_path; \ No newline at end of file diff --git a/phpunit.xml b/phpunit.xml new file mode 100644 index 0000000..ee902dc --- /dev/null +++ b/phpunit.xml @@ -0,0 +1,11 @@ +<phpunit bootstrap="bootstrap.php"> + <testsuites> + <testsuite name="ncc Test Suite"> + <directory>tests</directory> + </testsuite> + </testsuites> + <php> + <ini name="error_reporting" value="-1"/> + <server name="KERNEL_DIR" value="app/"/> + </php> +</phpunit>