[wp-trac] [WordPress Trac] #36587: PHPUnit Tests fail with PHP7 and Imagick 3.4.x
WordPress Trac
noreply at wordpress.org
Wed Apr 20 07:28:47 UTC 2016
#36587: PHPUnit Tests fail with PHP7 and Imagick 3.4.x
--------------------------+--------------------
Reporter: alpipego | Owner:
Type: defect (bug) | Status: new
Priority: high | Milestone: 4.6
Component: Media | Version: trunk
Severity: normal | Resolution:
Keywords: | Focuses:
--------------------------+--------------------
Comment (by dd32):
Did lots more digging, and is definitely caused by the extension or PHP
internals and isn't a WordPress nor PHPUnit bug.
https://github.com/mkoppanen/imagick/issues/147#issuecomment-212297265
I'll copy it here for future reference:
> The debug log from that PHPUnit run had a huge number of issues, but
unfortunately it's definitely all caused by the Imagick extension (or
potentially a bug within PHP itself). The reason the log was so full was
that once a Imagick exception is triggered, every PHP warning thereafter
is thrown as a ImagickException (where it shouldn't be thrown at all).
>
> Here's a minimal script to reproduce it:
>
> {{{
> <?php
> error_reporting( E_ALL ); ini_set( "display_errors", true );
>
> try {
> $f = new Imagick( 'http://any/url/here' );
> } catch( Exception $imagick_exception ) {
> var_dump( compact( 'imagick_exception' ) );
> }
>
> getimagesize( "something here" );
> }}}
>
> What you'd expect to see here is the imagick_exception data followed by
a PHP Warning, instead you get the imagick_exception data followed by a
PHP Fatal:
>
> {{{ Fatal error: Uncaught ImagickException: getimagesize(something
here): failed to open stream: No such file or directory}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/36587#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list