Merge "FormatMetadata::fetchExtendedMetadata: Ignore multiple EXIF/XMP values"
[lhc/web/wiklou.git] / tests / phpunit / includes / diff / DiffOpTest.php
1 <?php
2 /**
3 * @licence GNU GPL v2+
4 * @author Adam Shorland
5 *
6 * @group Diff
7 */
8 class DiffOpTest extends MediaWikiTestCase {
9
10 /**
11 * @covers DiffOp::getType
12 */
13 public function testGetType() {
14 $obj = new FakeDiffOp();
15 $obj->type = 'foo';
16 $this->assertEquals( 'foo', $obj->getType() );
17 }
18
19 /**
20 * @covers DiffOp::getOrig
21 */
22 public function testGetOrig() {
23 $obj = new FakeDiffOp();
24 $obj->orig = array( 'foo' );
25 $this->assertEquals( array( 'foo' ), $obj->getOrig() );
26 }
27
28 /**
29 * @covers DiffOp::getClosing
30 */
31 public function testGetClosing() {
32 $obj = new FakeDiffOp();
33 $obj->closing = array( 'foo' );
34 $this->assertEquals( array( 'foo' ), $obj->getClosing() );
35 }
36
37 /**
38 * @covers DiffOp::getClosing
39 */
40 public function testGetClosingWithParameter() {
41 $obj = new FakeDiffOp();
42 $obj->closing = array( 'foo', 'bar', 'baz' );
43 $this->assertEquals( 'foo', $obj->getClosing( 0 ) );
44 $this->assertEquals( 'bar', $obj->getClosing( 1 ) );
45 $this->assertEquals( 'baz', $obj->getClosing( 2 ) );
46 $this->assertEquals( null, $obj->getClosing( 3 ) );
47 }
48
49 /**
50 * @covers DiffOp::norig
51 */
52 public function testNorig() {
53 $obj = new FakeDiffOp();
54 $this->assertEquals( 0, $obj->norig() );
55 $obj->orig = array( 'foo' );
56 $this->assertEquals( 1, $obj->norig() );
57 }
58
59 /**
60 * @covers DiffOp::nclosing
61 */
62 public function testNclosing() {
63 $obj = new FakeDiffOp();
64 $this->assertEquals( 0, $obj->nclosing() );
65 $obj->closing = array( 'foo' );
66 $this->assertEquals( 1, $obj->nclosing() );
67 }
68
69 }