protected function ImageReplaceTestBase::imageIsOriginal in Image Replace 7
Same name and namespace in other branches
- 8 src/Tests/ImageReplaceTestBase.php \Drupal\image_replace\Tests\ImageReplaceTestBase::imageIsOriginal()
Returns TRUE if the image pointed at by the URI is the original image.
4 calls to ImageReplaceTestBase::imageIsOriginal()
- AdminTest::testFieldEditUi in src/
Tests/ AdminTest.php - Tests image replacement on node entities.
- EntityTest::testNodeView in src/
Tests/ EntityTest.php - Tests image replacement on node entities.
- ImageReplaceTestBase::createTestFiles in src/
Tests/ ImageReplaceTestBase.php - Create a pair of test files.
- ReplaceEffectTest::testReplaceEffect in src/
Tests/ ReplaceEffectTest.php - Tests functionality of the replace image effect.
File
- src/
Tests/ ImageReplaceTestBase.php, line 108
Class
- ImageReplaceTestBase
- Tests functionality of the replace image effect.
Namespace
Drupal\image_replace\TestsCode
protected function imageIsOriginal($image_uri) {
$expected_info = array(
'extension' => 'png',
'height' => 90,
'mime_type' => 'image/png',
'width' => 120,
);
$image_info = image_get_info($image_uri);
unset($image_info['file_size']);
ksort($image_info);
// FIXME: Assert that original image has a red pixel on x=40, y=30.
return $expected_info === $image_info;
}