3 namespace Drupal\Tests\image_widget_crop_examples\Functional;
5 use Drupal\Tests\BrowserTestBase;
8 * Tests image_widget_crop_examples.
10 * @group image_widget_crop_examples
14 class ImageWidgetCropExamplesTest extends BrowserTestBase {
21 public static $modules = [
30 public function setUp() {
32 // Theme needs to be set before enabling image_widget_crop_examples because
34 \Drupal::service('theme_handler')->install(['bartik']);
35 $this->config('system.theme')
36 ->set('default', 'bartik')
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();
45 * Tests if image_widget_crop_example is correctly installed.
47 public function testInstalled() {
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:');