public function setUp() { $this->collection = new Images(); foreach ($this->images as $image) { $factory = new ImageFactory(); $object = $factory->create($image); $this->collection->addImage($object); } }
public function setUp() { $client = new Client(new ApiToken('abcdef')); $this->collection = new Images(); foreach ($this->images as $image) { $factory = new ImageFactory($client->getHttpClient()); $object = $factory->create($image); $this->collection->addImage($object); } }
/** * Create full collection * * @param array $data * @return Images */ public function createImageCollection(array $data = array()) { $collection = new Images(); foreach ($data as $format => $formatCollection) { if (!is_array($formatCollection)) { continue; } foreach ($formatCollection as $item) { if (array_key_exists($format, Image::$formats)) { $item = $this->create($item, $format); $collection->addImage($item); } } } return $collection; }