aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/UtilsTest.php
diff options
context:
space:
mode:
authorArthur <arthur@hoa.ro>2015-07-15 11:05:07 +0200
committerArthur <arthur@hoa.ro>2015-07-15 11:05:07 +0200
commit874f858b8fbacfcd31cd64e21555f03927d4e15a (patch)
treebe5ad2fcfeb31136e7afca0603a3cd3da3d76b57 /tests/UtilsTest.php
parent5b0ebbc5de06b8a0e9679b78b45d0dc755db7986 (diff)
parentd1e2f8e52c931f84c11d4f54f32959710d528182 (diff)
downloadShaarli-874f858b8fbacfcd31cd64e21555f03927d4e15a.tar.gz
Shaarli-874f858b8fbacfcd31cd64e21555f03927d4e15a.tar.zst
Shaarli-874f858b8fbacfcd31cd64e21555f03927d4e15a.zip
Merge pull request #271 from virtualtam/php53
PHP: ensure 5.3 compatibility
Diffstat (limited to 'tests/UtilsTest.php')
-rw-r--r--tests/UtilsTest.php34
1 files changed, 33 insertions, 1 deletions
diff --git a/tests/UtilsTest.php b/tests/UtilsTest.php
index 8355c7f8..28e15f5a 100644
--- a/tests/UtilsTest.php
+++ b/tests/UtilsTest.php
@@ -109,7 +109,7 @@ class UtilsTest extends PHPUnit_Framework_TestCase
109 */ 109 */
110 public function testGenerateLocationLoop() { 110 public function testGenerateLocationLoop() {
111 $ref = 'http://localhost/?test'; 111 $ref = 'http://localhost/?test';
112 $this->assertEquals('?', generateLocation($ref, 'localhost', ['test'])); 112 $this->assertEquals('?', generateLocation($ref, 'localhost', array('test')));
113 } 113 }
114 114
115 /** 115 /**
@@ -119,4 +119,36 @@ class UtilsTest extends PHPUnit_Framework_TestCase
119 $ref = 'http://somewebsite.com/?test'; 119 $ref = 'http://somewebsite.com/?test';
120 $this->assertEquals('?', generateLocation($ref, 'localhost')); 120 $this->assertEquals('?', generateLocation($ref, 'localhost'));
121 } 121 }
122
123 /**
124 * Check supported PHP versions
125 */
126 public function testCheckSupportedPHPVersion()
127 {
128 $minVersion = '5.3';
129 checkPHPVersion($minVersion, '5.4.32');
130 checkPHPVersion($minVersion, '5.5');
131 checkPHPVersion($minVersion, '5.6.10');
132 }
133
134 /**
135 * Check a unsupported PHP version
136 * @expectedException Exception
137 * @expectedExceptionMessageRegExp /Your PHP version is obsolete/
138 */
139 public function testCheckSupportedPHPVersion51()
140 {
141 checkPHPVersion('5.3', '5.1.0');
142 }
143
144 /**
145 * Check another unsupported PHP version
146 * @expectedException Exception
147 * @expectedExceptionMessageRegExp /Your PHP version is obsolete/
148 */
149 public function testCheckSupportedPHPVersion52()
150 {
151 checkPHPVersion('5.3', '5.2');
152 }
122} 153}
154?>