ShortNameStrategyTest::setUp()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
rs 10
cc 1
eloc 2
nc 1
nop 0
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
}