We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1d9d643 commit 7a364faCopy full SHA for 7a364fa
tests/VectorTest.php
@@ -27,6 +27,22 @@ public function testConstructor()
27
$this->assertInstanceOf(Vector::class, self::buildVector());
28
}
29
30
+ public function testMap()
31
+ {
32
+ $vector = self::buildVector();
33
+
34
+ $mapped = $vector->map(function ($value, $row, $column) {
35
+ return $value + $row + $column;
36
+ });
37
38
+ static::assertInstanceOf(Matrix::class, $mapped);
39
40
+ static::assertEquals(1, $mapped->get(0, 0));
41
+ static::assertEquals(3, $mapped->get(0, 1));
42
+ static::assertEquals(5, $mapped->get(0, 2));
43
+ static::assertEquals(7, $mapped->get(0, 3));
44
+ }
45
46
public function testGetSize()
47
{
48
$vector = self::buildVector();
0 commit comments