xref: /imagick/tests/018-clone-length.phpt (revision edb6f41a)
1--TEST--
2Test clone length, this is expected upstream behaviour
3--SKIPIF--
4<?php
5require_once(dirname(__FILE__) . '/skipif.inc');
6
7checkFormatPresent('png');
8
9$v = imagick::getversion ();
10
11if ($v ['versionNumber'] >= 0x640 && $v ['versionNumber'] < 0x650)
12	die ('skip seems to be different in this version of ImageMagick');
13?>
14--FILE--
15<?php
16
17$im = new Imagick ('magick:rose');
18$im->setImageFormat ('png');
19if ($im->getImageLength()) {
20	echo "Image created has length" . PHP_EOL;
21}
22else {
23	echo "Image created has zero length" . PHP_EOL;
24}
25
26$cloned = clone $im;
27$cloned->setImageFormat ('png');
28
29var_dump ($cloned->getImageLength ());
30
31?>
32--EXPECT--
33Image created has length
34int(0)
35