summaryrefslogtreecommitdiffstats
path: root/tests/pie_test.php
diff options
context:
space:
mode:
authorKore Nordmann <github@kore-nordmann.de>2006-10-26 14:08:20 +0000
committerKore Nordmann <github@kore-nordmann.de>2006-10-26 14:08:20 +0000
commitb6069cc0bfb2a7baaf2e79263cfc9c222d9e8299 (patch)
treea59d5e0b75fefd08ece3c927211f6f6e965e7933 /tests/pie_test.php
parent7e56dbbe610469d173133cc6f2d19da5039079bb (diff)
downloadzetacomponents-graph-b6069cc0bfb2a7baaf2e79263cfc9c222d9e8299.zip
zetacomponents-graph-b6069cc0bfb2a7baaf2e79263cfc9c222d9e8299.tar.gz
- Added some more tests for read and write accesss on properties
Diffstat (limited to 'tests/pie_test.php')
-rw-r--r--tests/pie_test.php90
1 files changed, 90 insertions, 0 deletions
diff --git a/tests/pie_test.php b/tests/pie_test.php
index 60ea879..1cc5d83 100644
--- a/tests/pie_test.php
+++ b/tests/pie_test.php
@@ -72,6 +72,96 @@ class ezcGraphPieChartTest extends ezcImageTestCase
}
}
+ public function testPieChartOptionsPropertyLabel()
+ {
+ $options = new ezcGraphPieChartOptions();
+
+ $this->assertSame(
+ '%1$s: %2$d (%3$.1f%%)',
+ $options->label,
+ 'Wrong default value for property label in class ezcGraphPieChartOptions'
+ );
+
+ $options->label = '%1$s';
+ $this->assertSame(
+ '%1$s',
+ $options->label,
+ 'Setting property value did not work for property label in class ezcGraphPieChartOptions'
+ );
+ }
+
+ public function testPieChartOptionsPropertySum()
+ {
+ $options = new ezcGraphPieChartOptions();
+
+ $this->assertSame(
+ false,
+ $options->sum,
+ 'Wrong default value for property sum in class ezcGraphPieChartOptions'
+ );
+
+ $options->sum = 100;
+ $this->assertSame(
+ 100.,
+ $options->sum,
+ 'Setting property value did not work for property sum in class ezcGraphPieChartOptions'
+ );
+ }
+
+ public function testPieChartOptionsPropertyPercentTreshHold()
+ {
+ $options = new ezcGraphPieChartOptions();
+
+ $this->assertSame(
+ 0.,
+ $options->percentTreshHold,
+ 'Wrong default value for property percentTreshHold in class ezcGraphPieChartOptions'
+ );
+
+ $options->percentTreshHold = .5;
+ $this->assertSame(
+ .5,
+ $options->percentTreshHold,
+ 'Setting property value did not work for property percentTreshHold in class ezcGraphPieChartOptions'
+ );
+ }
+
+ public function testPieChartOptionsPropertyAbsoluteTreshHold()
+ {
+ $options = new ezcGraphPieChartOptions();
+
+ $this->assertSame(
+ 0.,
+ $options->absoluteTreshHold,
+ 'Wrong default value for property absoluteTreshHold in class ezcGraphPieChartOptions'
+ );
+
+ $options->absoluteTreshHold = 5;
+ $this->assertSame(
+ 5.,
+ $options->absoluteTreshHold,
+ 'Setting property value did not work for property absoluteTreshHold in class ezcGraphPieChartOptions'
+ );
+ }
+
+ public function testPieChartOptionsPropertySummarizeCaption()
+ {
+ $options = new ezcGraphPieChartOptions();
+
+ $this->assertSame(
+ 'Misc',
+ $options->summarizeCaption,
+ 'Wrong default value for property summarizeCaption in class ezcGraphPieChartOptions'
+ );
+
+ $options->summarizeCaption = 'Others';
+ $this->assertSame(
+ 'Others',
+ $options->summarizeCaption,
+ 'Setting property value did not work for property summarizeCaption in class ezcGraphPieChartOptions'
+ );
+ }
+
public function testElementGenerationLegend()
{
$chart = new ezcGraphPieChart();
OpenPOWER on IntegriCloud