CharsetValueConverterTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A testConvert() 0 11 1
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