public function testMultiplyException() { $m1 = new Matrix([[1, 2, 3], [4, 5, 6]]); $m2 = new Matrix([[7, 8], [9, 10]]); try { $m1->multiply($m2); } catch (MatrixException $exception) { return; } $this->fail('MatrixException not raised.'); }
/** * @expectedException \DomainException */ public function testMultiplyException() { $arr1 = [[2, 0, -1, 1], [1, 2, 0, 1]]; $arr2 = [[1, 5, -7], [1, 1, 0], [0, -1, 1]]; $mat1 = new Matrix($arr1); $mat2 = new Matrix($arr2); $mat1->multiply($mat2); //the above should throw an exception! }