Merge "Added release notes for 'ContentHandler::runLegacyHooks' removal"
[mediawiki.git] / tests / phpunit / includes / session / MetadataMergeExceptionTest.php
blob0981f026a1a2506f5784f9e25cfb6331bab8fb5f
1 <?php
3 namespace MediaWiki\Session;
5 use MediaWikiTestCase;
7 /**
8 * @group Session
9 * @covers MediaWiki\Session\MetadataMergeException
11 class MetadataMergeExceptionTest extends MediaWikiTestCase {
13 public function testBasics() {
14 $data = [ 'foo' => 'bar' ];
16 $ex = new MetadataMergeException();
17 $this->assertInstanceOf( 'UnexpectedValueException', $ex );
18 $this->assertSame( [], $ex->getContext() );
20 $ex2 = new MetadataMergeException( 'Message', 42, $ex, $data );
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() );