From edebd9f02d3aeff4159a272be994623e2a681a66 Mon Sep 17 00:00:00 2001 From: Norbert Wagner Date: Wed, 6 Jan 2021 17:50:32 +0100 Subject: [PATCH] testing Unity Tests --- src/Settings.php | 2 +- tests/SettingsTest.php | 46 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 tests/SettingsTest.php diff --git a/src/Settings.php b/src/Settings.php index 90124f9..eb1aeb5 100644 --- a/src/Settings.php +++ b/src/Settings.php @@ -32,7 +32,7 @@ class Settings implements \Iterator private array $settings = []; - private string $appPath; + private string $appPath = './'; private ?string $pkgPath = null; private ?string $site = null; diff --git a/tests/SettingsTest.php b/tests/SettingsTest.php new file mode 100644 index 0000000..1ee2e57 --- /dev/null +++ b/tests/SettingsTest.php @@ -0,0 +1,46 @@ +. + * + *///}}} +declare(strict_types=1); +namespace rabe\Util\tests; + +use rabe\Util\Settings; +use PHPUnit\Framework\TestCase; + +class SettingsTest extends TestCase +{ + public function testBuildFileName() + { + $path = './config/'; + $prefix = 'VeruA'; + $postfix = 'conf.php'; + $type = ''; + $defaultName = "$path$prefix.$type$postfix"; + + $cfg = new Settings(); + + $this->assertEquals($defaultName, $cfg->buildFileName()); + } +} + +/* jEdit buffer local properties {{{ + * :folding=explicit:collapseFolds=1: +}}}*/ \ No newline at end of file