14 $data = [
'foo' =>
'bar' ];
17 $this->assertInstanceOf( \UnexpectedValueException::class, $ex );
18 $this->assertSame( [], $ex->getContext() );
21 $this->assertSame(
'Message', $ex2->getMessage() );
22 $this->assertSame( 42, $ex2->getCode() );
23 $this->assertSame( $ex, $ex2->getPrevious() );
24 $this->assertSame( $data, $ex2->getContext() );
26 $ex->setContext( $data );
27 $this->assertSame( $data, $ex->getContext() );