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
This commit is contained in:
Pablo Joán Iglesias 2016-07-26 02:13:52 -04:00 committed by Arkadiusz Kondas
parent 403824d23b
commit 38deaaeb2e

View File

@ -13,5 +13,8 @@ class ProductTest extends \PHPUnit_Framework_TestCase
$this->assertEquals(10, Product::scalar([2, 3], [-1, 4])); $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(-0.1, Product::scalar([1, 4, 1], [-2, 0.5, -0.1]));
$this->assertEquals(8, Product::scalar([2], [4])); $this->assertEquals(8, Product::scalar([2], [4]));
//test for non numeric values
$this->assertEquals(0, Product::scalar(['', null, [], new \stdClass()], [null]));
} }
} }