@@ -14,38 +14,38 @@ discard block |
||
| 14 | 14 | */ |
| 15 | 15 | class ImageBundleTest extends WebTestBase { |
| 16 | 16 | |
| 17 | - /** |
|
| 18 | - * Modules to enable. |
|
| 19 | - * |
|
| 20 | - * @var array |
|
| 21 | - */ |
|
| 22 | - public static $modules = ['media', 'media_entity', 'media_entity_image', 'image', 'node']; |
|
| 17 | + /** |
|
| 18 | + * Modules to enable. |
|
| 19 | + * |
|
| 20 | + * @var array |
|
| 21 | + */ |
|
| 22 | + public static $modules = ['media', 'media_entity', 'media_entity_image', 'image', 'node']; |
|
| 23 | 23 | |
| 24 | - /** |
|
| 25 | - * The test media bundle. |
|
| 26 | - * |
|
| 27 | - * @var \Drupal\media_entity\MediaBundleInterface |
|
| 28 | - */ |
|
| 29 | - protected $testBundle; |
|
| 24 | + /** |
|
| 25 | + * The test media bundle. |
|
| 26 | + * |
|
| 27 | + * @var \Drupal\media_entity\MediaBundleInterface |
|
| 28 | + */ |
|
| 29 | + protected $testBundle; |
|
| 30 | 30 | |
| 31 | - /** |
|
| 32 | - * Contains the media bundle storage |
|
| 33 | - * |
|
| 34 | - * @var \Drupal\media_entity\MediaBundleInterface |
|
| 35 | - */ |
|
| 36 | - protected $bundleStorage; |
|
| 31 | + /** |
|
| 32 | + * Contains the media bundle storage |
|
| 33 | + * |
|
| 34 | + * @var \Drupal\media_entity\MediaBundleInterface |
|
| 35 | + */ |
|
| 36 | + protected $bundleStorage; |
|
| 37 | 37 | |
| 38 | - /** |
|
| 39 | - * The test user. |
|
| 40 | - * |
|
| 41 | - * @var \Drupal\User\UserInterface |
|
| 42 | - */ |
|
| 43 | - protected $adminUser; |
|
| 38 | + /** |
|
| 39 | + * The test user. |
|
| 40 | + * |
|
| 41 | + * @var \Drupal\User\UserInterface |
|
| 42 | + */ |
|
| 43 | + protected $adminUser; |
|
| 44 | 44 | |
| 45 | - /** |
|
| 46 | - * {@inheritdoc} |
|
| 47 | - */ |
|
| 48 | - protected function setUp() { |
|
| 45 | + /** |
|
| 46 | + * {@inheritdoc} |
|
| 47 | + */ |
|
| 48 | + protected function setUp() { |
|
| 49 | 49 | parent::setUp(); |
| 50 | 50 | $entityManager = $this->container->get('entity.manager'); |
| 51 | 51 | $this->bundleStorage = $entityManager->getStorage('media_bundle'); |
@@ -61,15 +61,15 @@ discard block |
||
| 61 | 61 | 'access media overview', |
| 62 | 62 | ]); |
| 63 | 63 | $this->drupalLogin($this->adminUser); |
| 64 | - } |
|
| 64 | + } |
|
| 65 | 65 | |
| 66 | - /** |
|
| 67 | - * Tests image media bundle creation from config files. |
|
| 68 | - */ |
|
| 69 | - public function testMediaBundleCreationFromModule() { |
|
| 66 | + /** |
|
| 67 | + * Tests image media bundle creation from config files. |
|
| 68 | + */ |
|
| 69 | + public function testMediaBundleCreationFromModule() { |
|
| 70 | 70 | $type_configuration = [ |
| 71 | - 'source_field' => 'field_image', |
|
| 72 | - 'gather_exif' => false |
|
| 71 | + 'source_field' => 'field_image', |
|
| 72 | + 'gather_exif' => false |
|
| 73 | 73 | ]; |
| 74 | 74 | |
| 75 | 75 | $this->assertTrue((bool) $this->testBundle, 'The media bundle from default configuration has been created in the database.'); |
@@ -78,20 +78,20 @@ discard block |
||
| 78 | 78 | $this->assertEqual($this->testBundle->get('type'), 'image', 'Correct plugin ID detected.'); |
| 79 | 79 | $this->assertEqual($this->testBundle->get('type_configuration'), $type_configuration, 'Type configuration correct.'); |
| 80 | 80 | $this->assertEqual($this->testBundle->get('field_map'), [], 'Correct field map detected.'); |
| 81 | - } |
|
| 81 | + } |
|
| 82 | 82 | |
| 83 | - /** |
|
| 84 | - * Tests item creation and thumbnail |
|
| 85 | - */ |
|
| 86 | - public function testMediaBundleItemCreation() { |
|
| 83 | + /** |
|
| 84 | + * Tests item creation and thumbnail |
|
| 85 | + */ |
|
| 86 | + public function testMediaBundleItemCreation() { |
|
| 87 | 87 | // Define the media item name. |
| 88 | 88 | $name = $this->randomMachineName(); |
| 89 | 89 | $image_files = $this->drupalGetTestFiles('image'); |
| 90 | 90 | $testImage = current($image_files); |
| 91 | 91 | $file_path = $this->container->get('file_system')->realpath($testImage->uri); |
| 92 | 92 | $edit = [ |
| 93 | - 'name[0][value]' => $name, |
|
| 94 | - 'files[field_image_0]' => $file_path, |
|
| 93 | + 'name[0][value]' => $name, |
|
| 94 | + 'files[field_image_0]' => $file_path, |
|
| 95 | 95 | ]; |
| 96 | 96 | |
| 97 | 97 | // Save the image |
@@ -111,5 +111,5 @@ discard block |
||
| 111 | 111 | $thumbnail = $image->thumbnail($media); |
| 112 | 112 | $default_thumbnail = $image->getDefaultThumbnail(); |
| 113 | 113 | $this->assertNotEqual($thumbnail, $default_thumbnail, "The thumbnail generated is different from the default thumbnail."); |
| 114 | - } |
|
| 114 | + } |
|
| 115 | 115 | } |