ActionTest::testGetLabel()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 9
rs 9.9666
c 0
b 0
f 0
cc 1
nc 1
nop 0
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