Conditions | 4 |
Paths | 6 |
Total Lines | 24 |
Code Lines | 17 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 8.7414 |
Changes | 0 |
1 | <?php |
||
23 | 2 | public static function startSession() |
|
24 | { |
||
25 | 2 | if (!isset($_SERVER[static::HEADER_SESSION_KEY])) { |
|
26 | 1 | return false; |
|
27 | } |
||
28 | |||
29 | 1 | if(!isset($_SERVER[static::HEADER_TEST_CASE_KEY])){ |
|
30 | 1 | return false; |
|
31 | } |
||
32 | |||
33 | $sessionName = $_SERVER[static::HEADER_SESSION_KEY]; |
||
34 | $session = new static($sessionName); |
||
35 | $testCaseName = $_SERVER[static::HEADER_TEST_CASE_KEY]; |
||
36 | $testCase = new TestCase($testCaseName); |
||
37 | |||
38 | try{ |
||
39 | $session->setTestCase($testCase); |
||
40 | $session->start(); |
||
41 | 1 | $session->save(); |
|
42 | 1 | return true; |
|
43 | }catch (\Exception $e){ |
||
44 | $session->addException($e); |
||
45 | $session->save(); |
||
46 | return false; |
||
47 | } |
||
50 |