| Conditions | 1 |
| Paths | 1 |
| Total Lines | 20 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 26 | public function test_transformInboundValue_Datetime() |
||
| 27 | { |
||
| 28 | $book = new Book(); |
||
| 29 | $date = date('Y-m-d'); |
||
| 30 | $book->published = $date; |
||
| 31 | |||
| 32 | $dateGet = $book->published; |
||
| 33 | self::assertInstanceOf(\DateTime::class, $dateGet); |
||
| 34 | self::assertSame($date, $dateGet->format('Y-m-d')); |
||
| 35 | self::assertSame($date . ' 00:00:00', $book->getPropertyRaw('published')); |
||
| 36 | |||
| 37 | $book = new Book(); |
||
| 38 | $date = Date::now(); |
||
| 39 | $book->published = $date; |
||
| 40 | |||
| 41 | $dateGet = $book->published; |
||
| 42 | $dateFormatted = $dateGet->format('Y-m-d H:i:s'); |
||
| 43 | self::assertInstanceOf(\DateTime::class, $dateGet); |
||
| 44 | self::assertSame($dateFormatted, $dateGet->format('Y-m-d H:i:s')); |
||
| 45 | self::assertSame($dateFormatted, $book->getPropertyRaw('published')); |
||
| 46 | } |
||
| 48 |