From 87c0d8c8d9b436e583b6c06fb7e3f8fbcfe13c51 Mon Sep 17 00:00:00 2001 From: Juan Pablo Vial Date: Tue, 29 Apr 2025 23:55:51 -0400 Subject: [PATCH] Se mueve todo a extension de pruebas --- app/test.bootstrap.php | 1 + .../AbstractIntegration.php | 4 ++-- app/tests/extension/AbstractModel.php | 10 ++++++++ .../AbstractPerformance.php | 2 +- .../ObjectHasMethodTrait.php | 2 +- app/tests/extension/testMethodsTrait.php | 18 ++++++++++++++ app/tests/extension/testPropertiesTrait.php | 24 +++++++++++++++++++ 7 files changed, 57 insertions(+), 4 deletions(-) rename app/tests/{integration => extension}/AbstractIntegration.php (90%) create mode 100644 app/tests/extension/AbstractModel.php rename app/tests/{performance => extension}/AbstractPerformance.php (90%) rename app/tests/{unit/src => extension}/ObjectHasMethodTrait.php (89%) create mode 100644 app/tests/extension/testMethodsTrait.php create mode 100644 app/tests/extension/testPropertiesTrait.php diff --git a/app/test.bootstrap.php b/app/test.bootstrap.php index 5e31ebc..6be992a 100644 --- a/app/test.bootstrap.php +++ b/app/test.bootstrap.php @@ -150,6 +150,7 @@ class TestBootstrap spl_autoload_register(function($className) { $baseTestPath = __DIR__ . "/tests"; $namespaceMap = [ + "ProVM\\Tests\\Extension\\" => "{$baseTestPath}/extension", "ProVM\\Integration\\" => "{$baseTestPath}/integration", "ProVM\\Unit\\" => "{$baseTestPath}/unit/src", "ProVM\\Performance\\" => "{$baseTestPath}/performance", diff --git a/app/tests/integration/AbstractIntegration.php b/app/tests/extension/AbstractIntegration.php similarity index 90% rename from app/tests/integration/AbstractIntegration.php rename to app/tests/extension/AbstractIntegration.php index b33a4c6..cab4e9f 100644 --- a/app/tests/integration/AbstractIntegration.php +++ b/app/tests/extension/AbstractIntegration.php @@ -1,9 +1,9 @@ model; + + foreach ($this->methods as $method) { + $this->assertObjectHasMethod($method, $object); + } + } + + protected array $methods = []; +} \ No newline at end of file diff --git a/app/tests/extension/testPropertiesTrait.php b/app/tests/extension/testPropertiesTrait.php new file mode 100644 index 0000000..adfb367 --- /dev/null +++ b/app/tests/extension/testPropertiesTrait.php @@ -0,0 +1,24 @@ +model; + + $this->assertProperties($model); + } + + protected array $properties = []; + protected function assertProperties(Model $model): void + { + foreach ($this->properties as $key) { + $this->assertObjectHasProperty($key, $model); + } + } +} \ No newline at end of file