Skip to content

Commit 87d7e7b

Browse files
committed
Dropped support for PHP 5.6
1 parent 0d4b7e6 commit 87d7e7b

7 files changed

+63
-58
lines changed

.travis.yml

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
language: php
22

33
php:
4-
- '5.6'
54
- '7.0'
65
- '7.1'
76
- nightly

README.md

+2-4
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,11 @@ the UltimateSession library using recommended settings, with a few minimal
5454
configuration options.
5555

5656
Requires:
57-
- PHP 5.6+
5857
- PHP OpenSSL extension (if using encryption)
5958
- [defuse/php-encryption](https://github.com/defuse/php-encryption) library
60-
- PHPUnit 5.7+ (for unit tests only)
59+
- PHPUnit 6.1+ (for unit tests only)
6160

62-
This library is developed against PHP 7.1 and tested via Travis CI against:
63-
- PHP 5.6.*
61+
This library is tested via Travis CI against:
6462
- PHP 7.0.*
6563
- PHP 7.1.*
6664
- PHP Nightly build

composer.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@
1818
}
1919
],
2020
"require": {
21-
"php": ">=5.6",
21+
"php": ">=7.0",
2222
"defuse/php-encryption": "*",
2323
"psr/log": "*",
2424
"ext-openssl": "*"
2525
},
2626
"require-dev": {
27-
"phpunit/phpunit": ">=5.7",
27+
"phpunit/phpunit": ">=6.1",
2828
"phpunit/php-code-coverage": "*",
2929
"phpdocumentor/phpdocumentor": "*",
3030
"evert/phpdoc-md" : "~0.2.0",

composer.lock

+50-46
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/UltimateSessions/UltimateSessionHandlerTrait.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ public function decrypt($sessionId, $sessionData)
241241
{
242242
$key = $this->getEncryptionKey($sessionId);
243243
if(empty($sessionData)) {
244-
return '';
244+
return $sessionData;
245245
}
246246
return Crypto::decrypt($sessionData, $key);
247247
}

tests/UltimateSessionLibraryIntegrationTest.php

+1
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ public function testSessionPersistence(
135135
/**
136136
* Start and end session
137137
*/
138+
$this->assertEquals('', session_id());
138139
$manager->startSession();
139140
$_SESSION['test'] = true;
140141
$sessionId = $manager->getSessionId();

tests/UltimateSessionLoaderTest.php

+7-4
Original file line numberDiff line numberDiff line change
@@ -46,20 +46,23 @@ public function notBooleanProvider()
4646
* @runInSeparateProcess
4747
* @preserveGlobalState disabled
4848
* @dataProvider useEncryptionProvider
49-
* @covers \MikeBrant\UltimateSessions\UltimateSessionLoader::initialize()
49+
* @covers \MikeBrant\UltimateSessions\UltimateSessionLoader
5050
* @outputBuffering disabled
5151
*
5252
* @param boolean $useEncryption
5353
*/
54-
public function testInitialize($useEncryption)
54+
public function testInitializeAndRegenerateID($useEncryption)
5555
{
5656
$manager = UltimateSessionLoader::initialize($useEncryption);
5757
$this->assertInstanceOf(
5858
UltimateSessionManager::class,
5959
$manager
6060
);
6161
$manager->startSession();
62-
$this->assertNotEmpty($manager->getSessionId());
62+
$sessionId = $manager->getSessionId();
63+
$this->assertNotEmpty($sessionId);
64+
$manager->regenerateId();
65+
$this->assertNotEquals($sessionId, $manager->getSessionId());
6366
}
6467

6568
/**
@@ -68,7 +71,7 @@ public function testInitialize($useEncryption)
6871
* @runInSeparateProcess
6972
* @preserveGlobalState disabled
7073
* @dataProvider notBooleanProvider
71-
* @covers \MikeBrant\UltimateSessions\UltimateSessionLoader::initialize()
74+
* @covers \MikeBrant\UltimateSessions\UltimateSessionLoader
7275
* @outputBuffering disabled
7376
* @expectedException \InvalidArgumentException
7477
*

0 commit comments

Comments
 (0)