for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace test;
use \PHPUnit\Framework\TestCase;
use Exception;
use src\Factory;
use test\CrearDummy;
class FactoryTest extends TestCase
{
public function setUp(): void
$this->class = new Factory();
class
$this->crearDummy = new CrearDummy;
crearDummy
}
public function testSiLaClaseNoExisteSeEsperaUnaExcepcion()
$this->expectException(Exception::class);
$this->class->crear('Hola', array('hola'));
public function testSiLaClaseExisteYDevuelveUnObjeto()
$this->assertIsObject($this->class->crear('test\Dummy', array() ) );
public function testSiRegresaUnaClaseEsConsideradaUnObjeto()
$this->assertIsObject( $this->crearDummy->crear(array() ) );