diff --git a/tests/phpunit/HooksTest.php b/tests/phpunit/HooksTest.php index a56584d..0bf6c6a 100644 --- a/tests/phpunit/HooksTest.php +++ b/tests/phpunit/HooksTest.php @@ -6,7 +6,6 @@ use PHPUnit\Framework\TestCase; use WPHooks\Hook; use WPHooks\Hooks; -use WPHooks\Tag; final class HooksTest extends TestCase { /** @@ -53,6 +52,8 @@ public function testCanGetReturnTypes(): void { $hooks = $this->getFilters(); $hook = $hooks->find( 'wp_tag_cloud' ); + self::assertInstanceOf( Hook::class, $hook ); + $returnTypes = $hook->getDoc()->getReturnTypes(); $expected = [ 'string', @@ -66,6 +67,8 @@ public function testCanGetReturnTypeString(): void { $hooks = $this->getFilters(); $hook = $hooks->find( 'wp_tag_cloud' ); + self::assertInstanceOf( Hook::class, $hook ); + $returnType = $hook->getDoc()->getReturnTypeString(); self::assertSame( 'string|string[]', $returnType ); @@ -75,17 +78,19 @@ public function testCanGetParams(): void { $hooks = $this->getFilters(); $hook = $hooks->find( 'wp_tag_cloud' ); + self::assertInstanceOf( Hook::class, $hook ); + $params = $hook->getDoc()->getParams(); self::assertCount( 2, $params ); - self::assertInstanceOf( Tag::class, $params[0] ); - self::assertInstanceOf( Tag::class, $params[1] ); } public function testCanCountParams(): void { $hooks = $this->getFilters(); $hook = $hooks->find( 'wp_tag_cloud' ); + self::assertInstanceOf( Hook::class, $hook ); + $count = $hook->getDoc()->countParams(); self::assertSame( 2, $count ); @@ -95,6 +100,8 @@ public function testCanGetSince(): void { $hooks = $this->getFilters(); $hook = $hooks->find( 'wp_tag_cloud' ); + self::assertInstanceOf( Hook::class, $hook ); + $since = $hook->getDoc()->getSince(); self::assertSame( '2.3.0', $since ); @@ -148,7 +155,7 @@ private function getFilters(): Hooks { return Hooks::fromFile( $this->dataCoreFiles()['filters'][0] ); } - private function getActions(): Hooks { - return Hooks::fromFile( $this->dataCoreFiles()['actions'][0] ); - } + // private function getActions(): Hooks { + // return Hooks::fromFile( $this->dataCoreFiles()['actions'][0] ); + // } }