MappingValueConverterTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 16
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A testConvert() 0 9 1
1
<?php
2
namespace Ddeboer\DataImport\Tests\ValueConverter;
3
4
use Ddeboer\DataImport\ValueConverter\MappingValueConverter;
5
6
class MappingValueConverterTest extends \PHPUnit_Framework_TestCase
7
{
8
    /**
9
     * @expectedException Ddeboer\DataImport\Exception\UnexpectedValueException
10
     * @expectedExceptionMessage Cannot find mapping for value "unexpected value"
11
     */
12
    public function testConvert()
13
    {
14
        $converter = new MappingValueConverter(array(
15
            'source' => 'destination'
16
        ));
17
18
        $this->assertSame('destination', call_user_func($converter, 'source'));
19
        call_user_func($converter, 'unexpected value');
20
    }
21
}
22