CharsetValueConverterTest::testConvert()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 11
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 7
nc 1
nop 0
1
<?php
2
namespace Ddeboer\DataImport\Tests\ValueConverter;
3
4
use Ddeboer\DataImport\ValueConverter\CharsetValueConverter;
5
6
/**
7
 * @author Markus Bachmann <[email protected]>
8
 */
9
class CharsetValueConverterTest extends \PHPUnit_Framework_TestCase
10
{
11
    public function testConvert()
12
    {
13
        $utf8 = utf8_encode('test');
14
15
        $converter = new CharsetValueConverter('UTF-8');
16
        $this->assertEquals($utf8, call_user_func($converter, $utf8));
17
18
        $value = iconv('UTF-8', 'UTF-16', $utf8);
19
        $converter = new CharsetValueConverter('UTF-8', 'UTF-16');
20
        $this->assertEquals($utf8, call_user_func($converter, $value));
21
    }
22
}
23