From a4687b136bf2bf98a530a62569e9a887ce60509e Mon Sep 17 00:00:00 2001 From: Rodolfo Berrios <20590102+rodber@users.noreply.github.com> Date: Thu, 11 Jan 2024 10:26:57 -0300 Subject: [PATCH] covers functions --- tests/FunctionsTest.php | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 tests/FunctionsTest.php diff --git a/tests/FunctionsTest.php b/tests/FunctionsTest.php new file mode 100644 index 0000000..9aca678 --- /dev/null +++ b/tests/FunctionsTest.php @@ -0,0 +1,35 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Chevere\Tests; + +use Chevere\Tests\src\ActionTestAction; +use PHPUnit\Framework\TestCase; +use ReflectionMethod; +use function Chevere\Action\getParameters; +use function Chevere\Parameter\reflectionToParameters; + +final class FunctionsTest extends TestCase +{ + public function testGetParameters(): void + { + $action = ActionTestAction::class; + $reflection = new ReflectionMethod($action, $action::mainMethod()); + $toParameters = reflectionToParameters($reflection); + $parameters = getParameters($action); + $this->assertEquals( + $toParameters, + $parameters + ); + } +}