summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorKore Nordmann <github@kore-nordmann.de>2007-01-31 10:19:05 +0000
committerKore Nordmann <github@kore-nordmann.de>2007-01-31 10:19:05 +0000
commitd2590482f69b98dc6200e02ec194ea14f81730a5 (patch)
treecc20ba94567c66c8c678bdfd964941dc65a302ec /tests
parent0160678109ddc1f4887b2c06df73a6de827c9bd2 (diff)
downloadzetacomponents-graph-d2590482f69b98dc6200e02ec194ea14f81730a5.zip
zetacomponents-graph-d2590482f69b98dc6200e02ec194ea14f81730a5.tar.gz
- Renamed rotation methods
- Added tests for vector rotation
Diffstat (limited to 'tests')
-rw-r--r--tests/vector_test.php34
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 );
OpenPOWER on IntegriCloud