/** * @test * @covers Cocur\Collection\Item::create() */ public function createCreatesItemWithValue() { $item = Item::create('foobar'); $this->assertInstanceOf('Cocur\\Collection\\Item', $item); $this->assertSame('foobar', $item->getValue()); }
/** * @param mixed $item * * @return Item */ public function convert($item) { $item = Item::create($item); $this->collection->add($item); return $item; }