Completed
Pull Request — master (#294)
by
unknown
08:47
created

MappingValueConverterTest::testConvert()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 3
Bugs 0 Features 0
Metric Value
c 3
b 0
f 0
dl 0
loc 9
rs 9.6666
cc 1
eloc 5
nc 1
nop 0
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