@@ -17,37 +17,37 @@ discard block |
||
| 17 | 17 | */ |
| 18 | 18 | class ImageBundleTest extends WebTestBase { |
| 19 | 19 | |
| 20 | - /** |
|
| 21 | - * Modules to enable. |
|
| 22 | - * |
|
| 23 | - * @var array |
|
| 24 | - */ |
|
| 25 | - public static $modules = ['media_entity', 'media_entity_image', 'image', 'node']; |
|
| 26 | - |
|
| 27 | - /** |
|
| 28 | - * The test media bundle. |
|
| 29 | - * |
|
| 30 | - * @var \Drupal\media_entity\MediaBundleInterface |
|
| 31 | - */ |
|
| 32 | - protected $testBundle; |
|
| 33 | - /** |
|
| 34 | - * Contains the media bundle storage |
|
| 35 | - * |
|
| 36 | - * @var \Drupal\media_entity\MediaBundleInterface |
|
| 37 | - */ |
|
| 38 | - protected $bundleStorage; |
|
| 39 | - |
|
| 40 | - /** |
|
| 41 | - * The test user. |
|
| 42 | - * |
|
| 43 | - * @var \Drupal\User\UserInterface |
|
| 44 | - */ |
|
| 45 | - protected $adminUser; |
|
| 46 | - |
|
| 47 | - /** |
|
| 48 | - * {@inheritdoc} |
|
| 49 | - */ |
|
| 50 | - protected function setUp() { |
|
| 20 | + /** |
|
| 21 | + * Modules to enable. |
|
| 22 | + * |
|
| 23 | + * @var array |
|
| 24 | + */ |
|
| 25 | + public static $modules = ['media_entity', 'media_entity_image', 'image', 'node']; |
|
| 26 | + |
|
| 27 | + /** |
|
| 28 | + * The test media bundle. |
|
| 29 | + * |
|
| 30 | + * @var \Drupal\media_entity\MediaBundleInterface |
|
| 31 | + */ |
|
| 32 | + protected $testBundle; |
|
| 33 | + /** |
|
| 34 | + * Contains the media bundle storage |
|
| 35 | + * |
|
| 36 | + * @var \Drupal\media_entity\MediaBundleInterface |
|
| 37 | + */ |
|
| 38 | + protected $bundleStorage; |
|
| 39 | + |
|
| 40 | + /** |
|
| 41 | + * The test user. |
|
| 42 | + * |
|
| 43 | + * @var \Drupal\User\UserInterface |
|
| 44 | + */ |
|
| 45 | + protected $adminUser; |
|
| 46 | + |
|
| 47 | + /** |
|
| 48 | + * {@inheritdoc} |
|
| 49 | + */ |
|
| 50 | + protected function setUp() { |
|
| 51 | 51 | parent::setUp(); |
| 52 | 52 | $this->container->get('module_installer')->install(['image_bundle_test']); |
| 53 | 53 | $entityManager = $this->container->get('entity.manager'); |
@@ -64,15 +64,15 @@ discard block |
||
| 64 | 64 | 'access media overview', |
| 65 | 65 | ]); |
| 66 | 66 | $this->drupalLogin($this->adminUser); |
| 67 | - } |
|
| 67 | + } |
|
| 68 | 68 | |
| 69 | - /** |
|
| 70 | - * Tests image media bundle creation from config files. |
|
| 71 | - */ |
|
| 72 | - public function testMediaBundleCreationFromModule() { |
|
| 69 | + /** |
|
| 70 | + * Tests image media bundle creation from config files. |
|
| 71 | + */ |
|
| 72 | + public function testMediaBundleCreationFromModule() { |
|
| 73 | 73 | $type_configuration = array( |
| 74 | - 'source_field' => 'field_image', |
|
| 75 | - 'gather_exif' => false |
|
| 74 | + 'source_field' => 'field_image', |
|
| 75 | + 'gather_exif' => false |
|
| 76 | 76 | ); |
| 77 | 77 | |
| 78 | 78 | $this->assertTrue((bool) $this->testBundle, 'The media bundle from default configuration has been created in the database.'); |
@@ -81,12 +81,12 @@ discard block |
||
| 81 | 81 | $this->assertEqual($this->testBundle->get('type'), 'image', 'Correct plugin ID detected.'); |
| 82 | 82 | $this->assertEqual($this->testBundle->get('type_configuration'), $type_configuration, 'Type configuration correct.'); |
| 83 | 83 | $this->assertEqual($this->testBundle->get('field_map'), [], 'Correct field map detected.'); |
| 84 | - } |
|
| 84 | + } |
|
| 85 | 85 | |
| 86 | - /** |
|
| 87 | - * Tests item creation and thumbnail |
|
| 88 | - */ |
|
| 89 | - public function testMediaBundleItemCreation(){ |
|
| 86 | + /** |
|
| 87 | + * Tests item creation and thumbnail |
|
| 88 | + */ |
|
| 89 | + public function testMediaBundleItemCreation(){ |
|
| 90 | 90 | // Define the media item name. |
| 91 | 91 | $name = $this->randomMachineName(); |
| 92 | 92 | |
@@ -94,8 +94,8 @@ discard block |
||
| 94 | 94 | $testImage = File::create((array) current($image_files)); |
| 95 | 95 | $file_path = $this->container->get('file_system')->realpath($testImage->getFileUri()); |
| 96 | 96 | $edit = [ |
| 97 | - 'name[0][value]' => $name, |
|
| 98 | - 'files[field_image_0]' => $file_path, |
|
| 97 | + 'name[0][value]' => $name, |
|
| 98 | + 'files[field_image_0]' => $file_path, |
|
| 99 | 99 | ]; |
| 100 | 100 | |
| 101 | 101 | // Save it and verify the title. |
@@ -113,5 +113,5 @@ discard block |
||
| 113 | 113 | // Check if the thumbnail exists or not. |
| 114 | 114 | $xpath = "//table[@class='views-table views-view-table cols-7']/tbody/tr[1]/td[1]/img"; |
| 115 | 115 | $this->assertFieldByXPath($xpath, NULL, "Thumbnail for the media exists."); |
| 116 | - } |
|
| 116 | + } |
|
| 117 | 117 | } |
@@ -86,7 +86,7 @@ |
||
| 86 | 86 | /** |
| 87 | 87 | * Tests item creation and thumbnail |
| 88 | 88 | */ |
| 89 | - public function testMediaBundleItemCreation(){ |
|
| 89 | + public function testMediaBundleItemCreation() { |
|
| 90 | 90 | // Define the media item name. |
| 91 | 91 | $name = $this->randomMachineName(); |
| 92 | 92 | |