diff options
Diffstat (limited to 'tests/vector_test.php')
-rw-r--r-- | tests/vector_test.php | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/vector_test.php b/tests/vector_test.php index 330d607..acab733 100644 --- a/tests/vector_test.php +++ b/tests/vector_test.php @@ -84,6 +84,28 @@ class ezcGraphVectorTest extends ezcTestCase ); } + public function testUnifyNullVector() + { + $vector = new ezcGraphVector( 0, 0 ); + $result = $vector->unify(); + + $this->assertEquals( + 0, + $vector->x + ); + + $this->assertEquals( + 0, + $vector->y + ); + + $this->assertEquals( + $result, + $vector, + 'Result should be the vector itself' + ); + } + public function testVectorMultiplyScalar() { $vector = new ezcGraphVector( 1, 2 ); |