for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* This file is part of the Cubiche package.
*
* Copyright (c) Cubiche
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Cubiche\Core\Cqrs\Tests\Units\Middlewares\Handler\Resolver\NameOfCommand;
use Cubiche\Core\Cqrs\Middlewares\Handler\Resolver\NameOfCommand\FromCommandNamedResolver;
use Cubiche\Core\Cqrs\Tests\Fixtures\Command\LoginUserCommand;
use Cubiche\Core\Cqrs\Tests\Fixtures\Command\LogoutUserCommand;
use Cubiche\Core\Cqrs\Tests\Units\TestCase;
* FromCommandNamedResolverTests class.
* @author Ivannis Suárez Jerez <[email protected]>
class FromCommandNamedResolverTests extends TestCase
{
* Test Resolve method.
public function testResolve()
$this
->given($resolver = new FromCommandNamedResolver())
->when($result = $resolver->resolve(new LogoutUserCommand('[email protected]')))
->then()
->string($result)
->isEqualTo('logout_user')
;
->exception(function () use ($resolver) {
$resolver->resolve(new LoginUserCommand('[email protected]', 'plainpassword'));
})
->isInstanceOf(\InvalidArgumentException::class)
}