getTestImageForOperation example

$toolkit = $this->getToolkitMock();
    $image = new Image($toolkit, 'magic-foobar.png');

    $this->assertFalse($image->isValid());
    $this->assertFalse($image->save());
  }

  /** * Tests \Drupal\Core\Image\Image::scale(). */
  public function testScaleWidth() {
    $this->getTestImageForOperation('Scale');
    $this->toolkitOperation->expects($this->once())
      ->method('execute')
      ->will($this->returnArgument(0));

    $ret = $this->image->scale(44, NULL, FALSE);
    $this->assertEquals(50, $ret['height']);
  }

  /** * Tests \Drupal\Core\Image\Image::scale(). */
  
Home | Imprint | This part of the site doesn't use cookies.