/** * Tests calling a missing image operation plugin. */ function testMissingOperation() { // Test that the image factory is set to use the GD toolkit. $this->assertEqual($this->imageFactory->getToolkitId(), 'gd', 'The image factory is set to use the \'gd\' image toolkit.'); // An image file that will be tested. $file = 'image-test.png'; // Load up a fresh image. $image = $this->imageFactory->get(drupal_get_path('module', 'simpletest') . '/files/' . $file); if (!$image->isValid()) { $this->fail(String::format('Could not load image %file.', array('%file' => $file))); } // Try perform a missing toolkit operation. $this->assertFalse($image->apply('missing_op', array()), 'Calling a missing image toolkit operation plugin fails.'); }