public function shouldSeeThumbnail()
    {
        $thumb = false;

        foreach (['.upload-preview', '.media-thumbnail img', '.image-preview img'] as $selector) {
            if ($thumb) {
                break;
            }

            $thumb = $this->findByCss($selector);
        }

        if (null === $thumb) {
            throw new \Exception('An expected image tag was not found.');
        }

        $file = explode('?', $thumb->getAttribute('src'));
        $file = reset($file);

        $curl = new CurlService();
        list(, $info) = $curl->execute('GET', $file);

        if (empty($info) || strpos($info['content_type'], 'image/') === false) {
            throw new FileNotFoundException(sprintf('%s did not return an image', $file));
        }
    }
public function shouldSeeThumbnail()
    {
        $thumb = false;

        foreach (['.upload-preview', '.media-thumbnail img', '.image-preview img'] as $selector) {
            if ($thumb) {
                break;
            }

            $thumb = $this->findByCss($selector);
        }

        if (null === $thumb) {
            throw new \Exception('An expected image tag was not found.');
        }

        $file = explode('?', $thumb->getAttribute('src'));
        $file = reset($file);

        $curl = new CurlService();
        list(, $info) = $curl->execute('GET', $file);

        if (empty($info) || strpos($info['content_type'], 'image/') === false) {
            throw new FileNotFoundException(sprintf('%s did not return an image', $file));
        }
    }
public function shouldSeeThumbnail ( ) { $ thumb = false ; foreach ( [ '.upload-preview' , '.media-thumbnail img' , '.image-preview img' ] as $ selector ) { if ( $ thumb ) { break ; } $ thumb = $ this -> findByCss ( $ selector ) ; } if ( null === $ thumb ) { throw new \ Exception ( 'An expected image tag was not found.' ) ; } $ file = explode ( '?' , $ thumb -> getAttribute ( 'src' ) ) ; $ file = reset ( $ file ) ; $ curl = new CurlService ( ) ; list ( , $ info ) = $ curl -> execute ( 'GET' , $ file ) ; if ( empty ( $ info ) || strpos ( $ info [ 'content_type' ] , 'image/' ) === false ) { throw new FileNotFoundException ( sprintf ( '%s did not return an image' , $ file ) ) ; } }
Check that an image was uploaded and can be viewed on the page.

@throws \Exception
@throws FileNotFoundException

@Then /^(?:|I )should see the thumbnail$/
Check that an image was uploaded and can be viewed on the page .