Conditions | 1 |
Paths | 1 |
Total Lines | 40 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
17 | public function test() |
||
18 | { |
||
19 | $data = array( |
||
20 | array( |
||
21 | 'foo' => 'bar', |
||
22 | 'baz' => array( |
||
23 | 'some' => 'value' |
||
24 | ) |
||
25 | ) |
||
26 | ); |
||
27 | $targetData = array(); |
||
28 | |||
29 | $sourceStorage = new ArrayStorage($data); |
||
30 | $targetStorage = new ArrayStorage($targetData); |
||
31 | |||
32 | $importer = Importer::build($targetStorage); |
||
33 | |||
34 | $importConfiguration = new ImportConfiguration(); |
||
35 | $importRun = $importConfiguration->toRun(); |
||
36 | |||
37 | $import = Import::build($importer, $sourceStorage, $importRun); |
||
38 | $import |
||
39 | ->mappings() |
||
40 | ->add('foo', 'fooloo') |
||
41 | ->add('baz', array('some' => 'else')); |
||
42 | |||
43 | ImportRunner::build() |
||
44 | ->run($import); |
||
45 | |||
46 | $expectedData = array( |
||
47 | array( |
||
48 | 'fooloo' => 'bar', |
||
49 | 'baz' => array( |
||
50 | 'else' => 'value' |
||
51 | ) |
||
52 | ) |
||
53 | ); |
||
54 | |||
55 | $this->assertEquals($expectedData, $targetData); |
||
56 | } |
||
57 | |||
59 |