/** * This method tests the "appendAll" method. * * @dataProvider data_appendAll */ public function test_appendAll(array $provided, array $expected) { $p0 = ILinkedList\Type::make($provided[0], '\\Saber\\Data\\IInt32\\Type'); $p1 = ILinkedList\Type::make($provided[1], '\\Saber\\Data\\IInt32\\Type'); $r0 = ILinkedList\Module::appendAll($p0, $p1); $e0 = $expected[0]; $this->assertInstanceOf('\\Saber\\Data\\ILinkedList\\Type', $r0); $this->assertSame($e0, $r0->unbox(1)); }
/** * This method appends the specified object to this object's collection. Performs in O(n) * time. * * @access public * @static * @param ILinkedList\Type $xs the left operand * @param Core\Type $y the object to be appended * @return ILinkedList\Type the list */ public static function append(ILinkedList\Type $xs, Core\Type $y) : ILinkedList\Type { return ILinkedList\Module::appendAll($xs, ILinkedList\Type::cons($y)); }