-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Unit tests load and subclass Session #353.
Unit tests to reproduce the problem raised in #353. In addition to testing load by libary or load by driver we are also extending by prefixed sub-class. Added new mack application folder. Added Session Subclass mock. Fix bootstrap to point APPPATH to the mock application folder. Including IC_Session class more than once in the same unit test requires runInSeparateProcess and preserveGlobalState disabled which also causes all knowledge of bootstrap to dissapear so we need to cater for that.
- Loading branch information
Showing
3 changed files
with
97 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
tests/mocks/application/libraries/Session/prefix_session.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
/** | ||
* Mock library testing extending Session | ||
* driver/library with prefixed subclass | ||
*/ | ||
class Prefix_Session extends CI_Session { | ||
/** | ||
* Simulate new page load | ||
*/ | ||
public function reload() | ||
{ | ||
$this->_flashdata_sweep(); | ||
$this->_flashdata_mark(); | ||
$this->_tempdata_sweep(); | ||
} | ||
} | ||
|