for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Tests\GBProd\ElasticaSpecification;
use GBProd\ElasticaSpecification\QueryFactory\Factory;
use GBProd\ElasticaSpecification\Registry;
use GBProd\Specification\Specification;
/**
* Tests for registry
*
* @author gbprod <[email protected]>
*/
class RegistryTest extends \PHPUnit_Framework_TestCase implements Specification
{
public function testConstruct()
$registry = new Registry();
$this->assertInstanceOf(Registry::class, $registry);
}
public function isSatisfiedBy($candidate)
return true;
public function testgetFactoryThrowsOutOfRangeExceptionIfFactoryNotRegistred()
$this->expectException(\OutOfRangeException::class);
$registry->getFactory($this);
public function testgetFactoryReturnsAssociatedFactory()
$factory = $this->prophesize(Factory::class)->reveal();
$registry->register(self::class, $factory);
$this->assertEquals(
$factory,
$registry->getFactory($this)
);