@@ -15,7 +15,7 @@ class ThrowableTest extends TUnit
1515 public function testStaticApiParseThrowableMessage_ParsesThrowableMessage_ForError ()
1616 {
1717 $ prev = $ this ->createError ('Previous ' );
18- $ ex = $ this ->createError ($ message = 'Exception ' , $ prev );
18+ $ ex = $ this ->createError ($ message = 'Exception ' , 0 , $ prev );
1919 $ stack = Throwable::getThrowableStack ($ ex );
2020 $ base = $ this ->callProtectedMethod (Throwable::class, 'getBasename ' , [ get_class ($ ex ) ]);
2121
@@ -28,7 +28,7 @@ public function testStaticApiParseThrowableMessage_ParsesThrowableMessage_ForErr
2828 public function testStaticApiParseThrowableMessage_ParsesThrowableMessage_ForException ()
2929 {
3030 $ prev = $ this ->createException ('Previous ' );
31- $ ex = $ this ->createException ($ message = 'Exception ' , $ prev );
31+ $ ex = $ this ->createException ($ message = 'Exception ' , 0 , $ prev );
3232 $ stack = Throwable::getThrowableStack ($ ex );
3333 $ base = $ this ->callProtectedMethod (Throwable::class, 'getBasename ' , [ get_class ($ ex ) ]);
3434
@@ -41,7 +41,7 @@ public function testStaticApiParseThrowableMessage_ParsesThrowableMessage_ForExc
4141 public function testStaticApiGetThrowableStack_ReturnsStack_ForError ()
4242 {
4343 $ prev = $ this ->createError ('Previous ' );
44- $ ex = $ this ->createError ($ message = 'Exception ' , $ prev );
44+ $ ex = $ this ->createError ($ message = 'Exception ' , 0 , $ prev );
4545
4646 $ stack = Throwable::getThrowableStack ($ ex );
4747 $ this ->assertData ($ stack );
@@ -54,7 +54,7 @@ public function testStaticApiGetThrowableStack_ReturnsStack_ForError()
5454 public function testStaticApiGetThrowableStack_ReturnsStack_ForException ()
5555 {
5656 $ prev = $ this ->createException ('Previous ' );
57- $ ex = $ this ->createException ($ message = 'Exception ' , $ prev );
57+ $ ex = $ this ->createException ($ message = 'Exception ' , 0 , $ prev );
5858
5959 $ stack = Throwable::getThrowableStack ($ ex );
6060 $ this ->assertData ($ stack );
@@ -67,7 +67,7 @@ public function testStaticApiGetThrowableStack_ReturnsStack_ForException()
6767 public function testStaticApiGetThrowableData_ReturnsData_ForError ()
6868 {
6969 $ prev = $ this ->createError ('Previous ' );
70- $ ex = $ this ->createError ($ message = 'Exception ' , $ prev );
70+ $ ex = $ this ->createError ($ message = 'Exception ' , 0 , $ prev );
7171
7272 $ data = Throwable::getThrowableData ($ ex );
7373 $ this ->assertData ($ data );
@@ -79,7 +79,7 @@ public function testStaticApiGetThrowableData_ReturnsData_ForError()
7979 public function testStaticApiGetThrowableData_ReturnsData_ForException ()
8080 {
8181 $ prev = $ this ->createException ('Previous ' );
82- $ ex = $ this ->createException ($ message = 'Exception ' , $ prev );
82+ $ ex = $ this ->createException ($ message = 'Exception ' , 0 , $ prev );
8383
8484 $ data = Throwable::getThrowableData ($ ex );
8585 $ this ->assertData ($ data );
@@ -91,7 +91,7 @@ public function testStaticApiGetThrowableData_ReturnsData_ForException()
9191 public function testStaticApiGetTraceElements_ReturnsTraceElements_ForError ()
9292 {
9393 $ prev = $ this ->createError ('Previous ' );
94- $ ex = $ this ->createError ('Exception ' , $ prev );
94+ $ ex = $ this ->createError ('Exception ' , 0 , $ prev );
9595
9696 $ elements = $ this ->callProtectedMethod (Throwable::class, 'getTraceElements ' , [ $ ex ]);
9797 $ this ->assertTrace ($ elements );
@@ -103,7 +103,7 @@ public function testStaticApiGetTraceElements_ReturnsTraceElements_ForError()
103103 public function testStaticApiGetTraceElements_ReturnsTraceElements_ForException ()
104104 {
105105 $ prev = $ this ->createException ('Previous ' );
106- $ ex = $ this ->createException ('Exception ' , $ prev );
106+ $ ex = $ this ->createException ('Exception ' , 0 , $ prev );
107107
108108 $ elements = $ this ->callProtectedMethod (Throwable::class, 'getTraceElements ' , [ $ ex ]);
109109 $ this ->assertTrace ($ elements );
@@ -176,22 +176,24 @@ public function testStaticApiGetBasename_ReturnsThrowableBasename_ForException()
176176
177177 /**
178178 * @param string $message
179+ * @param int $code
179180 * @param \Error|\Exception|null $prev
180181 * @return Exception
181182 */
182- public function createException ($ message , $ prev = null )
183+ public function createException ($ message , $ code = 0 , $ prev = null )
183184 {
184- return new Exception ($ message , $ prev );
185+ return new Exception ($ message , $ code , $ prev );
185186 }
186187
187188 /**
188189 * @param string $message
190+ * @param int $code
189191 * @param \Error|\Exception|null $prev
190192 * @return Error
191193 */
192- public function createError ($ message , $ prev = null )
194+ public function createError ($ message , $ code = 0 , $ prev = null )
193195 {
194- return new Error ($ message , $ prev );
196+ return new Error ($ message , $ code , $ prev );
195197 }
196198
197199 /**
0 commit comments