| Conditions | 1 |
| Paths | 1 |
| Total Lines | 21 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 26 | public static function testRotatingLeftAndRight() |
||
| 27 | { |
||
| 28 | $direction = new Direction(); |
||
| 29 | self::assertEquals('E', $direction->getDirectionAsString()); |
||
| 30 | |||
| 31 | // Counter clockwise |
||
| 32 | $direction->rotateLeft(); |
||
| 33 | self::assertEquals('N', $direction->getDirectionAsString()); |
||
| 34 | |||
| 35 | // Clockwise 180deg |
||
| 36 | $direction->rotateRight()->rotateRight(); |
||
| 37 | self::assertEquals('S', $direction->getDirectionAsString()); |
||
| 38 | |||
| 39 | $direction->rotateRight() // 'W' |
||
| 40 | ->rotateLeft() // 'S' |
||
| 41 | ->rotateLeft() // 'E' |
||
| 42 | ->rotateLeft() // 'N' |
||
| 43 | ->rotateLeft(); // 'W' |
||
| 44 | |||
| 45 | self::assertEquals('W', $direction->getDirectionAsString()); |
||
| 46 | } |
||
| 47 | } |
||
| 48 |