From 3b498a6e8b6900b17c6ed10f9c032da4d822c2d2 Mon Sep 17 00:00:00 2001
From: Alex P <alex.pantec@gmail.com>
Date: Wed, 7 Apr 2021 10:29:18 +0300
Subject: [PATCH 1/4] Fix method name

---
 src/Gutenberg/BlockParserInterface.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/Gutenberg/BlockParserInterface.php b/src/Gutenberg/BlockParserInterface.php
index 2863f28..a8a1815 100644
--- a/src/Gutenberg/BlockParserInterface.php
+++ b/src/Gutenberg/BlockParserInterface.php
@@ -13,5 +13,5 @@ interface BlockParserInterface
      * @param string $postContent Content of a WP post (e.g. WP_Post post_content).
      * @return BlockInterface[]
      */
-    public function parseBlock(string $postContent): array;
+    public function parseBlocks(string $postContent): array;
 }

From f9b9c2dad44339448b53f9628cc48d6d44301133 Mon Sep 17 00:00:00 2001
From: Alex P <alex.pantec@gmail.com>
Date: Wed, 7 Apr 2021 12:38:50 +0300
Subject: [PATCH 2/4] Simplify test namespaces in composer.json

---
 composer.json                                 |  2 +-
 composer.lock                                 | 81 ++++++++++---------
 phpunit.xml.dist                              |  2 +-
 .../FilePathPluginFactoryInterfaceTest.php    |  0
 .../Plugin/PluginInterfaceTest.php            |  0
 5 files changed, 43 insertions(+), 42 deletions(-)
 rename tests/{unit => Unit}/Plugin/FilePathPluginFactoryInterfaceTest.php (100%)
 rename tests/{unit => Unit}/Plugin/PluginInterfaceTest.php (100%)

diff --git a/composer.json b/composer.json
index 114136c..ec6b2b9 100644
--- a/composer.json
+++ b/composer.json
@@ -26,7 +26,7 @@
   },
   "autoload-dev": {
     "psr-4": {
-      "WpOop\\WordPress\\Test\\Unit\\": "tests/unit"
+      "WpOop\\WordPress\\Test\\": "tests"
     }
   },
   "extra": {
diff --git a/composer.lock b/composer.lock
index 8858861..0c49e5d 100644
--- a/composer.lock
+++ b/composer.lock
@@ -403,12 +403,12 @@
             "source": {
                 "type": "git",
                 "url": "https://github.com/amphp/byte-stream.git",
-                "reference": "f813a658f0446192c5e17f96727070ee9342b93a"
+                "reference": "7a64a9ad336fc5e1e70b1c1fc1e9618a7027332e"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/amphp/byte-stream/zipball/f813a658f0446192c5e17f96727070ee9342b93a",
-                "reference": "f813a658f0446192c5e17f96727070ee9342b93a",
+                "url": "https://api.github.com/repos/amphp/byte-stream/zipball/7a64a9ad336fc5e1e70b1c1fc1e9618a7027332e",
+                "reference": "7a64a9ad336fc5e1e70b1c1fc1e9618a7027332e",
                 "shasum": ""
             },
             "require": {
@@ -473,7 +473,7 @@
                     "type": "github"
                 }
             ],
-            "time": "2020-08-30T19:23:04+00:00"
+            "time": "2021-04-05T20:23:22+00:00"
         },
         {
             "name": "composer/package-versions-deprecated",
@@ -633,16 +633,16 @@
         },
         {
             "name": "composer/xdebug-handler",
-            "version": "1.4.5",
+            "version": "1.4.x-dev",
             "source": {
                 "type": "git",
                 "url": "https://github.com/composer/xdebug-handler.git",
-                "reference": "f28d44c286812c714741478d968104c5e604a1d4"
+                "reference": "f27e06cd9675801df441b3656569b328e04aa37c"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/f28d44c286812c714741478d968104c5e604a1d4",
-                "reference": "f28d44c286812c714741478d968104c5e604a1d4",
+                "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/f27e06cd9675801df441b3656569b328e04aa37c",
+                "reference": "f27e06cd9675801df441b3656569b328e04aa37c",
                 "shasum": ""
             },
             "require": {
@@ -650,7 +650,8 @@
                 "psr/log": "^1.0"
             },
             "require-dev": {
-                "phpunit/phpunit": "^4.8.35 || ^5.7 || 6.5 - 8"
+                "phpstan/phpstan": "^0.12.55",
+                "symfony/phpunit-bridge": "^4.2 || ^5"
             },
             "type": "library",
             "autoload": {
@@ -676,7 +677,7 @@
             "support": {
                 "irc": "irc://irc.freenode.org/composer",
                 "issues": "https://github.com/composer/xdebug-handler/issues",
-                "source": "https://github.com/composer/xdebug-handler/tree/1.4.5"
+                "source": "https://github.com/composer/xdebug-handler/tree/1.4.6"
             },
             "funding": [
                 {
@@ -692,7 +693,7 @@
                     "type": "tidelift"
                 }
             ],
-            "time": "2020-11-13T08:04:11+00:00"
+            "time": "2021-03-25T17:01:18+00:00"
         },
         {
             "name": "dealerdirect/phpcodesniffer-composer-installer",
@@ -1527,16 +1528,16 @@
         },
         {
             "name": "phpstan/phpdoc-parser",
-            "version": "0.4.12",
+            "version": "0.5.4",
             "source": {
                 "type": "git",
                 "url": "https://github.com/phpstan/phpdoc-parser.git",
-                "reference": "2e17e4a90702d8b7ead58f4e08478a8e819ba6b8"
+                "reference": "e352d065af1ae9b41c12d1dfd309e90f7b1f55c9"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/2e17e4a90702d8b7ead58f4e08478a8e819ba6b8",
-                "reference": "2e17e4a90702d8b7ead58f4e08478a8e819ba6b8",
+                "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/e352d065af1ae9b41c12d1dfd309e90f7b1f55c9",
+                "reference": "e352d065af1ae9b41c12d1dfd309e90f7b1f55c9",
                 "shasum": ""
             },
             "require": {
@@ -1554,7 +1555,7 @@
             "type": "library",
             "extra": {
                 "branch-alias": {
-                    "dev-master": "0.4-dev"
+                    "dev-master": "0.5-dev"
                 }
             },
             "autoload": {
@@ -1571,9 +1572,9 @@
             "description": "PHPDoc parser with support for nullable, intersection and generic types",
             "support": {
                 "issues": "https://github.com/phpstan/phpdoc-parser/issues",
-                "source": "https://github.com/phpstan/phpdoc-parser/tree/0.4.12"
+                "source": "https://github.com/phpstan/phpdoc-parser/tree/0.5.4"
             },
-            "time": "2021-02-28T14:30:10+00:00"
+            "time": "2021-04-03T14:46:19+00:00"
         },
         {
             "name": "phpunit/php-code-coverage",
@@ -2728,28 +2729,28 @@
             "source": {
                 "type": "git",
                 "url": "https://github.com/slevomat/coding-standard.git",
-                "reference": "a3e37268f8ed9f1cd2f74b876996cb2e91f3e1c4"
+                "reference": "8e049b5df74441fd6fa920ba986de7941d416892"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/a3e37268f8ed9f1cd2f74b876996cb2e91f3e1c4",
-                "reference": "a3e37268f8ed9f1cd2f74b876996cb2e91f3e1c4",
+                "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/8e049b5df74441fd6fa920ba986de7941d416892",
+                "reference": "8e049b5df74441fd6fa920ba986de7941d416892",
                 "shasum": ""
             },
             "require": {
                 "dealerdirect/phpcodesniffer-composer-installer": "^0.6.2 || ^0.7",
                 "php": "^7.1 || ^8.0",
-                "phpstan/phpdoc-parser": "0.4.12",
+                "phpstan/phpdoc-parser": "0.5.1 - 0.5.4",
                 "squizlabs/php_codesniffer": "dev-master"
             },
             "require-dev": {
                 "phing/phing": "2.16.4",
                 "php-parallel-lint/php-parallel-lint": "1.2.0",
-                "phpstan/phpstan": "0.12.80",
+                "phpstan/phpstan": "0.12.83",
                 "phpstan/phpstan-deprecation-rules": "0.12.6",
-                "phpstan/phpstan-phpunit": "0.12.17",
+                "phpstan/phpstan-phpunit": "0.12.18",
                 "phpstan/phpstan-strict-rules": "0.12.9",
-                "phpunit/phpunit": "7.5.20|8.5.5|9.5.2"
+                "phpunit/phpunit": "7.5.20|8.5.5|9.5.4"
             },
             "default-branch": true,
             "type": "phpcodesniffer-standard",
@@ -2782,7 +2783,7 @@
                     "type": "tidelift"
                 }
             ],
-            "time": "2021-03-04T08:19:17+00:00"
+            "time": "2021-04-07T09:13:08+00:00"
         },
         {
             "name": "squizlabs/php_codesniffer",
@@ -2790,12 +2791,12 @@
             "source": {
                 "type": "git",
                 "url": "https://github.com/squizlabs/PHP_CodeSniffer.git",
-                "reference": "d02296fe420483999d2ad8cd8bdceb43014dc83e"
+                "reference": "97f78982711bdf122200dc37be6f33dfbd4aa4dd"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/d02296fe420483999d2ad8cd8bdceb43014dc83e",
-                "reference": "d02296fe420483999d2ad8cd8bdceb43014dc83e",
+                "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/97f78982711bdf122200dc37be6f33dfbd4aa4dd",
+                "reference": "97f78982711bdf122200dc37be6f33dfbd4aa4dd",
                 "shasum": ""
             },
             "require": {
@@ -2839,7 +2840,7 @@
                 "source": "https://github.com/squizlabs/PHP_CodeSniffer",
                 "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki"
             },
-            "time": "2021-03-05T07:46:22+00:00"
+            "time": "2021-04-05T23:07:47+00:00"
         },
         {
             "name": "symfony/console",
@@ -2847,12 +2848,12 @@
             "source": {
                 "type": "git",
                 "url": "https://github.com/symfony/console.git",
-                "reference": "c98349bda966c70d6c08b4cd8658377c94166492"
+                "reference": "1ba4560dbbb9fcf5ae28b61f71f49c678086cf23"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/symfony/console/zipball/c98349bda966c70d6c08b4cd8658377c94166492",
-                "reference": "c98349bda966c70d6c08b4cd8658377c94166492",
+                "url": "https://api.github.com/repos/symfony/console/zipball/1ba4560dbbb9fcf5ae28b61f71f49c678086cf23",
+                "reference": "1ba4560dbbb9fcf5ae28b61f71f49c678086cf23",
                 "shasum": ""
             },
             "require": {
@@ -2928,7 +2929,7 @@
                     "type": "tidelift"
                 }
             ],
-            "time": "2021-02-22T18:44:15+00:00"
+            "time": "2021-03-26T09:23:24+00:00"
         },
         {
             "name": "symfony/polyfill-ctype",
@@ -3300,16 +3301,16 @@
             "source": {
                 "type": "git",
                 "url": "https://github.com/vimeo/psalm.git",
-                "reference": "96e0743892f3239f089b13eb978c33d743cfe904"
+                "reference": "a469c82653e5730b659435e7472b97c3c2a523a6"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/vimeo/psalm/zipball/96e0743892f3239f089b13eb978c33d743cfe904",
-                "reference": "96e0743892f3239f089b13eb978c33d743cfe904",
+                "url": "https://api.github.com/repos/vimeo/psalm/zipball/a469c82653e5730b659435e7472b97c3c2a523a6",
+                "reference": "a469c82653e5730b659435e7472b97c3c2a523a6",
                 "shasum": ""
             },
             "require": {
-                "amphp/amp": "^2.1",
+                "amphp/amp": "^2.4.2",
                 "amphp/byte-stream": "^1.5",
                 "composer/package-versions-deprecated": "^1.8.0",
                 "composer/semver": "^1.4 || ^2.0 || ^3.0",
@@ -3335,7 +3336,6 @@
                 "psalm/psalm": "self.version"
             },
             "require-dev": {
-                "amphp/amp": "^2.4.2",
                 "bamarni/composer-bin-plugin": "^1.2",
                 "brianium/paratest": "^4.0||^6.0",
                 "ext-curl": "*",
@@ -3348,6 +3348,7 @@
                 "slevomat/coding-standard": "^6.3.11",
                 "squizlabs/php_codesniffer": "^3.5",
                 "symfony/process": "^4.3",
+                "weirdan/phpunit-appveyor-reporter": "^1.0.0",
                 "weirdan/prophecy-shim": "^1.0 || ^2.0"
             },
             "suggest": {
@@ -3398,7 +3399,7 @@
                 "issues": "https://github.com/vimeo/psalm/issues",
                 "source": "https://github.com/vimeo/psalm/tree/master"
             },
-            "time": "2021-03-05T05:39:25+00:00"
+            "time": "2021-04-06T16:35:09+00:00"
         },
         {
             "name": "webmozart/assert",
diff --git a/phpunit.xml.dist b/phpunit.xml.dist
index 28adb71..eee78b7 100644
--- a/phpunit.xml.dist
+++ b/phpunit.xml.dist
@@ -9,7 +9,7 @@
     </php>
     <testsuites>
         <testsuite name="unit">
-            <directory>tests/unit</directory>
+            <directory>tests/Unit</directory>
         </testsuite>
     </testsuites>
     <filter>
diff --git a/tests/unit/Plugin/FilePathPluginFactoryInterfaceTest.php b/tests/Unit/Plugin/FilePathPluginFactoryInterfaceTest.php
similarity index 100%
rename from tests/unit/Plugin/FilePathPluginFactoryInterfaceTest.php
rename to tests/Unit/Plugin/FilePathPluginFactoryInterfaceTest.php
diff --git a/tests/unit/Plugin/PluginInterfaceTest.php b/tests/Unit/Plugin/PluginInterfaceTest.php
similarity index 100%
rename from tests/unit/Plugin/PluginInterfaceTest.php
rename to tests/Unit/Plugin/PluginInterfaceTest.php

From 5db62f44723b478d649371ab135c53693325494c Mon Sep 17 00:00:00 2001
From: Alex P <alex.pantec@gmail.com>
Date: Wed, 7 Apr 2021 12:41:53 +0300
Subject: [PATCH 3/4] Add block tests

---
 tests/Stub/Gutenberg/Block.php                | 59 +++++++++++++++++++
 tests/Stub/Gutenberg/BlockParser.php          | 17 ++++++
 tests/Unit/Gutenberg/BlockInterfaceTest.php   | 29 +++++++++
 .../Gutenberg/BlockParserInterfaceTest.php    | 28 +++++++++
 4 files changed, 133 insertions(+)
 create mode 100644 tests/Stub/Gutenberg/Block.php
 create mode 100644 tests/Stub/Gutenberg/BlockParser.php
 create mode 100644 tests/Unit/Gutenberg/BlockInterfaceTest.php
 create mode 100644 tests/Unit/Gutenberg/BlockParserInterfaceTest.php

diff --git a/tests/Stub/Gutenberg/Block.php b/tests/Stub/Gutenberg/Block.php
new file mode 100644
index 0000000..cb2512f
--- /dev/null
+++ b/tests/Stub/Gutenberg/Block.php
@@ -0,0 +1,59 @@
+<?php
+
+declare(strict_types=1);
+
+namespace WpOop\WordPress\Test\Stub\Gutenberg;
+
+use WpOop\WordPress\Gutenberg\BlockInterface;
+
+class Block implements BlockInterface
+{
+    protected $blockName;
+
+    protected $attributes;
+
+    protected $innerBlocks;
+
+    protected $innerHtml;
+
+    protected $innerContent;
+
+    public function __construct(
+        string $blockName,
+        array $attributes,
+        array $innerBlocks,
+        string $innerHtml,
+        array $innerContent
+    ) {
+        $this->blockName = $blockName;
+        $this->attributes = $attributes;
+        $this->innerBlocks = $innerBlocks;
+        $this->innerHtml = $innerHtml;
+        $this->innerContent = $innerContent;
+    }
+
+    public function getBlockName(): string
+    {
+        return $this->blockName;
+    }
+
+    public function getAttributes(): array
+    {
+        return $this->attributes;
+    }
+
+    public function getInnerBlocks(): array
+    {
+        return $this->innerBlocks;
+    }
+
+    public function getInnerHtml(): string
+    {
+        return $this->innerHtml;
+    }
+
+    public function getInnerContent(): array
+    {
+        return $this->innerContent;
+    }
+}
diff --git a/tests/Stub/Gutenberg/BlockParser.php b/tests/Stub/Gutenberg/BlockParser.php
new file mode 100644
index 0000000..4459e59
--- /dev/null
+++ b/tests/Stub/Gutenberg/BlockParser.php
@@ -0,0 +1,17 @@
+<?php
+
+declare(strict_types=1);
+
+namespace WpOop\WordPress\Test\Stub\Gutenberg;
+
+use WpOop\WordPress\Gutenberg\BlockParserInterface;
+
+class BlockParser implements BlockParserInterface
+{
+    public $blocks = [];
+
+    public function parseBlocks(string $postContent): array
+    {
+        return $this->blocks;
+    }
+}
diff --git a/tests/Unit/Gutenberg/BlockInterfaceTest.php b/tests/Unit/Gutenberg/BlockInterfaceTest.php
new file mode 100644
index 0000000..bbce768
--- /dev/null
+++ b/tests/Unit/Gutenberg/BlockInterfaceTest.php
@@ -0,0 +1,29 @@
+<?php
+
+namespace WpOop\WordPress\Test\Unit\Gutenberg;
+
+use PHPUnit\Framework\TestCase;
+use WpOop\WordPress\Test\Stub\Gutenberg\Block;
+
+class BlockInterfaceTest extends TestCase
+{
+    public function testUsage()
+    {
+        $innerBlock = new Block('core/quote', [], [], '', []);
+        $subject = new Block(
+            'core/paragraph',
+            ['foo' => 'bar', 'foobar' => 42],
+            [$innerBlock],
+            'html',
+            ['content', null, 'content2']
+        );
+
+        $this->assertInstanceOf(Block::class, $subject);
+
+        $this->assertEquals('core/paragraph', $subject->getBlockName());
+        $this->assertEquals(['foo' => 'bar', 'foobar' => 42], $subject->getAttributes());
+        $this->assertEquals([$innerBlock], $subject->getInnerBlocks());
+        $this->assertEquals('html', $subject->getInnerHtml());
+        $this->assertEquals(['content', null, 'content2'], $subject->getInnerContent());
+    }
+}
diff --git a/tests/Unit/Gutenberg/BlockParserInterfaceTest.php b/tests/Unit/Gutenberg/BlockParserInterfaceTest.php
new file mode 100644
index 0000000..52c3105
--- /dev/null
+++ b/tests/Unit/Gutenberg/BlockParserInterfaceTest.php
@@ -0,0 +1,28 @@
+<?php
+
+namespace WpOop\WordPress\Test\Unit\Gutenberg;
+
+use PHPUnit\Framework\TestCase;
+use WpOop\WordPress\Gutenberg\BlockParserInterface;
+use WpOop\WordPress\Test\Stub\Gutenberg\Block;
+use WpOop\WordPress\Test\Stub\Gutenberg\BlockParser;
+
+class BlockParserInterfaceTest extends TestCase
+{
+    public function testUsage()
+    {
+        $subject = new BlockParser();
+
+        $this->assertInstanceOf(BlockParserInterface::class, $subject);
+
+        $blocks = [
+            new Block('core/paragraph', [], [], '', []),
+            new Block('core/quote', [], [], '', []),
+        ];
+        $subject->blocks = $blocks;
+
+        $ret = $subject->parseBlocks('wp post content');
+
+        $this->assertEquals($blocks, $ret);
+    }
+}

From a93b261d76f0b7734f8d2ae895d4910bd7796d05 Mon Sep 17 00:00:00 2001
From: Alex P <alex.pantec@gmail.com>
Date: Mon, 26 Apr 2021 12:45:22 +0300
Subject: [PATCH 4/4] Add only instantiation tests

---
 composer.json                                 |  2 +-
 composer.lock                                 | 81 +++++++++----------
 phpunit.xml.dist                              |  2 +-
 tests/Stub/Gutenberg/Block.php                | 59 --------------
 tests/Stub/Gutenberg/BlockParser.php          | 17 ----
 tests/Unit/Gutenberg/BlockInterfaceTest.php   | 29 -------
 .../Gutenberg/BlockParserInterfaceTest.php    | 28 -------
 tests/unit/Gutenberg/BlockInterfaceTest.php   | 32 ++++++++
 .../Gutenberg/BlockParserInterfaceTest.php    | 32 ++++++++
 .../FilePathPluginFactoryInterfaceTest.php    |  0
 .../Plugin/PluginInterfaceTest.php            |  0
 11 files changed, 106 insertions(+), 176 deletions(-)
 delete mode 100644 tests/Stub/Gutenberg/Block.php
 delete mode 100644 tests/Stub/Gutenberg/BlockParser.php
 delete mode 100644 tests/Unit/Gutenberg/BlockInterfaceTest.php
 delete mode 100644 tests/Unit/Gutenberg/BlockParserInterfaceTest.php
 create mode 100644 tests/unit/Gutenberg/BlockInterfaceTest.php
 create mode 100644 tests/unit/Gutenberg/BlockParserInterfaceTest.php
 rename tests/{Unit => unit}/Plugin/FilePathPluginFactoryInterfaceTest.php (100%)
 rename tests/{Unit => unit}/Plugin/PluginInterfaceTest.php (100%)

diff --git a/composer.json b/composer.json
index ec6b2b9..114136c 100644
--- a/composer.json
+++ b/composer.json
@@ -26,7 +26,7 @@
   },
   "autoload-dev": {
     "psr-4": {
-      "WpOop\\WordPress\\Test\\": "tests"
+      "WpOop\\WordPress\\Test\\Unit\\": "tests/unit"
     }
   },
   "extra": {
diff --git a/composer.lock b/composer.lock
index 0c49e5d..8858861 100644
--- a/composer.lock
+++ b/composer.lock
@@ -403,12 +403,12 @@
             "source": {
                 "type": "git",
                 "url": "https://github.com/amphp/byte-stream.git",
-                "reference": "7a64a9ad336fc5e1e70b1c1fc1e9618a7027332e"
+                "reference": "f813a658f0446192c5e17f96727070ee9342b93a"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/amphp/byte-stream/zipball/7a64a9ad336fc5e1e70b1c1fc1e9618a7027332e",
-                "reference": "7a64a9ad336fc5e1e70b1c1fc1e9618a7027332e",
+                "url": "https://api.github.com/repos/amphp/byte-stream/zipball/f813a658f0446192c5e17f96727070ee9342b93a",
+                "reference": "f813a658f0446192c5e17f96727070ee9342b93a",
                 "shasum": ""
             },
             "require": {
@@ -473,7 +473,7 @@
                     "type": "github"
                 }
             ],
-            "time": "2021-04-05T20:23:22+00:00"
+            "time": "2020-08-30T19:23:04+00:00"
         },
         {
             "name": "composer/package-versions-deprecated",
@@ -633,16 +633,16 @@
         },
         {
             "name": "composer/xdebug-handler",
-            "version": "1.4.x-dev",
+            "version": "1.4.5",
             "source": {
                 "type": "git",
                 "url": "https://github.com/composer/xdebug-handler.git",
-                "reference": "f27e06cd9675801df441b3656569b328e04aa37c"
+                "reference": "f28d44c286812c714741478d968104c5e604a1d4"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/f27e06cd9675801df441b3656569b328e04aa37c",
-                "reference": "f27e06cd9675801df441b3656569b328e04aa37c",
+                "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/f28d44c286812c714741478d968104c5e604a1d4",
+                "reference": "f28d44c286812c714741478d968104c5e604a1d4",
                 "shasum": ""
             },
             "require": {
@@ -650,8 +650,7 @@
                 "psr/log": "^1.0"
             },
             "require-dev": {
-                "phpstan/phpstan": "^0.12.55",
-                "symfony/phpunit-bridge": "^4.2 || ^5"
+                "phpunit/phpunit": "^4.8.35 || ^5.7 || 6.5 - 8"
             },
             "type": "library",
             "autoload": {
@@ -677,7 +676,7 @@
             "support": {
                 "irc": "irc://irc.freenode.org/composer",
                 "issues": "https://github.com/composer/xdebug-handler/issues",
-                "source": "https://github.com/composer/xdebug-handler/tree/1.4.6"
+                "source": "https://github.com/composer/xdebug-handler/tree/1.4.5"
             },
             "funding": [
                 {
@@ -693,7 +692,7 @@
                     "type": "tidelift"
                 }
             ],
-            "time": "2021-03-25T17:01:18+00:00"
+            "time": "2020-11-13T08:04:11+00:00"
         },
         {
             "name": "dealerdirect/phpcodesniffer-composer-installer",
@@ -1528,16 +1527,16 @@
         },
         {
             "name": "phpstan/phpdoc-parser",
-            "version": "0.5.4",
+            "version": "0.4.12",
             "source": {
                 "type": "git",
                 "url": "https://github.com/phpstan/phpdoc-parser.git",
-                "reference": "e352d065af1ae9b41c12d1dfd309e90f7b1f55c9"
+                "reference": "2e17e4a90702d8b7ead58f4e08478a8e819ba6b8"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/e352d065af1ae9b41c12d1dfd309e90f7b1f55c9",
-                "reference": "e352d065af1ae9b41c12d1dfd309e90f7b1f55c9",
+                "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/2e17e4a90702d8b7ead58f4e08478a8e819ba6b8",
+                "reference": "2e17e4a90702d8b7ead58f4e08478a8e819ba6b8",
                 "shasum": ""
             },
             "require": {
@@ -1555,7 +1554,7 @@
             "type": "library",
             "extra": {
                 "branch-alias": {
-                    "dev-master": "0.5-dev"
+                    "dev-master": "0.4-dev"
                 }
             },
             "autoload": {
@@ -1572,9 +1571,9 @@
             "description": "PHPDoc parser with support for nullable, intersection and generic types",
             "support": {
                 "issues": "https://github.com/phpstan/phpdoc-parser/issues",
-                "source": "https://github.com/phpstan/phpdoc-parser/tree/0.5.4"
+                "source": "https://github.com/phpstan/phpdoc-parser/tree/0.4.12"
             },
-            "time": "2021-04-03T14:46:19+00:00"
+            "time": "2021-02-28T14:30:10+00:00"
         },
         {
             "name": "phpunit/php-code-coverage",
@@ -2729,28 +2728,28 @@
             "source": {
                 "type": "git",
                 "url": "https://github.com/slevomat/coding-standard.git",
-                "reference": "8e049b5df74441fd6fa920ba986de7941d416892"
+                "reference": "a3e37268f8ed9f1cd2f74b876996cb2e91f3e1c4"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/8e049b5df74441fd6fa920ba986de7941d416892",
-                "reference": "8e049b5df74441fd6fa920ba986de7941d416892",
+                "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/a3e37268f8ed9f1cd2f74b876996cb2e91f3e1c4",
+                "reference": "a3e37268f8ed9f1cd2f74b876996cb2e91f3e1c4",
                 "shasum": ""
             },
             "require": {
                 "dealerdirect/phpcodesniffer-composer-installer": "^0.6.2 || ^0.7",
                 "php": "^7.1 || ^8.0",
-                "phpstan/phpdoc-parser": "0.5.1 - 0.5.4",
+                "phpstan/phpdoc-parser": "0.4.12",
                 "squizlabs/php_codesniffer": "dev-master"
             },
             "require-dev": {
                 "phing/phing": "2.16.4",
                 "php-parallel-lint/php-parallel-lint": "1.2.0",
-                "phpstan/phpstan": "0.12.83",
+                "phpstan/phpstan": "0.12.80",
                 "phpstan/phpstan-deprecation-rules": "0.12.6",
-                "phpstan/phpstan-phpunit": "0.12.18",
+                "phpstan/phpstan-phpunit": "0.12.17",
                 "phpstan/phpstan-strict-rules": "0.12.9",
-                "phpunit/phpunit": "7.5.20|8.5.5|9.5.4"
+                "phpunit/phpunit": "7.5.20|8.5.5|9.5.2"
             },
             "default-branch": true,
             "type": "phpcodesniffer-standard",
@@ -2783,7 +2782,7 @@
                     "type": "tidelift"
                 }
             ],
-            "time": "2021-04-07T09:13:08+00:00"
+            "time": "2021-03-04T08:19:17+00:00"
         },
         {
             "name": "squizlabs/php_codesniffer",
@@ -2791,12 +2790,12 @@
             "source": {
                 "type": "git",
                 "url": "https://github.com/squizlabs/PHP_CodeSniffer.git",
-                "reference": "97f78982711bdf122200dc37be6f33dfbd4aa4dd"
+                "reference": "d02296fe420483999d2ad8cd8bdceb43014dc83e"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/97f78982711bdf122200dc37be6f33dfbd4aa4dd",
-                "reference": "97f78982711bdf122200dc37be6f33dfbd4aa4dd",
+                "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/d02296fe420483999d2ad8cd8bdceb43014dc83e",
+                "reference": "d02296fe420483999d2ad8cd8bdceb43014dc83e",
                 "shasum": ""
             },
             "require": {
@@ -2840,7 +2839,7 @@
                 "source": "https://github.com/squizlabs/PHP_CodeSniffer",
                 "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki"
             },
-            "time": "2021-04-05T23:07:47+00:00"
+            "time": "2021-03-05T07:46:22+00:00"
         },
         {
             "name": "symfony/console",
@@ -2848,12 +2847,12 @@
             "source": {
                 "type": "git",
                 "url": "https://github.com/symfony/console.git",
-                "reference": "1ba4560dbbb9fcf5ae28b61f71f49c678086cf23"
+                "reference": "c98349bda966c70d6c08b4cd8658377c94166492"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/symfony/console/zipball/1ba4560dbbb9fcf5ae28b61f71f49c678086cf23",
-                "reference": "1ba4560dbbb9fcf5ae28b61f71f49c678086cf23",
+                "url": "https://api.github.com/repos/symfony/console/zipball/c98349bda966c70d6c08b4cd8658377c94166492",
+                "reference": "c98349bda966c70d6c08b4cd8658377c94166492",
                 "shasum": ""
             },
             "require": {
@@ -2929,7 +2928,7 @@
                     "type": "tidelift"
                 }
             ],
-            "time": "2021-03-26T09:23:24+00:00"
+            "time": "2021-02-22T18:44:15+00:00"
         },
         {
             "name": "symfony/polyfill-ctype",
@@ -3301,16 +3300,16 @@
             "source": {
                 "type": "git",
                 "url": "https://github.com/vimeo/psalm.git",
-                "reference": "a469c82653e5730b659435e7472b97c3c2a523a6"
+                "reference": "96e0743892f3239f089b13eb978c33d743cfe904"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/vimeo/psalm/zipball/a469c82653e5730b659435e7472b97c3c2a523a6",
-                "reference": "a469c82653e5730b659435e7472b97c3c2a523a6",
+                "url": "https://api.github.com/repos/vimeo/psalm/zipball/96e0743892f3239f089b13eb978c33d743cfe904",
+                "reference": "96e0743892f3239f089b13eb978c33d743cfe904",
                 "shasum": ""
             },
             "require": {
-                "amphp/amp": "^2.4.2",
+                "amphp/amp": "^2.1",
                 "amphp/byte-stream": "^1.5",
                 "composer/package-versions-deprecated": "^1.8.0",
                 "composer/semver": "^1.4 || ^2.0 || ^3.0",
@@ -3336,6 +3335,7 @@
                 "psalm/psalm": "self.version"
             },
             "require-dev": {
+                "amphp/amp": "^2.4.2",
                 "bamarni/composer-bin-plugin": "^1.2",
                 "brianium/paratest": "^4.0||^6.0",
                 "ext-curl": "*",
@@ -3348,7 +3348,6 @@
                 "slevomat/coding-standard": "^6.3.11",
                 "squizlabs/php_codesniffer": "^3.5",
                 "symfony/process": "^4.3",
-                "weirdan/phpunit-appveyor-reporter": "^1.0.0",
                 "weirdan/prophecy-shim": "^1.0 || ^2.0"
             },
             "suggest": {
@@ -3399,7 +3398,7 @@
                 "issues": "https://github.com/vimeo/psalm/issues",
                 "source": "https://github.com/vimeo/psalm/tree/master"
             },
-            "time": "2021-04-06T16:35:09+00:00"
+            "time": "2021-03-05T05:39:25+00:00"
         },
         {
             "name": "webmozart/assert",
diff --git a/phpunit.xml.dist b/phpunit.xml.dist
index eee78b7..28adb71 100644
--- a/phpunit.xml.dist
+++ b/phpunit.xml.dist
@@ -9,7 +9,7 @@
     </php>
     <testsuites>
         <testsuite name="unit">
-            <directory>tests/Unit</directory>
+            <directory>tests/unit</directory>
         </testsuite>
     </testsuites>
     <filter>
diff --git a/tests/Stub/Gutenberg/Block.php b/tests/Stub/Gutenberg/Block.php
deleted file mode 100644
index cb2512f..0000000
--- a/tests/Stub/Gutenberg/Block.php
+++ /dev/null
@@ -1,59 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-namespace WpOop\WordPress\Test\Stub\Gutenberg;
-
-use WpOop\WordPress\Gutenberg\BlockInterface;
-
-class Block implements BlockInterface
-{
-    protected $blockName;
-
-    protected $attributes;
-
-    protected $innerBlocks;
-
-    protected $innerHtml;
-
-    protected $innerContent;
-
-    public function __construct(
-        string $blockName,
-        array $attributes,
-        array $innerBlocks,
-        string $innerHtml,
-        array $innerContent
-    ) {
-        $this->blockName = $blockName;
-        $this->attributes = $attributes;
-        $this->innerBlocks = $innerBlocks;
-        $this->innerHtml = $innerHtml;
-        $this->innerContent = $innerContent;
-    }
-
-    public function getBlockName(): string
-    {
-        return $this->blockName;
-    }
-
-    public function getAttributes(): array
-    {
-        return $this->attributes;
-    }
-
-    public function getInnerBlocks(): array
-    {
-        return $this->innerBlocks;
-    }
-
-    public function getInnerHtml(): string
-    {
-        return $this->innerHtml;
-    }
-
-    public function getInnerContent(): array
-    {
-        return $this->innerContent;
-    }
-}
diff --git a/tests/Stub/Gutenberg/BlockParser.php b/tests/Stub/Gutenberg/BlockParser.php
deleted file mode 100644
index 4459e59..0000000
--- a/tests/Stub/Gutenberg/BlockParser.php
+++ /dev/null
@@ -1,17 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-namespace WpOop\WordPress\Test\Stub\Gutenberg;
-
-use WpOop\WordPress\Gutenberg\BlockParserInterface;
-
-class BlockParser implements BlockParserInterface
-{
-    public $blocks = [];
-
-    public function parseBlocks(string $postContent): array
-    {
-        return $this->blocks;
-    }
-}
diff --git a/tests/Unit/Gutenberg/BlockInterfaceTest.php b/tests/Unit/Gutenberg/BlockInterfaceTest.php
deleted file mode 100644
index bbce768..0000000
--- a/tests/Unit/Gutenberg/BlockInterfaceTest.php
+++ /dev/null
@@ -1,29 +0,0 @@
-<?php
-
-namespace WpOop\WordPress\Test\Unit\Gutenberg;
-
-use PHPUnit\Framework\TestCase;
-use WpOop\WordPress\Test\Stub\Gutenberg\Block;
-
-class BlockInterfaceTest extends TestCase
-{
-    public function testUsage()
-    {
-        $innerBlock = new Block('core/quote', [], [], '', []);
-        $subject = new Block(
-            'core/paragraph',
-            ['foo' => 'bar', 'foobar' => 42],
-            [$innerBlock],
-            'html',
-            ['content', null, 'content2']
-        );
-
-        $this->assertInstanceOf(Block::class, $subject);
-
-        $this->assertEquals('core/paragraph', $subject->getBlockName());
-        $this->assertEquals(['foo' => 'bar', 'foobar' => 42], $subject->getAttributes());
-        $this->assertEquals([$innerBlock], $subject->getInnerBlocks());
-        $this->assertEquals('html', $subject->getInnerHtml());
-        $this->assertEquals(['content', null, 'content2'], $subject->getInnerContent());
-    }
-}
diff --git a/tests/Unit/Gutenberg/BlockParserInterfaceTest.php b/tests/Unit/Gutenberg/BlockParserInterfaceTest.php
deleted file mode 100644
index 52c3105..0000000
--- a/tests/Unit/Gutenberg/BlockParserInterfaceTest.php
+++ /dev/null
@@ -1,28 +0,0 @@
-<?php
-
-namespace WpOop\WordPress\Test\Unit\Gutenberg;
-
-use PHPUnit\Framework\TestCase;
-use WpOop\WordPress\Gutenberg\BlockParserInterface;
-use WpOop\WordPress\Test\Stub\Gutenberg\Block;
-use WpOop\WordPress\Test\Stub\Gutenberg\BlockParser;
-
-class BlockParserInterfaceTest extends TestCase
-{
-    public function testUsage()
-    {
-        $subject = new BlockParser();
-
-        $this->assertInstanceOf(BlockParserInterface::class, $subject);
-
-        $blocks = [
-            new Block('core/paragraph', [], [], '', []),
-            new Block('core/quote', [], [], '', []),
-        ];
-        $subject->blocks = $blocks;
-
-        $ret = $subject->parseBlocks('wp post content');
-
-        $this->assertEquals($blocks, $ret);
-    }
-}
diff --git a/tests/unit/Gutenberg/BlockInterfaceTest.php b/tests/unit/Gutenberg/BlockInterfaceTest.php
new file mode 100644
index 0000000..bb3d37e
--- /dev/null
+++ b/tests/unit/Gutenberg/BlockInterfaceTest.php
@@ -0,0 +1,32 @@
+<?php
+
+namespace WpOop\WordPress\Test\Unit\Gutenberg;
+
+use PHPUnit\Framework\MockObject\MockObject;
+use PHPUnit\Framework\TestCase;
+use WpOop\WordPress\Gutenberg\BlockInterface as Subject;
+
+class BlockInterfaceTest extends TestCase
+{
+    /**
+     * @return Subject|MockObject
+     */
+    protected function createSubject(): Subject
+    {
+        $mock = $this->getMockBuilder(Subject::class)
+            ->getMock();
+
+        return $mock;
+    }
+
+    public function testInstantiation()
+    {
+        {
+            $subject = $this->createSubject();
+        }
+
+        {
+            $this->assertInstanceOf(Subject::class, $subject);
+        }
+    }
+}
diff --git a/tests/unit/Gutenberg/BlockParserInterfaceTest.php b/tests/unit/Gutenberg/BlockParserInterfaceTest.php
new file mode 100644
index 0000000..568024c
--- /dev/null
+++ b/tests/unit/Gutenberg/BlockParserInterfaceTest.php
@@ -0,0 +1,32 @@
+<?php
+
+namespace WpOop\WordPress\Test\Unit\Gutenberg;
+
+use PHPUnit\Framework\MockObject\MockObject;
+use PHPUnit\Framework\TestCase;
+use WpOop\WordPress\Gutenberg\BlockParserInterface as Subject;
+
+class BlockParserInterfaceTest extends TestCase
+{
+    /**
+     * @return Subject|MockObject
+     */
+    protected function createSubject(): Subject
+    {
+        $mock = $this->getMockBuilder(Subject::class)
+            ->getMock();
+
+        return $mock;
+    }
+
+    public function testInstantiation()
+    {
+        {
+            $subject = $this->createSubject();
+        }
+
+        {
+            $this->assertInstanceOf(Subject::class, $subject);
+        }
+    }
+}
diff --git a/tests/Unit/Plugin/FilePathPluginFactoryInterfaceTest.php b/tests/unit/Plugin/FilePathPluginFactoryInterfaceTest.php
similarity index 100%
rename from tests/Unit/Plugin/FilePathPluginFactoryInterfaceTest.php
rename to tests/unit/Plugin/FilePathPluginFactoryInterfaceTest.php
diff --git a/tests/Unit/Plugin/PluginInterfaceTest.php b/tests/unit/Plugin/PluginInterfaceTest.php
similarity index 100%
rename from tests/Unit/Plugin/PluginInterfaceTest.php
rename to tests/unit/Plugin/PluginInterfaceTest.php
