From bc91c2e91142881e7c3f2cfe4036ceb4598ae993 Mon Sep 17 00:00:00 2001
From: Tim van Dijen <tvdijen@gmail.com>
Date: Tue, 5 May 2020 17:04:42 +0200
Subject: [PATCH] Replace release version with a constant
---
lib/SimpleSAML/Configuration.php | 7 ++++++-
tests/lib/SimpleSAML/ConfigurationTest.php | 2 +-
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/lib/SimpleSAML/Configuration.php b/lib/SimpleSAML/Configuration.php
index 384e6ef89..fb2008abe 100644
--- a/lib/SimpleSAML/Configuration.php
+++ b/lib/SimpleSAML/Configuration.php
@@ -17,6 +17,11 @@ use Webmozart\Assert\Assert;
*/
class Configuration implements Utils\ClearableState
{
+ /**
+ * The release version of this package
+ */
+ public const VERSION = 'master';
+
/**
* A default value which means that the given option is required.
*
@@ -345,7 +350,7 @@ class Configuration implements Utils\ClearableState
*/
public function getVersion(): string
{
- return 'master';
+ return self::VERSION;
}
diff --git a/tests/lib/SimpleSAML/ConfigurationTest.php b/tests/lib/SimpleSAML/ConfigurationTest.php
index 63f59f9d3..474c39a37 100644
--- a/tests/lib/SimpleSAML/ConfigurationTest.php
+++ b/tests/lib/SimpleSAML/ConfigurationTest.php
@@ -19,7 +19,7 @@ class ConfigurationTest extends \SimpleSAML\Test\Utils\ClearStateTestCase
public function testGetVersion()
{
$c = Configuration::getOptionalConfig();
- $this->assertTrue(is_string($c->getVersion()));
+ $this->assertEquals($c->getVersion(), Configuration::VERSION);
}
--
GitLab