File tree Expand file tree Collapse file tree 3 files changed +72
-0
lines changed
Expand file tree Collapse file tree 3 files changed +72
-0
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,30 @@ public function testApiDestructor_DoesNotThrowError()
3838 unset($ ex );
3939 }
4040
41+ /**
42+ *
43+ */
44+ public function testApiSetContext_SetsContext ()
45+ {
46+ $ ex = $ this ->createError ('Error ' );
47+
48+ $ ex ->setContext ($ context = [ 5 , 'ABC ' , new \StdClass ]);
49+
50+ $ this ->assertSame ($ context , $ this ->getProtectedProperty ($ ex , 'context ' ));
51+ }
52+
53+ /**
54+ *
55+ */
56+ public function testApiGetContext_GetsContext ()
57+ {
58+ $ ex = $ this ->createError ('Error ' );
59+
60+ $ ex ->setContext ($ context = [ 5 , 'ABC ' , new \StdClass ]);
61+
62+ $ this ->assertSame ($ context , $ ex ->getContext ());
63+ }
64+
4165 /**
4266 *
4367 */
Original file line number Diff line number Diff line change @@ -38,6 +38,30 @@ public function testApiDestructor_DoesNotThrowException()
3838 unset($ ex );
3939 }
4040
41+ /**
42+ *
43+ */
44+ public function testApiSetContext_SetsContext ()
45+ {
46+ $ ex = $ this ->createException ('Exception ' );
47+
48+ $ ex ->setContext ($ context = [ 5 , 'ABC ' , new \StdClass ]);
49+
50+ $ this ->assertSame ($ context , $ this ->getProtectedProperty ($ ex , 'context ' ));
51+ }
52+
53+ /**
54+ *
55+ */
56+ public function testApiGetContext_GetsContext ()
57+ {
58+ $ ex = $ this ->createException ('Exception ' );
59+
60+ $ ex ->setContext ($ context = [ 5 , 'ABC ' , new \StdClass ]);
61+
62+ $ this ->assertSame ($ context , $ ex ->getContext ());
63+ }
64+
4165 /**
4266 *
4367 */
Original file line number Diff line number Diff line change @@ -132,6 +132,30 @@ public function testApiDestructor_DoesNotThrowException()
132132 unset($ proxy );
133133 }
134134
135+ /**
136+ *
137+ */
138+ public function testApiSetContext_SetsContext ()
139+ {
140+ $ ex = $ this ->createThrowableProxy ('' );
141+
142+ $ ex ->setContext ($ context = [ 5 , 'ABC ' , new \StdClass ]);
143+
144+ $ this ->assertSame ($ context , $ this ->getProtectedProperty ($ ex , 'context ' ));
145+ }
146+
147+ /**
148+ *
149+ */
150+ public function testApiGetContext_GetsContext ()
151+ {
152+ $ ex = $ this ->createThrowableProxy ('' );
153+
154+ $ ex ->setContext ($ context = [ 5 , 'ABC ' , new \StdClass ]);
155+
156+ $ this ->assertSame ($ context , $ ex ->getContext ());
157+ }
158+
135159 /**
136160 *
137161 */
You can’t perform that action at this time.
0 commit comments