4 * @author Adam Shorland
8 class DiffOpTest
extends MediaWikiTestCase
{
11 * @covers DiffOp::getType
13 public function testGetType() {
14 $obj = new FakeDiffOp();
16 $this->assertEquals( 'foo', $obj->getType() );
20 * @covers DiffOp::getOrig
22 public function testGetOrig() {
23 $obj = new FakeDiffOp();
24 $obj->orig
= array( 'foo' );
25 $this->assertEquals( array( 'foo' ), $obj->getOrig() );
29 * @covers DiffOp::getClosing
31 public function testGetClosing() {
32 $obj = new FakeDiffOp();
33 $obj->closing
= array( 'foo' );
34 $this->assertEquals( array( 'foo' ), $obj->getClosing() );
38 * @covers DiffOp::getClosing
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 ) );
50 * @covers DiffOp::norig
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() );
60 * @covers DiffOp::nclosing
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() );