for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the Kreta package.
*
* (c) Beñat Espiña <[email protected]>
* (c) Gorka Laucirica <[email protected]>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Spec\Kreta\SharedKernel\Serialization;
use Kreta\SharedKernel\Serialization\ClassNameDoesNotExistException;
use Kreta\SharedKernel\Serialization\NameResolver;
use Kreta\SharedKernel\Serialization\Resolver;
use Kreta\SharedKernel\Tests\Double\Serialization\NameResolverStub;
use PhpSpec\ObjectBehavior;
class NameResolverSpec extends ObjectBehavior
{
function let()
$this->beAnInstanceOf(NameResolverStub::class);
}
function it_is_initializable()
$this->shouldHaveType(NameResolver::class);
$this->shouldImplement(Resolver::class);
function it_resolves()
$this->resolve('Fully\Qualified\Class\Name')->shouldReturn('dummy_name');
function it_does_not_resolves_when_class_name_does_not_exist()
$this->shouldThrow(ClassNameDoesNotExistException::class)->duringResolve('Other\Fully\Qualified\Class\Name');