SimpleArrayTransformerTest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 1
cbo 2
dl 0
loc 27
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 4 1
A testTransform() 0 8 1
A testTransformNull() 0 5 1
1
<?php
2
3
namespace EmanueleMinotto\SimpleArrayBundle\Tests\Form\DataTransformer;
4
5
use EmanueleMinotto\SimpleArrayBundle\Form\DataTransformer\SimpleArrayTransformer;
6
use PHPUnit_Framework_TestCase;
7
8
class SimpleArrayTransformerTest extends PHPUnit_Framework_TestCase
9
{
10
    /**
11
     * @var SimpleArrayTransformer
12
     */
13
    protected $object;
14
15
    public function setUp()
16
    {
17
        $this->object = new SimpleArrayTransformer();
18
    }
19
20
    public function testTransform()
21
    {
22
        $value = range('a', 'z');
23
        shuffle($value);
24
25
        $transformation = $this->object->transform($value);
26
        $this->assertSame(implode(', ', $value), $transformation);
27
    }
28
29
    public function testTransformNull()
30
    {
31
        $transformation = $this->object->transform(null);
32
        $this->assertSame('', $transformation);
33
    }
34
}
35