Cambio en namespace
This commit is contained in:
@ -152,10 +152,10 @@ 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",
|
"Tests\\Extension\\" => "{$baseTestPath}/extension",
|
||||||
"ProVM\\Integration\\" => "{$baseTestPath}/integration",
|
"Tests\\Integration\\" => "{$baseTestPath}/integration",
|
||||||
"ProVM\\Unit\\" => "{$baseTestPath}/unit/src",
|
"Tests\\Unit\\" => "{$baseTestPath}/unit/src",
|
||||||
"ProVM\\Performance\\" => "{$baseTestPath}/performance",
|
"Tests\\Performance\\" => "{$baseTestPath}/performance",
|
||||||
];
|
];
|
||||||
foreach ($namespaceMap as $namespace => $path) {
|
foreach ($namespaceMap as $namespace => $path) {
|
||||||
if (str_starts_with($className, $namespace)) {
|
if (str_starts_with($className, $namespace)) {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace ProVM\Tests\Extension;
|
namespace Tests\Extension;
|
||||||
|
|
||||||
use GuzzleHttp\Client;
|
use GuzzleHttp\Client;
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
@ -12,4 +12,4 @@ abstract class AbstractIntegration extends TestCase
|
|||||||
{
|
{
|
||||||
$this->client = new Client(['base_uri' => $_ENV['APP_URL']]);
|
$this->client = new Client(['base_uri' => $_ENV['APP_URL']]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace ProVM\Tests\Extension;
|
namespace Tests\Extension;
|
||||||
|
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
use Incoviba\Common\Define\Model;
|
use Incoviba\Common\Define\Model;
|
||||||
@ -7,4 +7,4 @@ use Incoviba\Common\Define\Model;
|
|||||||
abstract class AbstractModel extends TestCase
|
abstract class AbstractModel extends TestCase
|
||||||
{
|
{
|
||||||
protected Model $model;
|
protected Model $model;
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace ProVM\Tests\Extension;
|
namespace Tests\Extension;
|
||||||
|
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
|
|
||||||
@ -14,4 +14,4 @@ abstract class AbstractPerformance extends TestCase
|
|||||||
{
|
{
|
||||||
return microtime(true) - $this->startTime;
|
return microtime(true) - $this->startTime;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace ProVM\Tests\Extension;
|
namespace Tests\Extension;
|
||||||
|
|
||||||
trait ObjectHasMethodTrait
|
trait ObjectHasMethodTrait
|
||||||
{
|
{
|
||||||
@ -7,4 +7,4 @@ trait ObjectHasMethodTrait
|
|||||||
{
|
{
|
||||||
$this->assertTrue(method_exists($object, $method), sprintf('The object %s does not have the method %s', get_class($object), $method));
|
$this->assertTrue(method_exists($object, $method), sprintf('The object %s does not have the method %s', get_class($object), $method));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace ProVM\Tests\Extension;
|
namespace Tests\Extension;
|
||||||
|
|
||||||
trait testMethodsTrait
|
trait testMethodsTrait
|
||||||
{
|
{
|
||||||
@ -15,4 +15,4 @@ trait testMethodsTrait
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected array $methods = [];
|
protected array $methods = [];
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace ProVM\Tests\Extension;
|
namespace Tests\Extension;
|
||||||
|
|
||||||
use Incoviba\Common\Define\Model;
|
use Incoviba\Common\Define\Model;
|
||||||
|
|
||||||
@ -21,4 +21,4 @@ trait testPropertiesTrait
|
|||||||
$this->assertObjectHasProperty($key, $model);
|
$this->assertObjectHasProperty($key, $model);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace ProVM\Integration;
|
namespace Test\Integration;
|
||||||
|
|
||||||
use ProVM\Tests\Extension\AbstractIntegration;
|
use Tests\Extension\AbstractIntegration;
|
||||||
|
|
||||||
class HomeTest extends AbstractIntegration
|
class HomeTest extends AbstractIntegration
|
||||||
{
|
{
|
||||||
@ -11,4 +11,4 @@ class HomeTest extends AbstractIntegration
|
|||||||
$this->assertEquals(200, $response->getStatusCode());
|
$this->assertEquals(200, $response->getStatusCode());
|
||||||
$this->assertStringContainsString('Incoviba', $response->getBody()->getContents());
|
$this->assertStringContainsString('Incoviba', $response->getBody()->getContents());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace ProVM\Performance;
|
namespace Tests\Performance;
|
||||||
|
|
||||||
use GuzzleHttp\Client;
|
use GuzzleHttp\Client;
|
||||||
use ProVM\Tests\Extension\AbstractPerformance;
|
use Tests\Extension\AbstractPerformance;
|
||||||
|
|
||||||
class HomeTest extends AbstractPerformance
|
class HomeTest extends AbstractPerformance
|
||||||
{
|
{
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace ProVM\Unit\Model;
|
namespace Tests\Unit\Model;
|
||||||
|
|
||||||
use Incoviba\Model\Inmobiliaria\Proveedor;
|
use Incoviba\Model\Inmobiliaria\Proveedor;
|
||||||
use ProVM\Tests\Extension\AbstractModel;
|
use Tests\Extension\AbstractModel;
|
||||||
use ProVM\Tests\Extension\testPropertiesTrait;
|
use Tests\Extension\testPropertiesTrait;
|
||||||
|
|
||||||
class ProveedorTest extends AbstractModel
|
class ProveedorTest extends AbstractModel
|
||||||
{
|
{
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace ProVM\Unit\Model\Proyecto\Broker;
|
namespace Tests\Unit\Model\Proyecto\Broker;
|
||||||
|
|
||||||
use Incoviba\Model\Proyecto\Broker\Contact;
|
use Incoviba\Model\Proyecto\Broker\Contact;
|
||||||
use ProVM\Tests\Extension\AbstractModel;
|
use Tests\Extension\AbstractModel;
|
||||||
use ProVM\Tests\Extension\testPropertiesTrait;
|
use Tests\Extension\testPropertiesTrait;
|
||||||
|
|
||||||
class ContactTest extends AbstractModel
|
class ContactTest extends AbstractModel
|
||||||
{
|
{
|
||||||
@ -14,4 +14,4 @@ class ContactTest extends AbstractModel
|
|||||||
$this->model = new Contact();
|
$this->model = new Contact();
|
||||||
$this->properties = ['name', 'email', 'phone', 'address'];
|
$this->properties = ['name', 'email', 'phone', 'address'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace ProVM\Unit\Model\Proyecto\Broker\Contract;
|
namespace Tests\Unit\Model\Proyecto\Broker\Contract;
|
||||||
|
|
||||||
use Incoviba\Model\Proyecto\Broker\Contract\State;
|
use Incoviba\Model\Proyecto\Broker\Contract\State;
|
||||||
use ProVM\Tests\Extension\AbstractModel;
|
use Tests\Extension\AbstractModel;
|
||||||
use ProVM\Tests\Extension\testPropertiesTrait;
|
use Tests\Extension\testPropertiesTrait;
|
||||||
|
|
||||||
class StateTest extends AbstractModel
|
class StateTest extends AbstractModel
|
||||||
{
|
{
|
||||||
@ -14,4 +14,4 @@ class StateTest extends AbstractModel
|
|||||||
$this->model = new State();
|
$this->model = new State();
|
||||||
$this->properties = ['contract', 'date', 'type'];
|
$this->properties = ['contract', 'date', 'type'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace ProVM\Unit\Model\Proyecto\Broker;
|
namespace Tests\Unit\Model\Proyecto\Broker;
|
||||||
|
|
||||||
use Incoviba\Model\Proyecto\Broker\Contract;
|
use Incoviba\Model\Proyecto\Broker\Contract;
|
||||||
use ProVM\Tests\Extension\AbstractModel;
|
use Tests\Extension\AbstractModel;
|
||||||
use ProVM\Tests\Extension\testMethodsTrait;
|
use Tests\Extension\testMethodsTrait;
|
||||||
use ProVM\Tests\Extension\testPropertiesTrait;
|
use Tests\Extension\testPropertiesTrait;
|
||||||
|
|
||||||
class ContractTest extends AbstractModel
|
class ContractTest extends AbstractModel
|
||||||
{
|
{
|
||||||
@ -16,4 +16,4 @@ class ContractTest extends AbstractModel
|
|||||||
$this->properties = ['project', 'broker', 'commission'];
|
$this->properties = ['project', 'broker', 'commission'];
|
||||||
$this->methods = ['states', 'current', 'promotions'];
|
$this->methods = ['states', 'current', 'promotions'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace ProVM\Unit\Model\Proyecto\Broker;
|
namespace Tests\Unit\Model\Proyecto\Broker;
|
||||||
|
|
||||||
use Incoviba\Model\Proyecto\Broker;
|
use Incoviba\Model\Proyecto\Broker;
|
||||||
use ProVM\Tests\Extension\AbstractModel;
|
use Tests\Extension\AbstractModel;
|
||||||
use ProVM\Tests\Extension\testPropertiesTrait;
|
use Tests\Extension\testPropertiesTrait;
|
||||||
|
|
||||||
class DataTest extends AbstractModel
|
class DataTest extends AbstractModel
|
||||||
{
|
{
|
||||||
@ -14,4 +14,4 @@ class DataTest extends AbstractModel
|
|||||||
$this->model = new Broker\Data();
|
$this->model = new Broker\Data();
|
||||||
$this->properties = ['broker', 'representative', 'legalName'];
|
$this->properties = ['broker', 'representative', 'legalName'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace ProVM\Unit\Model\Proyecto;
|
namespace Tests\Unit\Model\Proyecto;
|
||||||
|
|
||||||
use Incoviba\Model\Proyecto\Broker;
|
use Incoviba\Model\Proyecto\Broker;
|
||||||
use ProVM\Tests\Extension\AbstractModel;
|
use Tests\Extension\AbstractModel;
|
||||||
use ProVM\Tests\Extension\testMethodsTrait;
|
use Tests\Extension\testMethodsTrait;
|
||||||
use ProVM\Tests\Extension\testPropertiesTrait;
|
use Tests\Extension\testPropertiesTrait;
|
||||||
|
|
||||||
class BrokerTest extends AbstractModel
|
class BrokerTest extends AbstractModel
|
||||||
{
|
{
|
||||||
@ -16,4 +16,4 @@ class BrokerTest extends AbstractModel
|
|||||||
$this->properties = ['rut', 'digit', 'name'];
|
$this->properties = ['rut', 'digit', 'name'];
|
||||||
$this->methods = ['data', 'contracts'];
|
$this->methods = ['data', 'contracts'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace ProVM\Unit\Model\Venta;
|
namespace Tests\Unit\Model\Venta;
|
||||||
|
|
||||||
use Incoviba\Model\Venta\Promotion;
|
use Incoviba\Model\Venta\Promotion;
|
||||||
use ProVM\Tests\Extension\AbstractModel;
|
use Tests\Extension\AbstractModel;
|
||||||
use ProVM\Tests\Extension\testMethodsTrait;
|
use Tests\Extension\testMethodsTrait;
|
||||||
use ProVM\Tests\Extension\testPropertiesTrait;
|
use Tests\Extension\testPropertiesTrait;
|
||||||
|
|
||||||
class PromotionTest extends AbstractModel
|
class PromotionTest extends AbstractModel
|
||||||
{
|
{
|
||||||
@ -16,4 +16,4 @@ class PromotionTest extends AbstractModel
|
|||||||
$this->properties = ['description', 'amount', 'startDate', 'endDate', 'validUntil', 'type', 'state'];
|
$this->properties = ['description', 'amount', 'startDate', 'endDate', 'validUntil', 'type', 'state'];
|
||||||
$this->methods = ['projects', 'brokers', 'unitTypes', 'unitLines', 'units', 'value'];
|
$this->methods = ['projects', 'brokers', 'unitTypes', 'unitLines', 'units', 'value'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace ProVM\Unit\Model\Venta\Reservation;
|
namespace Tests\Unit\Model\Venta\Reservation;
|
||||||
|
|
||||||
use Incoviba\Model\Venta\Reservation\State;
|
use Incoviba\Model\Venta\Reservation\State;
|
||||||
use ProVM\Tests\Extension\AbstractModel;
|
use Tests\Extension\AbstractModel;
|
||||||
use ProVM\Tests\Extension\testPropertiesTrait;
|
use Tests\Extension\testPropertiesTrait;
|
||||||
|
|
||||||
class StateTest extends AbstractModel
|
class StateTest extends AbstractModel
|
||||||
{
|
{
|
||||||
@ -14,4 +14,4 @@ class StateTest extends AbstractModel
|
|||||||
$this->model = new State();
|
$this->model = new State();
|
||||||
$this->properties = ['reservation', 'date', 'type'];
|
$this->properties = ['reservation', 'date', 'type'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace ProVM\Unit\Model\Venta;
|
namespace Tests\Unit\Model\Venta;
|
||||||
|
|
||||||
use Incoviba\Model\Venta\Reservation;
|
use Incoviba\Model\Venta\Reservation;
|
||||||
use ProVM\Tests\Extension\AbstractModel;
|
use Tests\Extension\AbstractModel;
|
||||||
use ProVM\Tests\Extension\testMethodsTrait;
|
use Tests\Extension\testMethodsTrait;
|
||||||
use ProVM\Tests\Extension\testPropertiesTrait;
|
use Tests\Extension\testPropertiesTrait;
|
||||||
|
|
||||||
class ReservationTest extends AbstractModel
|
class ReservationTest extends AbstractModel
|
||||||
{
|
{
|
||||||
@ -16,4 +16,4 @@ class ReservationTest extends AbstractModel
|
|||||||
$this->properties = ['buyer', 'date', 'units', 'promotions', 'broker'];
|
$this->properties = ['buyer', 'date', 'units', 'promotions', 'broker'];
|
||||||
$this->methods = ['states', 'currentState', 'addUnit', 'removeUnit', 'findUnit', 'hasUnit'];
|
$this->methods = ['states', 'currentState', 'addUnit', 'removeUnit', 'findUnit', 'hasUnit'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace ProVM\Unit\Service\Money;
|
namespace Tests\Unit\Service\Money;
|
||||||
|
|
||||||
use PDO;
|
use PDO;
|
||||||
use PDOStatement;
|
use PDOStatement;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace ProVM\Unit\Service;
|
namespace Tests\Unit\Service;
|
||||||
|
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
use PHPUnit\Framework\Attributes\DataProvider;
|
use PHPUnit\Framework\Attributes\DataProvider;
|
||||||
|
Reference in New Issue
Block a user