Skip to content

Commit

Permalink
testScalarProduct check for non numeric values (#13)
Browse files Browse the repository at this point in the history
* testScalarProduct check for non numeric values

test for non numeric values.

* updating pr #13

using global namespace fro stdClass
  • Loading branch information
PabloJoan authored and akondas committed Jul 26, 2016
1 parent 403824d commit 38deaae
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/Phpml/Math/ProductTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,8 @@ public function testScalarProduct()
$this->assertEquals(10, Product::scalar([2, 3], [-1, 4]));
$this->assertEquals(-0.1, Product::scalar([1, 4, 1], [-2, 0.5, -0.1]));
$this->assertEquals(8, Product::scalar([2], [4]));

//test for non numeric values
$this->assertEquals(0, Product::scalar(['', null, [], new \stdClass()], [null]));
}
}

0 comments on commit 38deaae

Please sign in to comment.