ApiGroupReviewTest.php

Go to the documentation of this file.
00001 <?php
00014 class ApiGroupReviewTest extends MediaWikiTestCase {
00015     protected function setUp() {
00016         parent::setUp();
00017 
00018         $this->setMwGlobals( array(
00019             'wgTranslateMessageIndex' => array( 'DatabaseMessageIndex' ),
00020             'wgTranslateWorkflowStates' => false,
00021             'wgTranslateTranslationServices' => array(),
00022         ) );
00023     }
00024 
00025     public function testGetSetState() {
00026         $group = new WikiMessageGroup( 'testgroup', 'wewgweg' );
00027 
00028         $ok = ApiGroupReview::changeState( $group, 'fi', 'newstate', FuzzyBot::getUser() );
00029         $this->assertTrue( $ok, 'state was changed' );
00030 
00031         $state = ApiGroupReview::getState( $group, 'fi' );
00032         $this->assertEquals( 'newstate', $state, 'state was changed to expected value' );
00033 
00034         $ok = ApiGroupReview::changeState( $group, 'fi', 'newstate', FuzzyBot::getUser() );
00035         $this->assertFalse( $ok, 'state was not changed again' );
00036     }
00037 }
Generated on Tue Oct 29 00:00:24 2013 for MediaWiki Translate Extension by  doxygen 1.6.3