ActionTest   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A testGetName() 0 9 1
A testGetLabel() 0 9 1
A checkAction() 0 7 2
1
<?php
2
3
namespace Admingenerator\GeneratorBundle\Tests\Generator;
4
5
use Admingenerator\GeneratorBundle\Tests\TestCase;
6
use Admingenerator\GeneratorBundle\Generator\Action;
7
8
class ActionTest extends TestCase
9
{
10
11
    public function testGetName()
12
    {
13
        $from_to_array = array(
14
            'name' => 'name',
15
            'underscored_name' => 'underscored_name',
16
        );
17
18
        $this->checkAction($from_to_array, 'getName');
19
    }
20
21
    public function testGetLabel()
22
    {
23
        $from_to_array = array(
24
            'name' => 'Name',
25
            'underscored_name' => 'Underscored name',
26
        );
27
28
        $this->checkAction($from_to_array, 'getLabel');
29
    }
30
31
    /**
32
     * @param string $method
33
     */
34
    protected function checkAction($from_to_array, $method)
35
    {
36
        foreach ($from_to_array as $from => $to) {
37
            $action = new Action($from);
38
            $this->assertEquals($to, $action->$method());
39
        }
40
    }
41
42
}
43