diff options
author | Kore Nordmann <github@kore-nordmann.de> | 2007-10-30 09:35:01 +0000 |
---|---|---|
committer | Kore Nordmann <github@kore-nordmann.de> | 2007-10-30 09:35:01 +0000 |
commit | cf584c289cd5a4743b21c0ecd5f7dddee399c60a (patch) | |
tree | 8444c06a897aefe1a6948f87cfe8d592f10d4c47 /tests/font_test.php | |
parent | 6f35d14da96a6276147a6d09e5ff3cdc49e65f6d (diff) | |
download | zetacomponents-graph-cf584c289cd5a4743b21c0ecd5f7dddee399c60a.zip zetacomponents-graph-cf584c289cd5a4743b21c0ecd5f7dddee399c60a.tar.gz |
- Better check for font min/max size values
Diffstat (limited to 'tests/font_test.php')
-rw-r--r-- | tests/font_test.php | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/tests/font_test.php b/tests/font_test.php index 031533b..44de1dc 100644 --- a/tests/font_test.php +++ b/tests/font_test.php @@ -346,6 +346,28 @@ class ezcGraphFontTest extends ezcGraphTestCase $this->fail( 'Expected ezcBaseValueException.' ); } + public function testFontOptionsPropertyMaxFontSizeLowerThenMinFonSize() + { + $options = new ezcGraphFontOptions(); + + $this->assertSame( + 96, + $options->maxFontSize, + 'Wrong default value for property maxFontSize in class ezcGraphFontOptions' + ); + + try + { + $options->maxFontSize = 1; + } + catch ( ezcBaseValueException $e ) + { + return true; + } + + $this->fail( 'Expected ezcBaseValueException.' ); + } + public function testFontOptionsPropertyMinimalUsedFont() { $options = new ezcGraphFontOptions(); @@ -371,6 +393,28 @@ class ezcGraphFontTest extends ezcGraphTestCase ); } + public function testFontOptionsPropertyMinFontSizeGreaterThenMaxFonSize() + { + $options = new ezcGraphFontOptions(); + + $this->assertSame( + 6, + $options->minFontSize, + 'Wrong default value for property minFontSize in class ezcGraphFontOptions' + ); + + try + { + $options->minFontSize = 100; + } + catch ( ezcBaseValueException $e ) + { + return true; + } + + $this->fail( 'Expected ezcBaseValueException.' ); + } + public function testFontOptionsPropertyColor() { $options = new ezcGraphFontOptions(); |