diff options
Diffstat (limited to 'MLEB/LocalisationUpdate/tests/phpunit/UpdaterTest.php')
-rw-r--r-- | MLEB/LocalisationUpdate/tests/phpunit/UpdaterTest.php | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/MLEB/LocalisationUpdate/tests/phpunit/UpdaterTest.php b/MLEB/LocalisationUpdate/tests/phpunit/UpdaterTest.php index 466c4b2b..6b0c679f 100644 --- a/MLEB/LocalisationUpdate/tests/phpunit/UpdaterTest.php +++ b/MLEB/LocalisationUpdate/tests/phpunit/UpdaterTest.php @@ -48,24 +48,24 @@ class UpdaterTest extends \PHPUnit\Framework\TestCase { $input = [ 'file' => 'Hello World!' ]; $output = [ 'en' => [ 'key' => $input['file'] ] ]; - $reader = $this->createMock( 'LocalisationUpdate\Reader\Reader' ); + $reader = $this->createMock( \LocalisationUpdate\Reader\Reader::class ); $reader ->expects( $this->once() ) ->method( 'parse' ) - ->will( $this->returnValue( $output ) ); + ->willReturn( $output ); - $factory = $this->createMock( 'LocalisationUpdate\Reader\ReaderFactory' ); + $factory = $this->createMock( \LocalisationUpdate\Reader\ReaderFactory::class ); $factory ->expects( $this->once() ) ->method( 'getReader' ) - ->will( $this->returnValue( $reader ) ); + ->willReturn( $reader ); $observed = $updater->readMessages( $factory, $input ); $this->assertEquals( $output, $observed, 'Tries to parse given file' ); } public function testFindChangedTranslations() { - $updater = $updater = new Updater(); + $updater = new Updater(); $origin = [ 'A' => '1', @@ -73,14 +73,18 @@ class UpdaterTest extends \PHPUnit\Framework\TestCase { 'D' => '4', ]; $remote = [ - 'A' => '1', // No change key - 'B' => '2', // New key - 'C' => '33', // Changed key - 'D' => '44', // Blacklisted key + // No change key + 'A' => '1', + // New key + 'B' => '2', + // Changed key + 'C' => '33', + // Ignored key + 'D' => '44', ]; - $blacklist = [ 'D' => 0 ]; + $ignore = [ 'D' => 0 ]; $expected = [ 'B' => '2', 'C' => '33' ]; - $observed = $updater->findChangedTranslations( $origin, $remote, $blacklist ); + $observed = $updater->findChangedTranslations( $origin, $remote, $ignore ); $this->assertEquals( $expected, $observed, 'Changed and new keys returned' ); } } |