diff options
| author | 2023-04-17 08:30:21 +0200 | |
|---|---|---|
| committer | 2023-04-17 08:30:21 +0200 | |
| commit | f3760f138dcbaf7a2190336a0378cf1b2190c9f5 (patch) | |
| tree | 6fac8fbf9efd7aa74a8e3970ab70ccf85287b2cd /tests/cli/i18n/I18nCompletionValidatorTest.php | |
| parent | 41fa4e746df8c2e2399ed753b4994ca85cb21358 (diff) | |
Complete PHPStan Level 6 (#5305)
* Complete PHPStan Level 6
Fix https://github.com/FreshRSS/FreshRSS/issues/4112
And initiate PHPStan Level 7
* PHPStan Level 6 for tests
* Use phpstan/phpstan-phpunit
* Update to PHPStan version 1.10
* Fix mixed bug
* Fix mixed return bug
* Fix paginator bug
* Fix FreshRSS_UserConfiguration
* A couple more Minz_Configuration bug fixes
* A few trivial PHPStan Level 7 fixes
* A few more simple PHPStan Level 7
* More files passing PHPStan Level 7
Add interface to replace removed class from https://github.com/FreshRSS/FreshRSS/pull/5251
* A few more PHPStan Level 7 preparations
* A few last details
Diffstat (limited to 'tests/cli/i18n/I18nCompletionValidatorTest.php')
| -rw-r--r-- | tests/cli/i18n/I18nCompletionValidatorTest.php | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/tests/cli/i18n/I18nCompletionValidatorTest.php b/tests/cli/i18n/I18nCompletionValidatorTest.php index 1aa871f20..1a361823d 100644 --- a/tests/cli/i18n/I18nCompletionValidatorTest.php +++ b/tests/cli/i18n/I18nCompletionValidatorTest.php @@ -4,6 +4,7 @@ require_once __DIR__ . '/../../../cli/i18n/I18nCompletionValidator.php'; require_once __DIR__ . '/../../../cli/i18n/I18nValue.php'; class I18nCompletionValidatorTest extends PHPUnit\Framework\TestCase { + /** @var I18nValue&PHPUnit\Framework\MockObject\MockObject */ private $value; public function setUp(): void { @@ -12,7 +13,7 @@ class I18nCompletionValidatorTest extends PHPUnit\Framework\TestCase { ->getMock(); } - public function testDisplayReport() { + public function testDisplayReport(): void { $validator = new I18nCompletionValidator([], []); $this->assertEquals("There is no data.\n", $validator->displayReport()); @@ -40,13 +41,13 @@ class I18nCompletionValidatorTest extends PHPUnit\Framework\TestCase { $validator->displayReport(); } - public function testValidateWhenNoData() { + public function testValidateWhenNoData(): void { $validator = new I18nCompletionValidator([], []); $this->assertTrue($validator->validate()); $this->assertEquals('', $validator->displayResult()); } - public function testValidateWhenKeyIsMissing() { + public function testValidateWhenKeyIsMissing(): void { $validator = new I18nCompletionValidator([ 'file1.php' => [ 'file1.l1.l2.k1' => $this->value, @@ -60,7 +61,7 @@ class I18nCompletionValidatorTest extends PHPUnit\Framework\TestCase { $this->assertEquals("Missing key file1.l1.l2.k1\nMissing key file2.l1.l2.k1\n", $validator->displayResult()); } - public function testValidateWhenKeyIsIgnored() { + public function testValidateWhenKeyIsIgnored(): void { $this->value->expects($this->exactly(2)) ->method('isIgnore') ->willReturn(true); @@ -85,7 +86,7 @@ class I18nCompletionValidatorTest extends PHPUnit\Framework\TestCase { $this->assertEquals('', $validator->displayResult()); } - public function testValidateWhenValueIsEqual() { + public function testValidateWhenValueIsEqual(): void { $this->value->expects($this->exactly(2)) ->method('isIgnore') ->willReturn(false); @@ -113,7 +114,7 @@ class I18nCompletionValidatorTest extends PHPUnit\Framework\TestCase { $this->assertEquals("Untranslated key file1.l1.l2.k1 - \nUntranslated key file2.l1.l2.k1 - \n", $validator->displayResult()); } - public function testValidateWhenValueIsDifferent() { + public function testValidateWhenValueIsDifferent(): void { $this->value->expects($this->exactly(2)) ->method('isIgnore') ->willReturn(false); |
