summaryrefslogtreecommitdiff
path: root/tests/Unit/Helpers/VersionTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Unit/Helpers/VersionTest.php')
-rw-r--r--tests/Unit/Helpers/VersionTest.php28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/Unit/Helpers/VersionTest.php b/tests/Unit/Helpers/VersionTest.php
new file mode 100644
index 00000000..40569abb
--- /dev/null
+++ b/tests/Unit/Helpers/VersionTest.php
@@ -0,0 +1,28 @@
+<?php
+
+namespace Engelsystem\Test\Unit\Helpers;
+
+use Engelsystem\Config\Config;
+use Engelsystem\Helpers\Version;
+use Engelsystem\Test\Unit\ServiceProviderTest;
+
+class VersionTest extends ServiceProviderTest
+{
+ /**
+ * @covers \Engelsystem\Helpers\Version::__construct
+ * @covers \Engelsystem\Helpers\Version::getVersion
+ */
+ public function testGetVersion()
+ {
+ $config = new Config();
+ $version = new Version(__DIR__ . '/Stub', $config);
+
+ $this->assertEquals('n/a', $version->getVersion());
+
+ $version = new Version(__DIR__ . '/Stub/files', $config);
+ $this->assertEquals('0.42.0-testing', $version->getVersion());
+
+ $config->set('version', '1.2.3-dev');
+ $this->assertEquals('1.2.3-dev', $version->getVersion());
+ }
+}