| @@ 104-120 (lines=17) @@ | ||
| 101 | return array_merge($defaultArray, $includeArray); |
|
| 102 | } |
|
| 103 | ||
| 104 | public function getTestRunId() |
|
| 105 | { |
|
| 106 | if (!self::$testRunId) { |
|
| 107 | // See https://github.com/ircmaxell/RandomLib/issues/55 |
|
| 108 | if (function_exists('random_bytes')) { |
|
| 109 | $unique = uniqid(substr(bin2hex(random_bytes(64)), 0, 64)); |
|
| 110 | ||
| 111 | } else if (function_exists('openssl_random_pseudo_bytes')) { |
|
| 112 | $unique = uniqid(openssl_random_pseudo_bytes(64)); |
|
| 113 | } else { |
|
| 114 | $unique = uniqid('', true); |
|
| 115 | } |
|
| 116 | self::$testRunId = $unique; |
|
| 117 | } |
|
| 118 | ||
| 119 | return self::$testRunId; |
|
| 120 | } |
|
| 121 | ||
| 122 | public function addWarning(Test $test, Warning $e, $time) |
|
| 123 | { |
|
| @@ 99-115 (lines=17) @@ | ||
| 96 | return array_merge($defaultArray, $includeArray); |
|
| 97 | } |
|
| 98 | ||
| 99 | public function getTestRunId() |
|
| 100 | { |
|
| 101 | if (!self::$testRunId) { |
|
| 102 | // See https://github.com/ircmaxell/RandomLib/issues/55 |
|
| 103 | if (function_exists('random_bytes')) { |
|
| 104 | $unique = uniqid(substr(bin2hex(random_bytes(64)), 0, 64)); |
|
| 105 | ||
| 106 | } else if (function_exists('openssl_random_pseudo_bytes')) { |
|
| 107 | $unique = uniqid(openssl_random_pseudo_bytes(64)); |
|
| 108 | } else { |
|
| 109 | $unique = uniqid('', true); |
|
| 110 | } |
|
| 111 | self::$testRunId = $unique; |
|
| 112 | } |
|
| 113 | ||
| 114 | return self::$testRunId; |
|
| 115 | } |
|
| 116 | ||
| 117 | ||
| 118 | public function addError(\PHPUnit_Framework_Test $test, \Exception $e, $time) |
|