summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorKore Nordmann <github@kore-nordmann.de>2007-02-01 12:19:17 +0000
committerKore Nordmann <github@kore-nordmann.de>2007-02-01 12:19:17 +0000
commitfbe8284433d09070d388c226d07d024f63fa6464 (patch)
treef9e1d9aa56e8af6d8139118c0e1ceaa9cec0ed94 /tests
parentecef8638e0f565059960214f384430b07ce723a2 (diff)
downloadzetacomponents-graph-fbe8284433d09070d388c226d07d024f63fa6464.zip
zetacomponents-graph-fbe8284433d09070d388c226d07d024f63fa6464.tar.gz
. Test unify for vector with zero length
Diffstat (limited to 'tests')
-rw-r--r--tests/vector_test.php22
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 );
OpenPOWER on IntegriCloud