MediaWiki  REL1_24
DiffOpTest.php
Go to the documentation of this file.
00001 <?php
00002 
00003 //Load our FakeDiffOp
00004 require_once __DIR__ . DIRECTORY_SEPARATOR . 'FakeDiffOp.php';
00005 
00012 class DiffOpTest extends MediaWikiTestCase {
00013 
00017     public function testGetType() {
00018         $obj = new FakeDiffOp();
00019         $obj->type = 'foo';
00020         $this->assertEquals( 'foo', $obj->getType() );
00021     }
00022 
00026     public function testGetOrig() {
00027         $obj = new FakeDiffOp();
00028         $obj->orig = array( 'foo' );
00029         $this->assertEquals( array( 'foo' ), $obj->getOrig() );
00030     }
00031 
00035     public function testGetClosing() {
00036         $obj = new FakeDiffOp();
00037         $obj->closing = array( 'foo' );
00038         $this->assertEquals( array( 'foo' ), $obj->getClosing() );
00039     }
00040 
00044     public function testGetClosingWithParameter() {
00045         $obj = new FakeDiffOp();
00046         $obj->closing = array( 'foo', 'bar', 'baz' );
00047         $this->assertEquals( 'foo', $obj->getClosing( 0 ) );
00048         $this->assertEquals( 'bar', $obj->getClosing( 1 ) );
00049         $this->assertEquals( 'baz', $obj->getClosing( 2 ) );
00050         $this->assertEquals( null, $obj->getClosing( 3 ) );
00051     }
00052 
00056     public function testNorig() {
00057         $obj = new FakeDiffOp();
00058         $this->assertEquals( 0, $obj->norig() );
00059         $obj->orig = array( 'foo' );
00060         $this->assertEquals( 1, $obj->norig() );
00061     }
00062 
00066     public function testNclosing() {
00067         $obj = new FakeDiffOp();
00068         $this->assertEquals( 0, $obj->nclosing() );
00069         $obj->closing = array( 'foo' );
00070         $this->assertEquals( 1, $obj->nclosing() );
00071     }
00072 
00073 }