MethodWithObjectNameResolverTests   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 2
dl 0
loc 24
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A testResolve() 0 18 1
1
<?php
2
3
/**
4
 * This file is part of the Cubiche package.
5
 *
6
 * Copyright (c) Cubiche
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
namespace Cubiche\Core\Bus\Tests\Units\Middlewares\Handler\Resolver\HandlerMethodName;
12
13
use Cubiche\Core\Bus\Middlewares\Handler\Resolver\HandlerMethodName\MethodWithObjectNameResolver;
14
use Cubiche\Core\Bus\Tests\Fixtures\Command\LoginUserCommand;
15
use Cubiche\Core\Bus\Tests\Fixtures\Query\PublishedPostsQuery;
16
use Cubiche\Core\Bus\Tests\Units\TestCase;
17
18
/**
19
 * MethodWithObjectNameResolverTests class.
20
 *
21
 * @author Ivannis Suárez Jerez <[email protected]>
22
 */
23
class MethodWithObjectNameResolverTests extends TestCase
24
{
25
    /**
26
     * Test Resolve method.
27
     */
28
    public function testResolve()
29
    {
30
        $this
31
            ->given($resolver = new MethodWithObjectNameResolver())
32
            ->when($result = $resolver->resolve(LoginUserCommand::class))
33
            ->then()
34
                ->string($result)
35
                    ->isEqualTo('loginUserCommand')
36
        ;
37
38
        $this
39
            ->given($resolver = new MethodWithObjectNameResolver())
40
            ->when($result = $resolver->resolve(PublishedPostsQuery::class))
41
            ->then()
42
                ->string($result)
43
                    ->isEqualTo('publishedPostsQuery')
44
        ;
45
    }
46
}
47