summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Evans <grknight@gentoo.org>2021-07-19 15:20:22 -0400
committerBrian Evans <grknight@gentoo.org>2021-07-19 15:20:22 -0400
commit9f092345e6bbecfde8c19e6d1490a6031a35f61f (patch)
tree2abb2398cd0df686e8608e15097ddc58b8995615 /MLEB/LocalisationUpdate/tests/phpunit/UpdaterTest.php
parentOAuth: Update for fixes and security (diff)
downloadextensions-9f092345e6bbecfde8c19e6d1490a6031a35f61f.tar.gz
extensions-9f092345e6bbecfde8c19e6d1490a6031a35f61f.tar.bz2
extensions-9f092345e6bbecfde8c19e6d1490a6031a35f61f.zip
Update to MLEB 2021.06
Signed-off-by: Brian Evans <grknight@gentoo.org>
Diffstat (limited to 'MLEB/LocalisationUpdate/tests/phpunit/UpdaterTest.php')
-rw-r--r--MLEB/LocalisationUpdate/tests/phpunit/UpdaterTest.php26
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' );
}
}