summaryrefslogtreecommitdiffstats
path: root/tests/boundings_test.php
diff options
context:
space:
mode:
authorKore Nordmann <github@kore-nordmann.de>2006-09-21 14:43:39 +0000
committerKore Nordmann <github@kore-nordmann.de>2006-09-21 14:43:39 +0000
commit32312948a38a01428667d5e0bf0ae9cb501a82e9 (patch)
tree49137e61c0bd1b25a8393983d36535550803f81e /tests/boundings_test.php
parentefdd5fa7089be6d78f5d58b50b86675b8c8a1f81 (diff)
downloadzetacomponents-graph-32312948a38a01428667d5e0bf0ae9cb501a82e9.zip
zetacomponents-graph-32312948a38a01428667d5e0bf0ae9cb501a82e9.tar.gz
- Added ezcGraphBoundings tests
Diffstat (limited to 'tests/boundings_test.php')
-rw-r--r--tests/boundings_test.php54
1 files changed, 54 insertions, 0 deletions
diff --git a/tests/boundings_test.php b/tests/boundings_test.php
new file mode 100644
index 0000000..2577b58
--- /dev/null
+++ b/tests/boundings_test.php
@@ -0,0 +1,54 @@
+<?php
+/**
+ * ezcGraphBoundingsTest
+ *
+ * @package Graph
+ * @version //autogen//
+ * @subpackage Tests
+ * @copyright Copyright (C) 2005, 2006 eZ systems as. All rights reserved.
+ * @license http://ez.no/licenses/new_bsd New BSD License
+ */
+
+/**
+ * Tests for ezcGraph class.
+ *
+ * @package ImageAnalysis
+ * @subpackage Tests
+ */
+class ezcGraphBoundingsTest extends ezcTestCase
+{
+ public static function suite()
+ {
+ return new ezcTestSuite( "ezcGraphBoundingsTest" );
+ }
+
+ public function testCreateBoundings()
+ {
+ $boundings = new ezcGraphBoundings( 0, 1, 10, 11 );
+
+ $this->assertEquals( $boundings->x0, 0 );
+ $this->assertEquals( $boundings->y0, 1 );
+ $this->assertEquals( $boundings->x1, 10 );
+ $this->assertEquals( $boundings->y1, 11 );
+ }
+
+ public function testPseudoProperties()
+ {
+ $boundings = new ezcGraphBoundings( 0, 1, 10, 21 );
+
+ $this->assertEquals( $boundings->width, 10 );
+ $this->assertEquals( $boundings->height, 20 );
+ }
+
+ public function testCreateReverseBoundings()
+ {
+ $boundings = new ezcGraphBoundings( 10, 11, 0, 1 );
+
+ $this->assertEquals( $boundings->x0, 0 );
+ $this->assertEquals( $boundings->y0, 1 );
+ $this->assertEquals( $boundings->x1, 10 );
+ $this->assertEquals( $boundings->y1, 11 );
+ }
+}
+
+?>
OpenPOWER on IntegriCloud