Skip to content

Commit 7f5516c

Browse files
committed
Test multiplying matrices of the wrong size.
1 parent bc7f980 commit 7f5516c

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/MatrixTest.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,21 @@ public function testMultiplyMatrix()
254254
static::assertEquals(154, $multiplied->get(1, 1));
255255
}
256256

257+
public function testMultiplyMatrixWrongSizes()
258+
{
259+
$matrix1 = $this->buildMatrix();
260+
261+
$matrix2 = new Matrix([
262+
[4, 2, 6],
263+
[1, 7, 3],
264+
[7, 3, 2],
265+
]);
266+
267+
static::expectException(MatrixException::class);
268+
269+
$matrix1->multiplyMatrix($matrix2);
270+
}
271+
257272
public function testMultiplyScalar()
258273
{
259274
$matrix = new Matrix([

0 commit comments

Comments
 (0)