summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKore Nordmann <github@kore-nordmann.de>2006-11-30 15:46:51 +0000
committerKore Nordmann <github@kore-nordmann.de>2006-11-30 15:46:51 +0000
commit052165cca269587641656e9c9714343f2f5b3cf7 (patch)
treedce2541676aaa15336fefdf375c47f0c7fc8aa6f
parenta7df5bda8d5f00fee28a288fb078d936787fe524 (diff)
downloadzetacomponents-graph-052165cca269587641656e9c9714343f2f5b3cf7.zip
zetacomponents-graph-052165cca269587641656e9c9714343f2f5b3cf7.tar.gz
- Removed initial font path value
-rw-r--r--src/options/font.php3
-rw-r--r--tests/font_test.php25
-rw-r--r--tests/image_map_test.php1
3 files changed, 23 insertions, 6 deletions
diff --git a/src/options/font.php b/src/options/font.php
index 0f6a3d8..619b8c1 100644
--- a/src/options/font.php
+++ b/src/options/font.php
@@ -62,7 +62,8 @@ class ezcGraphFontOptions extends ezcBaseOptions
public function __construct( array $options = array() )
{
$this->properties['name'] = 'sans-serif';
- $this->properties['path'] = 'Graph/tests/data/font.ttf';
+// $this->properties['path'] = 'Graph/tests/data/font.ttf';
+ $this->properties['path'] = '';
$this->properties['type'] = ezcGraph::TTF_FONT;
$this->properties['minFontSize'] = 6;
diff --git a/tests/font_test.php b/tests/font_test.php
index 20e8eb1..460c64d 100644
--- a/tests/font_test.php
+++ b/tests/font_test.php
@@ -204,11 +204,26 @@ class ezcGraphFontTest extends ezcTestCase
{
$options = new ezcGraphFontOptions();
- $this->assertSame(
- dirname( __FILE__ ) . '/data/font.ttf',
- $options->path,
- 'Wrong default value for property path in class ezcGraphFontOptions'
- );
+ try
+ {
+ $catched = false;
+ $options->path;
+ }
+ catch( ezcBaseFileNotFoundException $e )
+ {
+ $catched = true;
+
+ $this->assertEquals(
+ $e->getMessage(),
+ 'The font file \'\' could not be found.',
+ 'Wrong default content mentioned in exception.'
+ );
+ }
+
+ if ( !$catched )
+ {
+ $this->fail( 'Expected ezcBaseFileNotFoundException.' );
+ }
$options->path = $file = dirname( __FILE__ ) . '/data/font2.ttf';
$this->assertSame(
diff --git a/tests/image_map_test.php b/tests/image_map_test.php
index 437613c..92cf5b4 100644
--- a/tests/image_map_test.php
+++ b/tests/image_map_test.php
@@ -140,6 +140,7 @@ class ezcGraphImageMapTest extends ezcTestCase
$chart = new ezcGraphLineChart();
$chart->driver = new ezcGraphGdDriver();
+ $chart->options->font->path = dirname( __FILE__ ) . '/data/font.ttf';
$chart->palette = new ezcGraphPaletteBlack();
$chart->data['sampleData'] = new ezcGraphArrayDataSet( array( 'sample 1' => 234, 'sample 2' => 21, 'sample 3' => 324, 'sample 4' => 120, 'sample 5' => 1) );
OpenPOWER on IntegriCloud