Se mueve todo a extension de pruebas

This commit is contained in:
Juan Pablo Vial
2025-04-29 23:55:51 -04:00
parent dd1741a930
commit 87c0d8c8d9
7 changed files with 57 additions and 4 deletions

View File

@ -150,6 +150,7 @@ class TestBootstrap
spl_autoload_register(function($className) { spl_autoload_register(function($className) {
$baseTestPath = __DIR__ . "/tests"; $baseTestPath = __DIR__ . "/tests";
$namespaceMap = [ $namespaceMap = [
"ProVM\\Tests\\Extension\\" => "{$baseTestPath}/extension",
"ProVM\\Integration\\" => "{$baseTestPath}/integration", "ProVM\\Integration\\" => "{$baseTestPath}/integration",
"ProVM\\Unit\\" => "{$baseTestPath}/unit/src", "ProVM\\Unit\\" => "{$baseTestPath}/unit/src",
"ProVM\\Performance\\" => "{$baseTestPath}/performance", "ProVM\\Performance\\" => "{$baseTestPath}/performance",

View File

@ -1,9 +1,9 @@
<?php <?php
namespace ProVM\Integration; namespace ProVM\Tests\Extension;
use Psr\Http\Client\ClientInterface;
use GuzzleHttp\Client; use GuzzleHttp\Client;
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;
use Psr\Http\Client\ClientInterface;
abstract class AbstractIntegration extends TestCase abstract class AbstractIntegration extends TestCase
{ {

View File

@ -0,0 +1,10 @@
<?php
namespace ProVM\Tests\Extension;
use PHPUnit\Framework\TestCase;
use Incoviba\Common\Define\Model;
abstract class AbstractModel extends TestCase
{
protected Model $model;
}

View File

@ -1,5 +1,5 @@
<?php <?php
namespace ProVM\Performance; namespace ProVM\Tests\Extension;
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;

View File

@ -1,5 +1,5 @@
<?php <?php
namespace ProVM\Unit; namespace ProVM\Tests\Extension;
trait ObjectHasMethodTrait trait ObjectHasMethodTrait
{ {

View File

@ -0,0 +1,18 @@
<?php
namespace ProVM\Tests\Extension;
trait testMethodsTrait
{
use ObjectHasMethodTrait;
public function testMethods(): void
{
$object = $this->model;
foreach ($this->methods as $method) {
$this->assertObjectHasMethod($method, $object);
}
}
protected array $methods = [];
}

View File

@ -0,0 +1,24 @@
<?php
namespace ProVM\Tests\Extension;
use Incoviba\Common\Define\Model;
trait testPropertiesTrait
{
use ObjectHasMethodTrait;
public function testProperties(): void
{
$model = $this->model;
$this->assertProperties($model);
}
protected array $properties = [];
protected function assertProperties(Model $model): void
{
foreach ($this->properties as $key) {
$this->assertObjectHasProperty($key, $model);
}
}
}