Updated all the contrib modules to their latest versions.
[yaffs-website] / web / modules / contrib / image_widget_crop / modules / image_widget_crop_examples / tests / src / Functional / ImageWidgetCropExamplesTest.php
1 <?php
2
3 namespace Drupal\Tests\image_widget_crop_examples\Functional;
4
5 use Drupal\Tests\BrowserTestBase;
6
7 /**
8  * Tests image_widget_crop_examples.
9  *
10  * @group image_widget_crop_examples
11  *
12  * @ingroup media
13  */
14 class ImageWidgetCropExamplesTest extends BrowserTestBase {
15
16   /**
17    * Modules to install.
18    *
19    * @var array
20    */
21   public static $modules = [
22     'menu_ui',
23     'path',
24     'media',
25   ];
26
27   /**
28    * {@inheritdoc}
29    */
30   public function setUp() {
31     parent::setUp();
32     // Theme needs to be set before enabling image_widget_crop_examples because
33     // of dependency.
34     \Drupal::service('theme_handler')->install(['bartik']);
35     $this->config('system.theme')
36       ->set('default', 'bartik')
37       ->save();
38
39     $example_module_is_installed = \Drupal::service('module_installer')->install(['image_widget_crop_examples']);
40     $this->assertTrue($example_module_is_installed, 'image_widget_crop_examples installed.');
41     \Drupal::service('router.builder')->rebuild();
42   }
43
44   /**
45    * Tests if image_widget_crop_example is correctly installed.
46    */
47   public function testInstalled() {
48     $this->drupalGet('');
49     $this->assertSession()->titleEquals('Image Widget Crop examples | Drupal');
50     $this->assertSession()->pageTextContains('Image Widget Crop examples');
51     $this->assertSession()->pageTextContains('Welcome to Image Widget Crop example.');
52     $this->assertSession()->pageTextContains('Image Widget Crop provides an interface for using the features of the Crop API.');
53     $this->assertSession()->pageTextContains('You can test the functionality with custom content types created for the demonstration of features from Image Widget Crop:');
54   }
55
56 }