summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKore Nordmann <github@kore-nordmann.de>2007-05-10 07:11:06 +0000
committerKore Nordmann <github@kore-nordmann.de>2007-05-10 07:11:06 +0000
commite7468243a48438ce202ef4b365dd44eaecf90e43 (patch)
tree529232c68ca468b3a4720470cc052c76fa5dddde
parentc028b1e38e72a7ec4f67bfe7ac2b457cfbbeb167 (diff)
downloadzetacomponents-graph-e7468243a48438ce202ef4b365dd44eaecf90e43.zip
zetacomponents-graph-e7468243a48438ce202ef4b365dd44eaecf90e43.tar.gz
- Added test for vector angle calculation with null vector
-rw-r--r--tests/vector_test.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/vector_test.php b/tests/vector_test.php
index 01d4ad9..0de9fa6 100644
--- a/tests/vector_test.php
+++ b/tests/vector_test.php
@@ -210,6 +210,18 @@ class ezcGraphVectorTest extends ezcTestCase
);
}
+ public function testVectorAngleVectorZero()
+ {
+ $vector = new ezcGraphVector( 1, 2 );
+ $result = $vector->angle( new ezcGraphVector( 0, 0 ) );
+
+ $this->assertSame(
+ $result,
+ false,
+ 'Expected false because no angle could be calculated.'
+ );
+ }
+
public function testVectorAngle180Vector()
{
$vector = new ezcGraphVector( 1, 0 );
OpenPOWER on IntegriCloud