diff options
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | src/options/pie_chart.php | 2 | ||||
-rw-r--r-- | tests/pie_test.php | 10 |
3 files changed, 11 insertions, 3 deletions
@@ -26,6 +26,8 @@ - Added feature #9404: Add spport for rotated texts on axis. - Fixed issue #10536: Bar side polygones are drawn at the wrong side. - Fixed issue #10584: API Doc for ezcGraphPdoDataSet::createFromPdo() is wrong +- Fixed issue #10599: Pie chart label formattig callback only accepts callback + functions but neither static nor non static methods. 1.0 - Monday 18 December 2006 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/options/pie_chart.php b/src/options/pie_chart.php index ed4bbdb..c975bf9 100644 --- a/src/options/pie_chart.php +++ b/src/options/pie_chart.php @@ -72,7 +72,7 @@ class ezcGraphPieChartOptions extends ezcGraphChartOptions $this->properties['label'] = (string) $propertyValue; break; case 'labelCallback': - if ( is_string( $propertyValue ) && ezcBaseFeatures::hasFunction( $propertyValue ) ) + if ( is_callable( $propertyValue ) ) { $this->properties['labelCallback'] = $propertyValue; } diff --git a/tests/pie_test.php b/tests/pie_test.php index 9aa5588..a4aa790 100644 --- a/tests/pie_test.php +++ b/tests/pie_test.php @@ -69,12 +69,11 @@ class ezcGraphPieChartTest extends ezcGraphTestCase { $options = new ezcGraphPieChartOptions(); -/* Checking for null values does not work with current ezcBaseOptions class $this->assertSame( null, $options->labelCallback, 'Wrong default value for property labelCallback in class ezcGraphPieChartOptions' - ); */ + ); $options->labelCallback = 'printf'; $this->assertSame( @@ -83,6 +82,13 @@ class ezcGraphPieChartTest extends ezcGraphTestCase 'Setting property value did not work for property labelCallback in class ezcGraphPieChartOptions' ); + $options->labelCallback = array( $this, __METHOD__ ); + $this->assertSame( + array( $this, __METHOD__ ), + $options->labelCallback, + 'Setting property value did not work for property labelCallback in class ezcGraphPieChartOptions' + ); + try { $options->labelCallback = 'undefined_function'; |