Loading image_widget_crop.install +1 −1 Original line number Diff line number Diff line Loading @@ -20,7 +20,7 @@ function image_widget_crop_requirements($phase) { ]; foreach ($files as $type => $file) { $is_local = parse_url($file, PHP_URL_SCHEME) === NULL && strpos($file, '//') !== 0; $is_local = !empty($file) && parse_url($file, PHP_URL_SCHEME) === NULL && strpos($file, '//') !== 0; // If libraries module is active check if folder is malformed. if ($is_local && \Drupal::moduleHandler()->moduleExists('libraries') Loading tests/src/Kernel/ImageWidgetCropTest.php 0 → 100644 +35 −0 Original line number Diff line number Diff line <?php namespace Drupal\Tests\image_widget_crop\Kernel; use Drupal\KernelTests\KernelTestBase; /** * Minimal test case for the image_widget_crop module. * * @group image_widget_crop * * @ingroup media */ class ImageWidgetCropTest extends KernelTestBase { /** * {@inheritdoc} */ protected static $modules = [ 'file', 'image', 'crop', 'image_widget_crop', ]; /** * Tests that image_widget_crop_requirements() returns an array. */ public function testRequirements() { $this->container->get('module_handler')->loadInclude('image_widget_crop', 'install'); $requirements = image_widget_crop_requirements('runtime'); $this->assertIsArray($requirements); } } Loading
image_widget_crop.install +1 −1 Original line number Diff line number Diff line Loading @@ -20,7 +20,7 @@ function image_widget_crop_requirements($phase) { ]; foreach ($files as $type => $file) { $is_local = parse_url($file, PHP_URL_SCHEME) === NULL && strpos($file, '//') !== 0; $is_local = !empty($file) && parse_url($file, PHP_URL_SCHEME) === NULL && strpos($file, '//') !== 0; // If libraries module is active check if folder is malformed. if ($is_local && \Drupal::moduleHandler()->moduleExists('libraries') Loading
tests/src/Kernel/ImageWidgetCropTest.php 0 → 100644 +35 −0 Original line number Diff line number Diff line <?php namespace Drupal\Tests\image_widget_crop\Kernel; use Drupal\KernelTests\KernelTestBase; /** * Minimal test case for the image_widget_crop module. * * @group image_widget_crop * * @ingroup media */ class ImageWidgetCropTest extends KernelTestBase { /** * {@inheritdoc} */ protected static $modules = [ 'file', 'image', 'crop', 'image_widget_crop', ]; /** * Tests that image_widget_crop_requirements() returns an array. */ public function testRequirements() { $this->container->get('module_handler')->loadInclude('image_widget_crop', 'install'); $requirements = image_widget_crop_requirements('runtime'); $this->assertIsArray($requirements); } }