public function ImageTest::testSave in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/tests/Drupal/Tests/Core/Image/ImageTest.php \Drupal\Tests\Core\Image\ImageTest::testSave()
Tests \Drupal\Core\Image\Image::save().
File
- core/
tests/ Drupal/ Tests/ Core/ Image/ ImageTest.php, line 208 - Contains \Drupal\Tests\Core\Image\ImageTest.
Class
- ImageTest
- Tests the image class.
Namespace
Drupal\Tests\Core\ImageCode
public function testSave() {
$this
->getTestImage();
// This will fail if save() method isn't called on the toolkit.
$toolkit = $this
->getToolkitMock();
$toolkit
->expects($this
->once())
->method('save')
->will($this
->returnValue(TRUE));
$image = $this
->getMock('Drupal\\Core\\Image\\Image', array(
'chmod',
), array(
$toolkit,
$this->image
->getSource(),
));
$image
->expects($this
->any())
->method('chmod')
->will($this
->returnValue(TRUE));
$image
->save();
}