MediaWiki REL1_31
DiffOpTest.php
Go to the documentation of this file.
1<?php
8
12 public function testGetType() {
13 $obj = new FakeDiffOp();
14 $obj->type = 'foo';
15 $this->assertEquals( 'foo', $obj->getType() );
16 }
17
21 public function testGetOrig() {
22 $obj = new FakeDiffOp();
23 $obj->orig = [ 'foo' ];
24 $this->assertEquals( [ 'foo' ], $obj->getOrig() );
25 }
26
30 public function testGetClosing() {
31 $obj = new FakeDiffOp();
32 $obj->closing = [ 'foo' ];
33 $this->assertEquals( [ 'foo' ], $obj->getClosing() );
34 }
35
39 public function testGetClosingWithParameter() {
40 $obj = new FakeDiffOp();
41 $obj->closing = [ 'foo', 'bar', 'baz' ];
42 $this->assertEquals( 'foo', $obj->getClosing( 0 ) );
43 $this->assertEquals( 'bar', $obj->getClosing( 1 ) );
44 $this->assertEquals( 'baz', $obj->getClosing( 2 ) );
45 $this->assertEquals( null, $obj->getClosing( 3 ) );
46 }
47
51 public function testNorig() {
52 $obj = new FakeDiffOp();
53 $this->assertEquals( 0, $obj->norig() );
54 $obj->orig = [ 'foo' ];
55 $this->assertEquals( 1, $obj->norig() );
56 }
57
61 public function testNclosing() {
62 $obj = new FakeDiffOp();
63 $this->assertEquals( 0, $obj->nclosing() );
64 $obj->closing = [ 'foo' ];
65 $this->assertEquals( 1, $obj->nclosing() );
66 }
67
68}
testGetType()
DiffOp::getType.
testNclosing()
DiffOp::nclosing.
testGetOrig()
DiffOp::getOrig.
testNorig()
DiffOp::norig.
testGetClosing()
DiffOp::getClosing.
testGetClosingWithParameter()
DiffOp::getClosing.
Class FakeDiffOp used to test abstract class DiffOp.
Definition FakeDiffOp.php:6