diff --git a/core/modules/system/src/Tests/Image/ToolkitGdTest.php b/core/modules/system/src/Tests/Image/ToolkitGdTest.php index 17aeeab..7d4a7c6 100644 --- a/core/modules/system/src/Tests/Image/ToolkitGdTest.php +++ b/core/modules/system/src/Tests/Image/ToolkitGdTest.php @@ -278,9 +278,19 @@ function testManipulations() { } } + // Store the original GD resource. + $old_res = $toolkit->getResource(); + // Perform our operation. $image->apply($values['function'], $values['arguments']); + // If the operation replaced the resource, check that the old one has + // been destroyed. + $new_res = $toolkit->getResource(); + if ($new_res !== $old_res) { + $this->assertFalse(is_resource($old_res), SafeMarkup::format("'%operation' destroyed the original resource.", ['%operation' => $values['function']])); + } + // To keep from flooding the test with assert values, make a general // value for whether each group of values fail. $correct_dimensions_real = TRUE;