diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/vector_test.php | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/vector_test.php b/tests/vector_test.php index 73ecd02..9dd6a6b 100644 --- a/tests/vector_test.php +++ b/tests/vector_test.php @@ -106,6 +106,40 @@ class ezcGraphVectorTest extends ezcTestCase ); } + public function testVectorRotateClockwise() + { + $vector = new ezcGraphVector( 1, 2 ); + $result = $vector->rotateClockwise(); + + $this->assertEquals( + $result, + new ezcGraphVector( -2, 1 ) + ); + + $this->assertEquals( + $result, + $vector, + 'Result should be the vector itself' + ); + } + + public function testVectorRotateCounterClockwise() + { + $vector = new ezcGraphVector( 1, 2 ); + $result = $vector->rotateCounterClockwise(); + + $this->assertEquals( + $result, + new ezcGraphVector( 2, -1 ) + ); + + $this->assertEquals( + $result, + $vector, + 'Result should be the vector itself' + ); + } + public function testVectorMultiplyCoordinate() { $vector = new ezcGraphVector( 1, 2 ); |