| Conditions | 2 |
| Paths | 2 |
| Total Lines | 23 |
| Code Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php declare(strict_types=1); |
||
| 15 | public function itCanGetAndSetAllTheThings() |
||
| 16 | { |
||
| 17 | $expected = [ |
||
| 18 | FullNameEmbeddableInterface::EMBEDDED_PROP_TITLE => 'Sir', |
||
| 19 | FullNameEmbeddableInterface::EMBEDDED_PROP_FIRSTNAME => 'Roger', |
||
| 20 | FullNameEmbeddableInterface::EMBEDDED_PROP_MIDDLENAMES => [ |
||
| 21 | 'Michael', |
||
| 22 | 'Stephen', |
||
| 23 | "O'Neil", |
||
| 24 | ], |
||
| 25 | FullNameEmbeddableInterface::EMBEDDED_PROP_LASTNAME => 'Marmaduke', |
||
| 26 | FullNameEmbeddableInterface::EMBEDDED_PROP_SUFFIX => 'The Third', |
||
| 27 | ]; |
||
| 28 | $embeddable = new FullNameEmbeddable(); |
||
| 29 | $actual = []; |
||
| 30 | foreach ($expected as $property => $value) { |
||
| 31 | $setter = "set$property"; |
||
| 32 | $getter = "get$property"; |
||
| 33 | $embeddable->$setter($value); |
||
| 34 | $actual[$property] = $embeddable->$getter(); |
||
| 35 | } |
||
| 36 | $this->assertSame($expected, $actual); |
||
| 37 | $this->assertSame('Sir Roger Michael Stephen O\'Neil Marmaduke The Third', $embeddable->getFormatted()); |
||
| 38 | } |
||
| 40 |