/** * @throws \Exception * @internal param $original * @internal param $proxy */ public function test_batch_returns_size_and_type() { $data = $this->linksProvider(); $expected = []; $uris = []; foreach ($data as $link) { $uri = current($link); $width = next($link); $height = next($link); $type = next($link); $uris[] = $uri; $expected[$uri] = compact('width', 'height', 'type'); } $client = new \FasterImage\FasterImage(); $client->setTimeout(120); $images = $client->batch($uris); foreach ($images as $uri => $image) { $this->assertEquals($expected[$uri]['type'], $image['type'], "Failed to get the right type for {$uri}"); $this->assertArrayHasKey('size', $image, "There is no size defined for {$uri}"); $this->assertEquals($expected[$uri]['width'], $image['size'][0], "Failed to get the right width for {$uri}"); $this->assertEquals($expected[$uri]['height'], $image['size'][1], "Failed to get the right height for {$uri}"); } }