diff options
Diffstat (limited to 'MLEB/Translate/tests/phpunit/ffs/GettextFFSTest.php')
-rw-r--r-- | MLEB/Translate/tests/phpunit/ffs/GettextFFSTest.php | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/MLEB/Translate/tests/phpunit/ffs/GettextFFSTest.php b/MLEB/Translate/tests/phpunit/ffs/GettextFFSTest.php index e471ceb9..291164ba 100644 --- a/MLEB/Translate/tests/phpunit/ffs/GettextFFSTest.php +++ b/MLEB/Translate/tests/phpunit/ffs/GettextFFSTest.php @@ -11,21 +11,21 @@ /** * @see GettextFFS */ -class GettextFFSTest extends MediaWikiTestCase { +class GettextFFSTest extends MediaWikiIntegrationTestCase { protected $groupConfiguration; - public function setUp() { + public function setUp() : void { parent::setUp(); $this->groupConfiguration = [ 'BASIC' => [ - 'class' => 'FileBasedMessageGroup', + 'class' => FileBasedMessageGroup::class, 'id' => 'test-id', 'label' => 'Test Label', 'namespace' => 'NS_MEDIAWIKI', 'description' => 'Test description', ], 'FILES' => [ - 'class' => 'GettextFFS', + 'class' => GettextFFS::class, 'sourcePattern' => __DIR__ . '/../data/gettext.po', ], ]; @@ -253,4 +253,19 @@ GETTEXT return $cases; } + + public function testIsContentEqual() { + $group = MessageGroupBase::factory( $this->groupConfiguration ); + $ffs = new GettextFFS( $group ); + + $this->assertTrue( $ffs->isContentEqual( 'Foo bar', 'Foo bar' ) ); + $this->assertTrue( $ffs->isContentEqual( + 'The bunnies stole {{PLURAL:GETTEXT|one carrot|%{count} carrots}}.', + '{{PLURAL:GETTEXT|The bunnies stole one carrot.|The bunnies stole %{count} carrots.}}' ) ); + + $this->assertFalse( $ffs->isContentEqual( 'Foo bar', 'Foo baz' ) ); + $this->assertFalse( $ffs->isContentEqual( + 'The bunnies stole {{PLURAL:GETTEXT|one banana|%{count} carrots}}.', + '{{PLURAL:GETTEXT|The bunnies stole one carrot.|The bunnies stole %{count} carrots.}}' ) ); + } } |