/** * @test */ public function unshiftで先頭に要素を追加する() { $expected = ['baz', 'foo', 'bar']; $collection = new Collection(['foo', 'bar']); $sum = $collection->unshift('baz'); $this->assertSame(3, $sum); $this->assertSame($expected, $collection->all()); }
public function testPullRemovesItemFromCollection() { $c = new Collection(['foo', 'bar']); $c->pull(0); $this->assertEquals([1 => 'bar'], $c->all()); }