summaryrefslogtreecommitdiffstats
path: root/tests/palette_test.php
diff options
context:
space:
mode:
authorKore Nordmann <github@kore-nordmann.de>2006-09-20 09:59:56 +0000
committerKore Nordmann <github@kore-nordmann.de>2006-09-20 09:59:56 +0000
commitda06e1ce094169abdcd0ab4df70180fc1a4988cd (patch)
tree44fc4abcc8a8312d2ea01c4c0c9ae1415467e760 /tests/palette_test.php
parent593169b297351ac5f2a40b800a308eed4fd99955 (diff)
downloadzetacomponents-graph-da06e1ce094169abdcd0ab4df70180fc1a4988cd.zip
zetacomponents-graph-da06e1ce094169abdcd0ab4df70180fc1a4988cd.tar.gz
- Made palette properties writeable
- Fixed wrong parameters
Diffstat (limited to 'tests/palette_test.php')
-rw-r--r--tests/palette_test.php90
1 files changed, 90 insertions, 0 deletions
diff --git a/tests/palette_test.php b/tests/palette_test.php
index bb57b0e..892d683 100644
--- a/tests/palette_test.php
+++ b/tests/palette_test.php
@@ -337,6 +337,96 @@ class ezcGraphPaletteTest extends ezcTestCase
'Chart background not set from pallet.'
);
}
+
+ public function testModifyPaletteColorProperty()
+ {
+ $palette = new ezcGraphPaletteTango();
+
+ $palette->axisColor = '#FFFFFF';
+ $palette->majorGridColor = array( 255, 255, 255, 255 );
+ $palette->minorGridColor = ezcGraphColor::fromHex( '#00000000' );
+
+ $this->assertEquals(
+ $palette->axisColor,
+ ezcGraphColor::fromHex( '#FFFFFF' )
+ );
+
+ try
+ {
+ $palette->axisColor = false;
+ }
+ catch ( ezcGraphUnknownColorDefinitionException $e )
+ {
+ return true;
+ }
+
+ $this->fail( 'expected ezcGraphUnknownColorDefinitionException.' );
+ }
+
+ public function testModifyPaletteIntProperty()
+ {
+ $palette = new ezcGraphPaletteTango();
+
+ $palette->chartBorderWidth = 0;
+ $palette->padding = -1;
+ $palette->margin = 3;
+
+ $this->assertSame( $palette->chartBorderWidth, 0 );
+ $this->assertSame( $palette->padding, 0 );
+ $this->assertSame( $palette->margin, 3 );
+ }
+
+ public function testModifyPaletteDatasetColorArray()
+ {
+ $palette = new ezcGraphPaletteTango();
+
+ $palette->dataSetColor = array(
+ '#ABCDEF',
+ array( 255, 255, 255 ),
+ );
+
+ $this->assertEquals(
+ $palette->dataSetColor,
+ ezcGraphColor::fromHex( '#ABCDEF' )
+ );
+
+ try
+ {
+ $palette->dataSetColor = '#FFFFFF';
+ }
+ catch ( ezcBaseValueException $e )
+ {
+ return true;
+ }
+
+ $this->fail( 'expected ezcBaseValueException.' );
+ }
+
+ public function testModifyPaletteDatasetSymbolArray()
+ {
+ $palette = new ezcGraphPaletteTango();
+
+ $palette->dataSetSymbol = array(
+ ezcGraph::BULLET,
+ ezcGraph::CIRCLE
+ );
+
+ $this->assertSame(
+ $palette->dataSetSymbol,
+ ezcGraph::BULLET
+ );
+
+ try
+ {
+ $palette->dataSetSymbol = ezcGraph::BULLET;
+ }
+ catch ( ezcBaseValueException $e )
+ {
+ return true;
+ }
+
+ $this->fail( 'expected ezcBaseValueException.' );
+ }
}
?>
OpenPOWER on IntegriCloud