| Conditions | 1 |
| Paths | 1 |
| Total Lines | 17 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 16 | public function testMap() |
||
| 17 | { |
||
| 18 | // arrange |
||
| 19 | $source = new Source(); |
||
| 20 | $source->value = null; |
||
| 21 | |||
| 22 | $engine = $this->createEngine(); |
||
| 23 | $engine->createMap(Source::className(), Destination::className()) |
||
| 24 | ->forMember('value', new NullSubstitute('I am null!')); |
||
| 25 | |||
| 26 | // act |
||
| 27 | /** @var Destination $dest */ |
||
| 28 | $dest = $engine->map($source)->toType(Destination::className()); |
||
| 29 | |||
| 30 | // assert |
||
| 31 | $this->assertEquals('I am null!', $dest->value); |
||
| 32 | } |
||
| 33 | } |
||
| 44 |
Having each class in a dedicated file usually plays nice with PSR autoloaders and is therefore a well established practice. If you use other autoloaders, you might not want to follow this rule.