aboutsummaryrefslogtreecommitdiff
path: root/tests/cli/i18n/I18nCompletionValidatorTest.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2023-05-11 13:02:04 +0200
committerGravatar GitHub <noreply@github.com> 2023-05-11 13:02:04 +0200
commit6e2f2f1c1e98ecd86aa89c6547beb742d7385d18 (patch)
tree7ba9f5aebb01d12045b9067a86b5060ba13dca18 /tests/cli/i18n/I18nCompletionValidatorTest.php
parentfe7d9bbcd68660a59b813346c236b61b25a51c80 (diff)
A few additional PHPStan rules (#5388)
A subset of https://github.com/phpstan/phpstan-strict-rules
Diffstat (limited to 'tests/cli/i18n/I18nCompletionValidatorTest.php')
-rw-r--r--tests/cli/i18n/I18nCompletionValidatorTest.php38
1 files changed, 19 insertions, 19 deletions
diff --git a/tests/cli/i18n/I18nCompletionValidatorTest.php b/tests/cli/i18n/I18nCompletionValidatorTest.php
index 1a361823d..3c6fc99eb 100644
--- a/tests/cli/i18n/I18nCompletionValidatorTest.php
+++ b/tests/cli/i18n/I18nCompletionValidatorTest.php
@@ -16,23 +16,23 @@ class I18nCompletionValidatorTest extends PHPUnit\Framework\TestCase {
public function testDisplayReport(): void {
$validator = new I18nCompletionValidator([], []);
- $this->assertEquals("There is no data.\n", $validator->displayReport());
+ self::assertEquals("There is no data.\n", $validator->displayReport());
$reflectionTotalEntries = new ReflectionProperty(I18nCompletionValidator::class, 'totalEntries');
$reflectionTotalEntries->setAccessible(true);
$reflectionTotalEntries->setValue($validator, 100);
- $this->assertEquals("Translation is 0.0% complete.\n", $validator->displayReport());
+ self::assertEquals("Translation is 0.0% complete.\n", $validator->displayReport());
$reflectionPassEntries = new ReflectionProperty(I18nCompletionValidator::class, 'passEntries');
$reflectionPassEntries->setAccessible(true);
$reflectionPassEntries->setValue($validator, 25);
- $this->assertEquals("Translation is 25.0% complete.\n", $validator->displayReport());
+ self::assertEquals("Translation is 25.0% complete.\n", $validator->displayReport());
$reflectionPassEntries->setValue($validator, 100);
- $this->assertEquals("Translation is 100.0% complete.\n", $validator->displayReport());
+ self::assertEquals("Translation is 100.0% complete.\n", $validator->displayReport());
$reflectionPassEntries->setValue($validator, 200);
@@ -43,8 +43,8 @@ class I18nCompletionValidatorTest extends PHPUnit\Framework\TestCase {
public function testValidateWhenNoData(): void {
$validator = new I18nCompletionValidator([], []);
- $this->assertTrue($validator->validate());
- $this->assertEquals('', $validator->displayResult());
+ self::assertTrue($validator->validate());
+ self::assertEquals('', $validator->displayResult());
}
public function testValidateWhenKeyIsMissing(): void {
@@ -57,12 +57,12 @@ class I18nCompletionValidatorTest extends PHPUnit\Framework\TestCase {
],
], []);
- $this->assertFalse($validator->validate());
- $this->assertEquals("Missing key file1.l1.l2.k1\nMissing key file2.l1.l2.k1\n", $validator->displayResult());
+ self::assertFalse($validator->validate());
+ self::assertEquals("Missing key file1.l1.l2.k1\nMissing key file2.l1.l2.k1\n", $validator->displayResult());
}
public function testValidateWhenKeyIsIgnored(): void {
- $this->value->expects($this->exactly(2))
+ $this->value->expects(self::exactly(2))
->method('isIgnore')
->willReturn(true);
@@ -82,15 +82,15 @@ class I18nCompletionValidatorTest extends PHPUnit\Framework\TestCase {
],
]);
- $this->assertTrue($validator->validate());
- $this->assertEquals('', $validator->displayResult());
+ self::assertTrue($validator->validate());
+ self::assertEquals('', $validator->displayResult());
}
public function testValidateWhenValueIsEqual(): void {
- $this->value->expects($this->exactly(2))
+ $this->value->expects(self::exactly(2))
->method('isIgnore')
->willReturn(false);
- $this->value->expects($this->exactly(2))
+ $this->value->expects(self::exactly(2))
->method('equal')
->willReturn(true);
@@ -110,15 +110,15 @@ class I18nCompletionValidatorTest extends PHPUnit\Framework\TestCase {
],
]);
- $this->assertFalse($validator->validate());
- $this->assertEquals("Untranslated key file1.l1.l2.k1 - \nUntranslated key file2.l1.l2.k1 - \n", $validator->displayResult());
+ self::assertFalse($validator->validate());
+ self::assertEquals("Untranslated key file1.l1.l2.k1 - \nUntranslated key file2.l1.l2.k1 - \n", $validator->displayResult());
}
public function testValidateWhenValueIsDifferent(): void {
- $this->value->expects($this->exactly(2))
+ $this->value->expects(self::exactly(2))
->method('isIgnore')
->willReturn(false);
- $this->value->expects($this->exactly(2))
+ $this->value->expects(self::exactly(2))
->method('equal')
->willReturn(false);
@@ -138,7 +138,7 @@ class I18nCompletionValidatorTest extends PHPUnit\Framework\TestCase {
],
]);
- $this->assertTrue($validator->validate());
- $this->assertEquals('', $validator->displayResult());
+ self::assertTrue($validator->validate());
+ self::assertEquals('', $validator->displayResult());
}
}