diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 02684c5..397cd8e 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -8,6 +8,7 @@ 'logical_operators' => true, 'modernize_types_casting' => true, 'nullable_type_declaration_for_default_null_value' => true, + 'php_unit_test_case_static_method_calls' => true, 'single_quote' => true, 'trailing_comma_in_multiline' => ['after_heredoc' => true, 'elements' => ['arguments', 'array_destructuring', 'arrays']], ]) @@ -15,8 +16,9 @@ PhpCsFixer\Finder::create() ->in([ __DIR__ . '/src', + __DIR__ . '/tests', ]) ->name('*.php') ->ignoreDotFiles(true) - ->ignoreVCS(true) - ); \ No newline at end of file + ->ignoreVCS(true), + ); diff --git a/tests/unit/Copy/AbstractCopyPluginTest.php b/tests/unit/Copy/AbstractCopyPluginTest.php index d817089..878b998 100644 --- a/tests/unit/Copy/AbstractCopyPluginTest.php +++ b/tests/unit/Copy/AbstractCopyPluginTest.php @@ -35,6 +35,6 @@ public function setUp(): void */ public function testGetFileSystem(): void { - $this->assertInstanceOf(Filesystem::class, $this->subject->getFileSystem()); + static::assertInstanceOf(Filesystem::class, $this->subject->getFileSystem()); } } diff --git a/tests/unit/Copy/Plugins/ChartJsTest.php b/tests/unit/Copy/Plugins/ChartJsTest.php index a64e5cb..f37ad4d 100644 --- a/tests/unit/Copy/Plugins/ChartJsTest.php +++ b/tests/unit/Copy/Plugins/ChartJsTest.php @@ -35,7 +35,7 @@ public function setUp(): void */ public function testGetUnpkgName(): void { - $this->assertSame('chart.js', $this->subject->getUnpkgName()); + static::assertSame('chart.js', $this->subject->getUnpkgName()); } /** @@ -45,9 +45,9 @@ public function testGetUnpkgName(): void public function testGetUnpkgVersion(): void { try { - $this->assertIsString($this->subject->getUnpkgVersion()); + static::assertIsString($this->subject->getUnpkgVersion()); } catch (OutOfBoundsException $exception) { - $this->assertSame('Package "nnnick/chartjs" is not installed', $exception->getMessage()); + static::assertSame('Package "nnnick/chartjs" is not installed', $exception->getMessage()); } } @@ -56,7 +56,7 @@ public function testGetUnpkgVersion(): void */ public function testGetUnpkgSource(): void { - $this->assertSame('dist', $this->subject->getUnpkgSource()); + static::assertSame('dist', $this->subject->getUnpkgSource()); } @@ -71,7 +71,7 @@ public function testGetUnpkgFiles(): void 2 => 'helpers.js', 3 => 'helpers.js.map', ]; - $this->assertSame($result, $this->subject->getUnpkgFiles()); + static::assertSame($result, $this->subject->getUnpkgFiles()); } /** @@ -79,7 +79,7 @@ public function testGetUnpkgFiles(): void */ public function testGetComposerName(): void { - $this->assertSame('nnnick/chartjs', $this->subject->getComposerName()); + static::assertSame('nnnick/chartjs', $this->subject->getComposerName()); } /** @@ -87,7 +87,7 @@ public function testGetComposerName(): void */ public function testGetComposerSource(): void { - $this->assertSame('dist', $this->subject->getComposerSource()); + static::assertSame('dist', $this->subject->getComposerSource()); } /** @@ -95,7 +95,7 @@ public function testGetComposerSource(): void */ public function testGetComposerFiles(): void { - $this->assertSame(['*.js', '*.map'], $this->subject->getComposerFiles()); + static::assertSame(['*.js', '*.map'], $this->subject->getComposerFiles()); } /** @@ -103,6 +103,6 @@ public function testGetComposerFiles(): void */ public function testGetCopyTarget(): void { - $this->assertSame('js/lib/chartjs', $this->subject->getCopyTarget()); + static::assertSame('js/lib/chartjs', $this->subject->getCopyTarget()); } } diff --git a/tests/unit/Copy/Plugins/FlatpickrTest.php b/tests/unit/Copy/Plugins/FlatpickrTest.php index d34c5d8..a900916 100644 --- a/tests/unit/Copy/Plugins/FlatpickrTest.php +++ b/tests/unit/Copy/Plugins/FlatpickrTest.php @@ -35,7 +35,7 @@ public function setUp(): void */ public function testGetUnpkgName(): void { - $this->assertSame('flatpickr', $this->subject->getUnpkgName()); + static::assertSame('flatpickr', $this->subject->getUnpkgName()); } /** @@ -44,9 +44,9 @@ public function testGetUnpkgName(): void public function testGetUnpkgVersion(): void { try { - $this->assertIsString($this->subject->getUnpkgVersion()); + static::assertIsString($this->subject->getUnpkgVersion()); } catch (OutOfBoundsException $exception) { - $this->assertSame('Package "nnnick/chartjs" is not installed', $exception->getMessage()); + static::assertSame('Package "nnnick/chartjs" is not installed', $exception->getMessage()); } } @@ -55,7 +55,7 @@ public function testGetUnpkgVersion(): void */ public function testGetUnpkgSource(): void { - $this->assertSame('dist', $this->subject->getUnpkgSource()); + static::assertSame('dist', $this->subject->getUnpkgSource()); } /** @@ -67,7 +67,7 @@ public function testGetUnpkgFiles(): void 0 => 'flatpickr.min.css', 1 => 'flatpickr.min.js', ]; - $this->assertSame($result, $this->subject->getUnpkgFiles()); + static::assertSame($result, $this->subject->getUnpkgFiles()); } /** @@ -75,6 +75,6 @@ public function testGetUnpkgFiles(): void */ public function testGetCopyTarget(): void { - $this->assertSame('js/lib/flatpickr', $this->subject->getCopyTarget()); + static::assertSame('js/lib/flatpickr', $this->subject->getCopyTarget()); } } diff --git a/tests/unit/Copy/Plugins/FlowJsTest.php b/tests/unit/Copy/Plugins/FlowJsTest.php index 6dc1157..3b537c6 100644 --- a/tests/unit/Copy/Plugins/FlowJsTest.php +++ b/tests/unit/Copy/Plugins/FlowJsTest.php @@ -34,7 +34,7 @@ public function setUp(): void */ public function testGetComposerName(): void { - $this->assertSame('flowjs/flowjs', $this->subject->getComposerName()); + static::assertSame('flowjs/flowjs', $this->subject->getComposerName()); } /** @@ -42,7 +42,7 @@ public function testGetComposerName(): void */ public function testGetComposerSource(): void { - $this->assertSame('dist', $this->subject->getComposerSource()); + static::assertSame('dist', $this->subject->getComposerSource()); } /** @@ -50,7 +50,7 @@ public function testGetComposerSource(): void */ public function testGetComposerFiles(): void { - $this->assertSame(['*.js'], $this->subject->getComposerFiles()); + static::assertSame(['*.js'], $this->subject->getComposerFiles()); } /** @@ -58,6 +58,6 @@ public function testGetComposerFiles(): void */ public function testGetCopyTarget(): void { - $this->assertSame('js/lib/uploader', $this->subject->getCopyTarget()); + static::assertSame('js/lib/uploader', $this->subject->getCopyTarget()); } } diff --git a/tests/unit/Copy/Plugins/JQueryTest.php b/tests/unit/Copy/Plugins/JQueryTest.php index cdc4921..4ea3dc1 100644 --- a/tests/unit/Copy/Plugins/JQueryTest.php +++ b/tests/unit/Copy/Plugins/JQueryTest.php @@ -34,7 +34,7 @@ public function setUp(): void */ public function testGetComposerName(): void { - $this->assertSame('components/jquery', $this->subject->getComposerName()); + static::assertSame('components/jquery', $this->subject->getComposerName()); } /** @@ -42,7 +42,7 @@ public function testGetComposerName(): void */ public function testGetComposerSource(): void { - $this->assertSame('', $this->subject->getComposerSource()); + static::assertSame('', $this->subject->getComposerSource()); } /** @@ -50,7 +50,7 @@ public function testGetComposerSource(): void */ public function testGetComposerFiles(): void { - $this->assertSame(['*.js', '*.map'], $this->subject->getComposerFiles()); + static::assertSame(['*.js', '*.map'], $this->subject->getComposerFiles()); } /** @@ -58,6 +58,6 @@ public function testGetComposerFiles(): void */ public function testGetCopyTarget(): void { - $this->assertSame('js/lib/jquery', $this->subject->getCopyTarget()); + static::assertSame('js/lib/jquery', $this->subject->getCopyTarget()); } } diff --git a/tests/unit/Copy/Plugins/TinyMceLanguagesTest.php b/tests/unit/Copy/Plugins/TinyMceLanguagesTest.php index bc8207f..7454238 100644 --- a/tests/unit/Copy/Plugins/TinyMceLanguagesTest.php +++ b/tests/unit/Copy/Plugins/TinyMceLanguagesTest.php @@ -35,7 +35,7 @@ public function setUp(): void */ public function testGetComposerName(): void { - $this->assertSame('mklkj/tinymce-i18n', $this->subject->getComposerName()); + static::assertSame('mklkj/tinymce-i18n', $this->subject->getComposerName()); } /** @@ -44,9 +44,9 @@ public function testGetComposerName(): void public function testGetComposerSource(): void { try { - $this->assertSame('langs7', $this->subject->getComposerSource()); + static::assertSame('langs7', $this->subject->getComposerSource()); } catch (OutOfBoundsException $exception) { - $this->assertSame('Package "tinymce/tinymce" is not installed', $exception->getMessage()); + static::assertSame('Package "tinymce/tinymce" is not installed', $exception->getMessage()); } } @@ -55,7 +55,7 @@ public function testGetComposerSource(): void */ public function testGetComposerFiles(): void { - $this->assertSame(['*.css', '*.js'], $this->subject->getComposerFiles()); + static::assertSame(['*.css', '*.js'], $this->subject->getComposerFiles()); } /** @@ -63,6 +63,6 @@ public function testGetComposerFiles(): void */ public function testGetCopyTarget(): void { - $this->assertSame('js/lib/tinymce/langs', $this->subject->getCopyTarget()); + static::assertSame('js/lib/tinymce/langs', $this->subject->getCopyTarget()); } } diff --git a/tests/unit/Copy/Plugins/TinyMceTest.php b/tests/unit/Copy/Plugins/TinyMceTest.php index f954341..0e7f306 100644 --- a/tests/unit/Copy/Plugins/TinyMceTest.php +++ b/tests/unit/Copy/Plugins/TinyMceTest.php @@ -34,7 +34,7 @@ public function setUp(): void */ public function testGetComposerName(): void { - $this->assertSame('tinymce/tinymce', $this->subject->getComposerName()); + static::assertSame('tinymce/tinymce', $this->subject->getComposerName()); } /** @@ -42,7 +42,7 @@ public function testGetComposerName(): void */ public function testGetComposerSource(): void { - $this->assertSame('', $this->subject->getComposerSource()); + static::assertSame('', $this->subject->getComposerSource()); } /** @@ -50,7 +50,7 @@ public function testGetComposerSource(): void */ public function testGetComposerFiles(): void { - $this->assertSame(['*.css', '*.js'], $this->subject->getComposerFiles()); + static::assertSame(['*.css', '*.js'], $this->subject->getComposerFiles()); } /** @@ -58,6 +58,6 @@ public function testGetComposerFiles(): void */ public function testGetCopyTarget(): void { - $this->assertSame('js/lib/tinymce', $this->subject->getCopyTarget()); + static::assertSame('js/lib/tinymce', $this->subject->getCopyTarget()); } } diff --git a/tests/unit/Copy/Unpkg/ConfigTest.php b/tests/unit/Copy/Unpkg/ConfigTest.php index 97c1c3f..c597708 100644 --- a/tests/unit/Copy/Unpkg/ConfigTest.php +++ b/tests/unit/Copy/Unpkg/ConfigTest.php @@ -36,7 +36,7 @@ public function setUp(): void */ public function testGetValidatedConfig(?array $expectedResult, $packageConfig): void { - $this->assertSame($expectedResult, $this->subject->getValidatedConfig($packageConfig)); + static::assertSame($expectedResult, $this->subject->getValidatedConfig($packageConfig)); } public function provideGetValidatedConfig(): Generator @@ -152,7 +152,7 @@ public function testUnpkgName(): void { $source = ''; $this->subject->setUnpkgName($source); - $this->assertSame($source, $this->subject->getUnpkgName()); + static::assertSame($source, $this->subject->getUnpkgName()); } /** @@ -163,7 +163,7 @@ public function testUnpkgVersion(): void { $source = ''; $this->subject->setUnpkgVersion($source); - $this->assertSame($source, $this->subject->getUnpkgVersion()); + static::assertSame($source, $this->subject->getUnpkgVersion()); } /** @@ -174,7 +174,7 @@ public function testUnpkgSource(): void { $source = ''; $this->subject->setUnpkgSource($source); - $this->assertSame($source, $this->subject->getUnpkgSource()); + static::assertSame($source, $this->subject->getUnpkgSource()); } /** @@ -185,7 +185,7 @@ public function testCopyTarget(): void { $target = ''; $this->subject->setCopyTarget($target); - $this->assertSame($target, $this->subject->getCopyTarget()); + static::assertSame($target, $this->subject->getCopyTarget()); } /** @@ -196,6 +196,6 @@ public function testUnpkgFiles(): void { $files = []; $this->subject->setUnpkgFiles($files); - $this->assertSame($files, $this->subject->getUnpkgFiles()); + static::assertSame($files, $this->subject->getUnpkgFiles()); } } diff --git a/tests/unit/Copy/Unpkg/GenericTest.php b/tests/unit/Copy/Unpkg/GenericTest.php index c70c555..b93f8e3 100644 --- a/tests/unit/Copy/Unpkg/GenericTest.php +++ b/tests/unit/Copy/Unpkg/GenericTest.php @@ -50,7 +50,7 @@ public function setUp(): void */ public function testGetUnpkgName(): void { - $this->assertSame('name', $this->subject->getUnpkgName()); + static::assertSame('name', $this->subject->getUnpkgName()); } /** @@ -66,7 +66,7 @@ public function testGetUnpkgName(): void */ public function testGetUnpkgVersion(): void { - $this->assertSame('version', $this->subject->getUnpkgVersion()); + static::assertSame('version', $this->subject->getUnpkgVersion()); } /** @@ -81,7 +81,7 @@ public function testGetUnpkgVersion(): void */ public function testGetUnpkgSource(): void { - $this->assertSame('source', $this->subject->getUnpkgSource()); + static::assertSame('source', $this->subject->getUnpkgSource()); } /** @@ -96,7 +96,7 @@ public function testGetUnpkgSource(): void */ public function testGetUnpkgFiles(): void { - $this->assertSame([], $this->subject->getUnpkgFiles()); + static::assertSame([], $this->subject->getUnpkgFiles()); } /** @@ -111,6 +111,6 @@ public function testGetUnpkgFiles(): void */ public function testGetCopyTarget(): void { - $this->assertSame('target', $this->subject->getCopyTarget()); + static::assertSame('target', $this->subject->getCopyTarget()); } } diff --git a/tests/unit/PluginTest.php b/tests/unit/PluginTest.php index 50790cd..faa36ac 100644 --- a/tests/unit/PluginTest.php +++ b/tests/unit/PluginTest.php @@ -46,7 +46,7 @@ public function testGetSubscribedEvents(): void ], ], ]; - $this->assertSame($events, $this->subject->getSubscribedEvents()); + static::assertSame($events, $this->subject->getSubscribedEvents()); } /** @@ -71,6 +71,6 @@ public function testGetSubscribedEvents(): void */ public function testProcessCopy(): void { - $this->assertNull($this->subject->processCopy(null)); + static::assertNull($this->subject->processCopy(null)); } }