diff options
author | Kore Nordmann <github@kore-nordmann.de> | 2007-05-10 07:13:09 +0000 |
---|---|---|
committer | Kore Nordmann <github@kore-nordmann.de> | 2007-05-10 07:13:09 +0000 |
commit | cabd4817dc80cca8ddeb93b40e0cd18b6b3768de (patch) | |
tree | 1654d081e5ea105a2985d2a8d6ce4b6b53d0f516 | |
parent | 4a7bd3ac407a04094fea2c84cfffda534bff5868 (diff) | |
download | zetacomponents-graph-cabd4817dc80cca8ddeb93b40e0cd18b6b3768de.zip zetacomponents-graph-cabd4817dc80cca8ddeb93b40e0cd18b6b3768de.tar.gz |
- Added test for coordinate to string method
- Test __setState for AxisStep struct
-rw-r--r-- | tests/struct_test.php | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/tests/struct_test.php b/tests/struct_test.php index ad7d555..d08e952 100644 --- a/tests/struct_test.php +++ b/tests/struct_test.php @@ -238,5 +238,67 @@ class ezcGraphStructTest extends ezcTestCase 'Wrong value when reading public property y in ezcGraphCoordinate.' ); } + + public function testCoordinateToString() + { + $coordinate = new ezcGraphCoordinate( 2, 5 ); + + $this->assertSame( + '( 2.00, 5.00 )', + (string) $coordinate, + 'Wrong value when converting ezcGraphCoordinate to string.' + ); + } + + public function testStepSetState() + { + $step = new ezcGraphAxisStep(); + + $step->__set_state( + array( + 'position' => .4, + 'width' => .2, + 'label' => 'Label', + 'childs' => array(), + 'isZero' => true, + 'isLast' => false, + ) ); + + $this->assertSame( + .4, + $step->position, + 'Wrong value when reading public property position in ezcGraphContext.' + ); + + $this->assertSame( + .2, + $step->width, + 'Wrong value when reading public property width in ezcGraphContext.' + ); + + $this->assertSame( + 'Label', + $step->label, + 'Wrong value when reading public property label in ezcGraphContext.' + ); + + $this->assertSame( + array(), + $step->childs, + 'Wrong value when reading public property childs in ezcGraphContext.' + ); + + $this->assertSame( + true, + $step->isZero, + 'Wrong value when reading public property isZero in ezcGraphContext.' + ); + + $this->assertSame( + false, + $step->isLast, + 'Wrong value when reading public property isLast in ezcGraphContext.' + ); + } } ?> |