MediaWiki REL1_31
MetadataMergeExceptionTest.php
Go to the documentation of this file.
1<?php
2
3namespace MediaWiki\Session;
4
6
12
13 public function testBasics() {
14 $data = [ 'foo' => 'bar' ];
15
16 $ex = new MetadataMergeException();
17 $this->assertInstanceOf( \UnexpectedValueException::class, $ex );
18 $this->assertSame( [], $ex->getContext() );
19
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() );
25
26 $ex->setContext( $data );
27 $this->assertSame( $data, $ex->getContext() );
28 }
29
30}
Session MediaWiki\Session\MetadataMergeException.
Subclass of UnexpectedValueException that can be annotated with additional data for debug logging.