ShortNameStrategyTest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
dl 0
loc 30
c 0
b 0
f 0
wmc 3
lcom 0
cbo 3
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 4 1
A returns_matchable_name_of_given_command() 0 6 1
A returns_matchable_name_of_given_command_handler() 0 7 1
1
<?php
2
3
namespace Tactics\CommandBusBundle\Tests;
4
5
use Tactics\CommandBusBundle\NamingStrategy\ShortNameStrategy;
6
7
/**
8
 * Class ShortNameStrategyTest
9
 * @package Tactics\CommandBusBundle\Tests
10
 */
11
class ShortNameStrategyTest extends \PHPUnit_Framework_TestCase
12
{
13
    public function setUp()
14
    {
15
        $this->namingStrategy = new ShortNameStrategy();
16
    }
17
18
    /**
19
     * @test
20
     * @group command_bus
21
     */
22
    public function returns_matchable_name_of_given_command()
23
    {
24
        $testCommand = new TestCommand();
25
26
        $this->assertNotEquals(get_class($testCommand), $this->namingStrategy->getCommandName($testCommand));
27
    }
28
29
    /**
30
     * @test
31
     * @group command_bus
32
     */
33
    public function returns_matchable_name_of_given_command_handler()
34
    {
35
        $testHandler = new TestCommandHandler();
36
37
        $this->assertStringEndsNotWith('Handler', $this->namingStrategy->getCommandHandlerName($testHandler));
38
        $this->assertNotEquals(get_class($testHandler), $this->namingStrategy->getCommandHandlerName($testHandler));
39
    }
40
}