From 38deaaeb2ed2ab2d5b3e7fe3e69fcce3c174c8ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Jo=C3=A1n=20Iglesias?= Date: Tue, 26 Jul 2016 02:13:52 -0400 Subject: [PATCH] testScalarProduct check for non numeric values (#13) * testScalarProduct check for non numeric values test for non numeric values. * updating pr #13 using global namespace fro stdClass --- tests/Phpml/Math/ProductTest.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/Phpml/Math/ProductTest.php b/tests/Phpml/Math/ProductTest.php index aba0ff2..05ca5b5 100644 --- a/tests/Phpml/Math/ProductTest.php +++ b/tests/Phpml/Math/ProductTest.php @@ -13,5 +13,8 @@ class ProductTest extends \PHPUnit_Framework_TestCase $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])); } }