summaryrefslogtreecommitdiffstats
path: root/tests/matrix_test.php
diff options
context:
space:
mode:
authorKore Nordmann <github@kore-nordmann.de>2006-10-27 12:20:08 +0000
committerKore Nordmann <github@kore-nordmann.de>2006-10-27 12:20:08 +0000
commit1d0cc07e07709c1bc59bbbf591c23b846d4fce57 (patch)
tree6fd25f9e61f166ea85df2a8ca8742e8e0488c1e9 /tests/matrix_test.php
parentea523b19b2f15e5c08541897a9685f94ff4ebbae (diff)
downloadzetacomponents-graph-1d0cc07e07709c1bc59bbbf591c23b846d4fce57.zip
zetacomponents-graph-1d0cc07e07709c1bc59bbbf591c23b846d4fce57.tar.gz
- Added more tests
Diffstat (limited to 'tests/matrix_test.php')
-rw-r--r--tests/matrix_test.php31
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/matrix_test.php b/tests/matrix_test.php
index 2135320..63bafda 100644
--- a/tests/matrix_test.php
+++ b/tests/matrix_test.php
@@ -146,6 +146,22 @@ class ezcGraphMatrixTest extends ezcTestCase
);
}
+ public function testDiffIncopatibleMatrices()
+ {
+ $matrix = new ezcGraphMatrix();
+
+ try
+ {
+ $matrix->diff( new ezcGraphMatrix( 2, 4 ) );
+ }
+ catch ( ezcGraphMatrixInvalidDimensionsException $e )
+ {
+ return true;
+ }
+
+ $this->fail( 'Expected ezcGraphMatrixInvalidDimensionsException.' );
+ }
+
public function testAddIncompatibleMatrices()
{
$matrix = new ezcGraphMatrix();
@@ -303,6 +319,21 @@ class ezcGraphMatrixTest extends ezcTestCase
$polynom->__toString()
);
}
+
+ public function testMatrixToString()
+ {
+ $matrix = new ezcGraphMatrix();
+
+ $this->assertEquals(
+'3 x 3 matrix:
+| 1.00 0.00 0.00 |
+| 0.00 1.00 0.00 |
+| 0.00 0.00 1.00 |
+',
+ (string) $matrix,
+ 'Incorrect output for matrix.'
+ );
+ }
}
?>
OpenPOWER on IntegriCloud