Skip to content

Commit

Permalink
Add new tests for Helper::destroy and Helper::id(true).
Browse files Browse the repository at this point in the history
Downgrade phpunit on version 4.7 (in 4.8 is broken "@runInSeparateProcess").
  • Loading branch information
Zemistr committed Feb 26, 2017
1 parent 5d53314 commit 61c47b3
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"slim/slim": "^3.0"
},
"require-dev": {
"phpunit/phpunit": "^4.8"
"phpunit/phpunit": "4.7.*"
},
"autoload": {
"psr-4": {
Expand Down
24 changes: 22 additions & 2 deletions tests/HelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,17 +88,37 @@ public function testClear()
$this->assertEmpty($_SESSION);
}

/**
* @runInSeparateProcess
*/
public function testId()
{
$helper = new Helper();

$this->assertSame(session_id(), $helper::id());
$this->markTestIncomplete('Please implement check for "::id(true)"');
$this->assertNotSame(session_id(), $sessionId = $helper::id(true));
$this->assertSame(session_id(), $sessionId);
}

/**
* @runInSeparateProcess
*/
public function testDestroy()
{
$this->markTestIncomplete('Please implement check for "::destroy"');
$helper = new Helper();

$_SESSION = ['a' => 'A', 'b' => 'B', 'c' => 'C'];

$this->assertNotEmpty($helper::id());
$this->assertNotEmpty(session_id());
$this->assertNotEmpty($_SESSION);

$helper::destroy();

$this->assertEmpty(session_id());
$this->assertEmpty($_SESSION);

$this->markTestIncomplete('Please finish test for "::destroy".');
}

public function testCount()
Expand Down

0 comments on commit 61c47b3

Please sign in to comment.