diff --git a/css/responsive-preview.module.css b/css/responsive-preview.module.css
index dca7c30..21cab55 100644
--- a/css/responsive-preview.module.css
+++ b/css/responsive-preview.module.css
@@ -17,6 +17,7 @@
 .toolbar-tab-responsive-preview {
   display: none;
 }
+
 /* At narrow screen widths, float the tab to the left so it falls in line with
  * the rest of the toolbar tabs. */
 .toolbar .toolbar-bar .toolbar-tab-responsive-preview.toolbar-tab {
@@ -24,12 +25,15 @@
   float: right; /* LTR */
   position: relative;
 }
+
 [dir="rtl"] .toolbar .toolbar-bar .toolbar-tab-responsive-preview.toolbar-tab {
   float: left;
 }
+
 .toolbar-tab-responsive-preview .responsive-preview-trigger {
   display: block;
 }
+
 /* Device preview options. */
 .toolbar-tab-responsive-preview .responsive-preview-item-list {
   display: none;
@@ -37,9 +41,11 @@
   white-space: nowrap;
   z-index: 512;
 }
+
 .toolbar-tab-responsive-preview.open .responsive-preview-item-list {
   display: block;
 }
+
 .toolbar-tab-responsive-preview.toolbar-tab .responsive-preview-options li {
   float: none;
   position: relative;
@@ -59,21 +65,26 @@
   width: 100%;
   z-index: 500;
 }
+
 [dir="rtl"] .responsive-preview {
   left: auto;
   right: -200%;
 }
+
 .responsive-preview.active {
   left: 0; /* LTR */
   position: fixed;
 }
+
 [dir="rtl"] .responsive-preview.active {
   left: auto;
   right: 0;
 }
+
 .responsive-preview-control {
   position: absolute;
 }
+
 .responsive-preview-modal-background {
   bottom: 0;
   left: 0;
@@ -90,6 +101,7 @@
   position: absolute;
   z-index: 100;
 }
+
 .responsive-preview-frame-container iframe {
   display: block;
   position: relative;
@@ -107,6 +119,7 @@
   top: 0;
   z-index: 1;
 }
+
 #responsive-preview-scroll-pane {
   min-height: 100%;
   position: relative;
@@ -120,15 +133,19 @@ body.toolbar-tray-open.responsive-preview-frame {
   margin-left: 0 !important;
   margin-right: 0 !important;
 }
+
 .responsive-preview-frame {
   overflow-x: hidden !important;
 }
+
 .responsive-preview-frame #toolbar-administration {
   display: none !important;
 }
+
 .responsive-preview-frame .node-preview-container {
   display: none !important;
 }
+
 .responsive-preview-frame .contextual {
   display: none !important;
 }
@@ -137,5 +154,5 @@ body.toolbar-tray-open.responsive-preview-frame {
  * Hide contextual toolbar tab when preview is active.
  */
 .responsive-preview-active .contextual-toolbar-tab {
-    display: none !important;
+  display: none !important;
 }
diff --git a/css/responsive-preview.theme.css b/css/responsive-preview.theme.css
index 059b632..cf3f262 100644
--- a/css/responsive-preview.theme.css
+++ b/css/responsive-preview.theme.css
@@ -11,63 +11,75 @@
   padding-top: 0.5em;
   padding-bottom: 0.5em;
 }
+
 /* Device preview options. */
 .toolbar-tab-responsive-preview .responsive-preview-options {
   box-shadow: 0 0.8em 2.5em -0.8em rgba(0, 0, 0, 0.75);
 }
+
 /* [dir] is needed to override Bartik's .item-list li padding */
 [dir] .toolbar-tab-responsive-preview .responsive-preview-options li {
   margin: 0;
   padding: 0;
 }
+
 .toolbar-tab-responsive-preview .responsive-preview-trigger {
   cursor: pointer;
   line-height: 1;
   height: 3em;
 }
+
 .toolbar-tab-responsive-preview .responsive-preview-trigger:hover {
   background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.125) 20%, transparent 200%);
   background-image: -moz-linear-gradient(rgba(255, 255, 255, 0.125) 20%, transparent 200%);
   background-image: linear-gradient(rgba(255, 255, 255, 0.125) 20%, transparent 200%);
 }
+
 .toolbar-tab-responsive-preview .responsive-preview-trigger.active,
 .toolbar-tab-responsive-preview .responsive-preview-trigger.active:hover {
-  background-image: -webkit-linear-gradient(top, rgb(78,159,234) 0%, rgb(69,132,221) 100%);
-  background-image: -moz-linear-gradient(rgb(78,159,234) 0%,rgb(69,132,221) 100%);
-  background-image: linear-gradient(rgb(78,159,234) 0%,rgb(69,132,221) 100%);
+  background-image: -webkit-linear-gradient(top, rgb(78, 159, 234) 0%, rgb(69, 132, 221) 100%);
+  background-image: -moz-linear-gradient(rgb(78, 159, 234) 0%, rgb(69, 132, 221) 100%);
+  background-image: linear-gradient(rgb(78, 159, 234) 0%, rgb(69, 132, 221) 100%);
 }
+
 .toolbar-tab-responsive-preview .responsive-preview-trigger,
 .toolbar-tab-responsive-preview .responsive-preview-options .responsive-preview-device {
   padding-bottom: 1em;
   padding-top: 1em;
 }
+
 .toolbar-tab-responsive-preview .responsive-preview-options .responsive-preview-device {
   background: none;
   border: none;
   cursor: pointer;
   font-family: inherit;
   font-size: 1em;
-  padding: 0.5em 1.3333em
+  padding: 0.5em 1.3333em;
 }
+
 .toolbar .toolbar-tab-responsive-preview.toolbar-tab .responsive-preview-options .responsive-preview-device {
-  color: #0074BD;
+  color: #0074bd;
   text-align: left;
   width: 100%;
 }
+
 .toolbar .toolbar-tab-responsive-preview.toolbar-tab .responsive-preview-options .responsive-preview-device:hover,
 .toolbar .toolbar-tab-responsive-preview.toolbar-tab .responsive-preview-options .responsive-preview-device.active {
   color: black;
 }
+
 .toolbar .toolbar-tab-responsive-preview.toolbar-tab .responsive-preview-options .responsive-preview-device[disabled] {
   color: #ccc;
   cursor: default;
 }
+
 /* Configuration link. */
 .toolbar-tab-responsive-preview.toolbar-tab .responsive-preview-configure {
   color: #777;
   margin-top: 0.5em;
   padding: 0.5em 0.6667em;
 }
+
 .toolbar-tab-responsive-preview.toolbar-tab .responsive-preview-configure:hover {
   color: #000;
 }
@@ -90,12 +102,14 @@
   top: 50%;
   margin-top: -0.1666em;
   width: 0;
-  z-index: 1
+  z-index: 1;
 }
+
 [dir="rtl"] .toolbar-tab-responsive-preview .responsive-preview-trigger:after {
   left: 1em;
   right: auto;
 }
+
 .toolbar-tab-responsive-preview.open:before {
   background-color: white;
   bottom: 0;
@@ -107,10 +121,12 @@
   width: 2em;
   z-index: 1;
 }
+
 [dir="rtl"] .toolbar-tab-responsive-preview.open:before {
   left: 0;
   right: auto;
 }
+
 .toolbar-tab-responsive-preview.open .responsive-preview-trigger:after {
   border-bottom: 0.4545em solid;
   border-top-color: transparent;
@@ -118,15 +134,18 @@
   right: 0.7em; /* LTR */
   top: 1.25em;
 }
+
 [dir="rtl"] .toolbar-tab-responsive-preview.open .responsive-preview-trigger:after {
   left: 0.7em;
   right: auto;
 }
+
 .toolbar-tab-responsive-preview:hover .responsive-preview-trigger:after,
 .toolbar-tab-responsive-preview .responsive-preview-trigger.active:after,
 .toolbar-tab-responsive-preview:hover .responsive-preview-trigger.active:after {
   color: white;
 }
+
 .toolbar-tab-responsive-preview.open:hover .responsive-preview-trigger:after {
   color: black;
 }
@@ -140,21 +159,24 @@
   -webkit-transition: opacity 450ms;
   transition: opacity 450ms;
 }
+
 .responsive-preview .responsive-preview-frame-container {
   opacity: 0;
   -moz-transition: all 250ms;
   -webkit-transition: all 250ms;
   transition: all 250ms;
 }
+
 .responsive-preview.active .responsive-preview-frame-container {
   opacity: 1;
 }
+
 .responsive-preview-modal-background {
   background-color: black;
-  background-color: rgba(0,0,0,0.92);
-  background-image: -webkit-linear-gradient(left, rgb(20,20,20),rgb(50,50,50) 25%, rgb(100,100,100) 40%, rgb(100,100,100) 60%, rgb(50,50,50) 75%, rgb(20,20,20));
-  background-image: -moz-linear-gradient(left, rgb(20,20,20),rgb(50,50,50) 25%, rgb(100,100,100) 40%, rgb(100,100,100) 60%, rgb(50,50,50) 75%, rgb(20,20,20));
-  background-image: linear-gradient(left, rgb(20,20,20),rgb(50,50,50) 25%, rgb(100,100,100) 40%, rgb(100,100,100) 60%, rgb(50,50,50) 75%, rgb(20,20,20));
+  background-color: rgba(0, 0, 0, 0.92);
+  background-image: -webkit-linear-gradient(left, rgb(20, 20, 20), rgb(50, 50, 50) 25%, rgb(100, 100, 100) 40%, rgb(100, 100, 100) 60%, rgb(50, 50, 50) 75%, rgb(20, 20, 20));
+  background-image: -moz-linear-gradient(left, rgb(20, 20, 20), rgb(50, 50, 50) 25%, rgb(100, 100, 100) 40%, rgb(100, 100, 100) 60%, rgb(50, 50, 50) 75%, rgb(20, 20, 20));
+  background-image: linear-gradient(left, rgb(20, 20, 20), rgb(50, 50, 50) 25%, rgb(100, 100, 100) 40%, rgb(100, 100, 100) 60%, rgb(50, 50, 50) 75%, rgb(20, 20, 20));
 }
 
 /**
@@ -167,20 +189,25 @@
   top: 0;
   width: 40px;
 }
+
 .responsive-preview-control.responsive-preview-close {
   right: 0; /* LTR */
 }
+
 [dir="rtl"] .responsive-preview-control.responsive-preview-close {
   left: 0;
   right: auto;
 }
+
 .responsive-preview-control.responsive-preview-orientation {
   left: 0; /* LTR */
 }
+
 [dir="rtl"] .responsive-preview-control.responsive-preview-orientation {
   left: auto;
   right: 0;
 }
+
 .responsive-preview-device-label {
   color: #909090;
   cursor: pointer;
@@ -198,6 +225,7 @@
   top: 0;
   white-space: nowrap;
 }
+
 .responsive-preview-device-label-text:after {
   border-bottom-color: transparent;
   border-right-color: transparent;
@@ -212,19 +240,23 @@
   margin-right: 0.75ex;
   width: 0;
 }
+
 [dir="rtl"] .responsive-preview-device-label-text:after {
   border-left-color: transparent;
   border-right-color: inherit;
   border-width: 0.8ex 0.9ex 0.8ex 0;
 }
+
 .responsive-preview-device-label-text:hover:after {
   color: inherit;
 }
+
 .responsive-preview-expanded .responsive-preview-device-label-text:after {
   border-left-color: transparent;
   border-right-color: inherit;
   border-width: 0.8ex 0.9ex 0.8ex 0;
 }
+
 [dir="rtl"] .responsive-preview-expanded .responsive-preview-device-label-text:after {
   border-left-color: inherit;
   border-right-color: transparent;
@@ -237,13 +269,12 @@
 .responsive-preview-frame-container {
   background-color: #212121;
   border-radius: 20px;
-  box-shadow:
-    0 0 0px 1px #777,
-    1px 1px 60px 0px #000;
+  box-shadow: 0 0 0px 1px #777, 1px 1px 60px 0px #000;
   -webkit-transition: left 150ms ease-out;
   -moz-transition: left 150ms ease-out;
   transition: left 150ms ease-out;
 }
+
 .responsive-preview-frame-container iframe {
   box-shadow: 0 0 0 1px #808080;
   -webkit-transition: all 150ms ease-out;
@@ -265,6 +296,7 @@
   margin: 0;
   padding: 0.25em 0;
 }
+
 .block-responsive-preview-block .content .responsive-preview-device[disabled] {
   color: #ccc;
   cursor: default;
diff --git a/js/responsive-preview.js b/js/responsive-preview.js
index 1f5961e..3599a22 100644
--- a/js/responsive-preview.js
+++ b/js/responsive-preview.js
@@ -95,7 +95,7 @@
         /**
          * Sets the viewport width and height dimensions on the envModel.
          */
-        var setViewportDimensions = function() {
+        var setViewportDimensions = function () {
           envModel.set({
             'viewportWidth': document.documentElement.clientWidth,
             'viewportHeight': document.documentElement.clientHeight
@@ -153,7 +153,7 @@
       /**
        * Loops through object properties; applies a callback function.
        */
-      function looper (obj, iterator) {
+      function looper(obj, iterator) {
         for (var prop in obj) {
           if (obj.hasOwnProperty(prop)) {
             iterator.call(null, prop, obj[prop]);
@@ -385,7 +385,7 @@
           var isActive = this.model.get('isActive');
           var isDeviceListOpen = this.tabModel.get('isDeviceListOpen');
           this.$el
-            // Render the visibility of the toolbar tab.
+          // Render the visibility of the toolbar tab.
             .toggle(this.model.get('fittingDeviceCount') > 0)
             // Toggle the display of the device list.
             .toggleClass('open', isDeviceListOpen);
@@ -442,7 +442,7 @@
           this.$el
             .find('.responsive-preview-item-list')
             .position({
-              'my': edge +' top',
+              'my': edge + ' top',
               'at': edge + ' bottom',
               'of': this.$el,
               'collision': 'flip fit'
@@ -822,11 +822,12 @@
           // background color.
           // @todo: figure out a work-around for background images, or somehow
           // document this explicitly.
-          function isTransparent (color) {
+          function isTransparent(color) {
             // TRICKY: edge case for Firefox' "transparent" here; this is a
             // browser bug: https://bugzilla.mozilla.org/show_bug.cgi?id=635724
             return (color === 'rgba(0, 0, 0, 0)' || color === 'transparent');
           }
+
           var htmlBgColor = $html.css('background-color');
           var bodyBgColor = $html.find('body').css('background-color');
           if (!isTransparent(htmlBgColor) || !isTransparent(bodyBgColor)) {
@@ -964,7 +965,7 @@
    *   having to reference it through a 'this' object which will trigger 'Possible
    *   strict violation' warning messages in JSHint.
    */
-  function updateDeviceList (view) {
+  function updateDeviceList(view) {
     var gutter = view.gutter;
     var bleed = view.bleed;
     var viewportWidth = view.envModel.get('viewportWidth');
@@ -1001,7 +1002,7 @@
    *   strict violation' warning messages in JSHint.
    * @param jQuery.Event event
    */
-  function selectDevice (view, event) {
+  function selectDevice(view, event) {
     var $link = $(event.target);
     var name = $link.data('responsive-preview-name');
     // If the clicked link is already active, then shut down the preview.
@@ -1043,6 +1044,7 @@
      *
      * @param Object strings
      *   A hash of strings to use in the template.
+     *
      * @return
      *   The corresponding HTML.
      */
@@ -1054,8 +1056,7 @@
         // run-on word between the last word of the label and the first word
         // of the details.
         '<span>&#32;</span>' +
-        '<span class="responsive-preview-device-label-details visually-hidden"></span>' +
-        '</label>' +
+        '<span class="responsive-preview-device-label-details visually-hidden"></span></label>' +
         '<button id="responsive-preview-close" title="' + strings.close + '" role="button" class="responsive-preview-icon responsive-preview-icon-close responsive-preview-control responsive-preview-close" aria-pressed="false"><span class="visually-hidden">' + strings.close + '</span></button>' +
         '<button id="responsive-preview-orientation" title="' + strings.orientation + '" role="button" class="responsive-preview-icon responsive-preview-icon-orientation responsive-preview-control responsive-preview-orientation" aria-pressed="false"><span class="visually-hidden">' + strings.orientation + '</span></button>' +
         '</div>';
diff --git a/src/DeviceInterface.php b/src/DeviceInterface.php
index 23d61cf..f5e7838 100644
--- a/src/DeviceInterface.php
+++ b/src/DeviceInterface.php
@@ -22,7 +22,6 @@ interface DeviceInterface extends ConfigEntityInterface {
    *
    * @param int $weight
    *   The device weight.
-   *
    */
   public function setWeight($weight);
 
diff --git a/src/Plugin/Block/ResponsivePreviewBlock.php b/src/Plugin/Block/ResponsivePreviewBlock.php
index e2e5c0a..adb434d 100644
--- a/src/Plugin/Block/ResponsivePreviewBlock.php
+++ b/src/Plugin/Block/ResponsivePreviewBlock.php
@@ -9,6 +9,8 @@ use Drupal\Core\Entity\EntityTypeManagerInterface;
 use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
 use Drupal\Core\Routing\AdminContext;
 use Drupal\Core\Session\AccountInterface;
+use Drupal\Core\Session\AccountProxyInterface;
+use Drupal\responsive_preview\ResponsivePreviewInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
 /**
@@ -36,6 +38,20 @@ class ResponsivePreviewBlock extends BlockBase implements ContainerFactoryPlugin
   protected $entityTypeManager;
 
   /**
+   * The current user.
+   *
+   * @var \Drupal\Core\Session\AccountProxyInterface
+   */
+  protected $currentUser;
+
+  /**
+   * The responsive preview service.
+   *
+   * @var ResponsivePreviewInterface
+   */
+  protected $responsivePreview;
+
+  /**
    * Constructs an ResponsivePreviewBlock object.
    *
    * @param array $configuration
@@ -47,12 +63,18 @@ class ResponsivePreviewBlock extends BlockBase implements ContainerFactoryPlugin
    * @param \Drupal\Core\Routing\AdminContext $admin_context
    *   The router admin context service.
    * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
-   *   TThe entity type manager.
+   *   The entity type manager.
+   * @param \Drupal\Core\Session\AccountProxyInterface $currentUser
+   *   The current user.
+   * @param \Drupal\responsive_preview\ResponsivePreviewInterface $responsivePreview
+   *   The current user.
    */
-  public function __construct(array $configuration, $plugin_id, $plugin_definition, AdminContext $admin_context, EntityTypeManagerInterface $entity_type_manager) {
+  public function __construct(array $configuration, $plugin_id, $plugin_definition, AdminContext $admin_context, EntityTypeManagerInterface $entity_type_manager, AccountProxyInterface $currentUser, ResponsivePreviewInterface $responsivePreview) {
     parent::__construct($configuration, $plugin_id, $plugin_definition);
     $this->adminContext = $admin_context;
     $this->entityTypeManager = $entity_type_manager;
+    $this->currentUser = $currentUser;
+    $this->responsivePreview = $responsivePreview;
   }
 
   /**
@@ -64,7 +86,9 @@ class ResponsivePreviewBlock extends BlockBase implements ContainerFactoryPlugin
       $plugin_id,
       $plugin_definition,
       $container->get('router.admin_context'),
-      $container->get('entity_type.manager')
+      $container->get('entity_type.manager'),
+      $container->get('current_user'),
+      $container->get('responsive_preview')
     );
   }
 
@@ -81,15 +105,13 @@ class ResponsivePreviewBlock extends BlockBase implements ContainerFactoryPlugin
   public function build() {
     $block = [];
 
-    $preview_access = \Drupal::currentUser()->hasPermission('access responsive preview');
+    $preview_access = $this->currentUser->hasPermission('access responsive preview');
 
-    /** @var \Drupal\responsive_preview\ResponsivePreview $responsivePreviewService */
-    $responsivePreviewService = \Drupal::service('responsive_preview');
-    $url = $responsivePreviewService->getUrl();
+    $url = $this->responsivePreview->getUrl();
 
     if ($preview_access && $url) {
       $block = [
-        'device_options' => $responsivePreviewService->getRenderableDevicesList(),
+        'device_options' => $this->responsivePreview->getRenderableDevicesList(),
         '#attached' => [
           'library' => ['responsive_preview/drupal.responsive-preview'],
           'drupalSettings' => [
diff --git a/tests/src/Functional/ResponsivePreviewAdminTest.php b/tests/src/Functional/ResponsivePreviewAdminTest.php
index edb76fb..1e10cee 100644
--- a/tests/src/Functional/ResponsivePreviewAdminTest.php
+++ b/tests/src/Functional/ResponsivePreviewAdminTest.php
@@ -3,7 +3,6 @@
 namespace Drupal\Tests\responsive_preview\Functional;
 
 use Drupal\Core\Url;
-use Drupal\Tests\BrowserTestBase;
 
 /**
  * Tests the Crud operation on responsive preview device.
@@ -51,21 +50,29 @@ class ResponsivePreviewAdminTest extends ResponsivePreviewTestBase {
     $this->assertEquals(count($elements), 5, 'Correct number of table header cells found.');
 
     // Test the contents of each th cell.
-    $expected_items = ['Name', 'Show in list', 'Dimensions', 'Weight', 'Operations'];
+    $expected_items = [
+      'Name',
+      'Show in list',
+      'Dimensions',
+      'Weight',
+      'Operations',
+    ];
     foreach ($elements as $key => $element) {
       $this->assertSame($element->getText(), $expected_items[$key]);
     }
 
     // Ensures that all default devices are listed in the table.
     $default_devices = $this->getDefaultDevices();
-    foreach ($default_devices as $id => $label) {
-      $xpath = $this->assertSession()->buildXPathQuery('//table//tr//td[text()=:text]', [':text' => $label]);
+    foreach ($default_devices as $label) {
+      $xpath = $this->assertSession()
+        ->buildXPathQuery('//table//tr//td[text()=:text]', [':text' => $label]);
       $this->assertSession()->elementExists('xpath', $xpath);
     }
 
     // Test for the add action button.
     $this->assertSession()->linkExists('Add Device');
-    $this->assertSession()->linkByHrefExists('admin/config/user-interface/responsive-preview/add');
+    $this->assertSession()
+      ->linkByHrefExists('admin/config/user-interface/responsive-preview/add');
 
     // Test the insert of a new device.
     $edit = [
@@ -78,12 +85,15 @@ class ResponsivePreviewAdminTest extends ResponsivePreviewTestBase {
       'orientation' => 'portrait',
     ];
     $this->drupalPostForm('admin/config/user-interface/responsive-preview/add', $edit, t('Save'));
-    $this->assertSession()->responseContains(t('Device %name has been added.', ['%name' => 'Smartwatch']));
-    $this->assertSession()->elementExists('xpath', '//table//tr//td[text()="Smartwatch"]');
+    $this->assertSession()
+      ->responseContains(t('Device %name has been added.', ['%name' => 'Smartwatch']));
+    $this->assertSession()
+      ->elementExists('xpath', '//table//tr//td[text()="Smartwatch"]');
 
     // Ensures that is not possible to insert a non-unique device id.
     $this->drupalPostForm('admin/config/user-interface/responsive-preview/add', $edit, t('Save'));
-    $this->assertSession()->responseContains(t('The machine-readable name is already in use. It must be unique.'));
+    $this->assertSession()
+      ->responseContains(t('The machine-readable name is already in use. It must be unique.'));
 
     // Tests the update of an existing device.
     $edit = [
@@ -95,14 +105,18 @@ class ResponsivePreviewAdminTest extends ResponsivePreviewTestBase {
       'orientation' => 'landscape',
     ];
     $this->drupalPostForm('admin/config/user-interface/responsive-preview/small/edit', $edit, t('Save'));
-    $this->assertSession()->responseContains(t('Device %name has been updated.', ['%name' => 'Smart phone updated']));
-    $this->assertSession()->elementExists('xpath', '//table//tr//td[text()="Smart phone updated"]');
+    $this->assertSession()
+      ->responseContains(t('Device %name has been updated.', ['%name' => 'Smart phone updated']));
+    $this->assertSession()
+      ->elementExists('xpath', '//table//tr//td[text()="Smart phone updated"]');
     $this->assertSession()->checkboxChecked('entities[small][status]');
 
     // Tests the delete of a predefined devices.
     $this->drupalPostForm('admin/config/user-interface/responsive-preview/large/delete', [], t('Delete'));
-    $this->assertSession()->responseContains(t('Device %name has been deleted.', ['%name' => 'Typical desktop']));
-    $this->assertSession()->elementNotExists('xpath', '//table//tr//td[text()="Typical desktop"]');
+    $this->assertSession()
+      ->responseContains(t('Device %name has been deleted.', ['%name' => 'Typical desktop']));
+    $this->assertSession()
+      ->elementNotExists('xpath', '//table//tr//td[text()="Typical desktop"]');
 
     // Tests the update of the status from the listing page.
     $edit = [
@@ -111,20 +125,25 @@ class ResponsivePreviewAdminTest extends ResponsivePreviewTestBase {
       'entities[smartwatch][status]' => 0,
     ];
     $this->drupalPostForm('admin/config/user-interface/responsive-preview', $edit, t('Save'));
-    $this->assertSession()->responseContains(t('The device settings have been updated.'));
+    $this->assertSession()
+      ->responseContains(t('The device settings have been updated.'));
     $this->assertSession()->checkboxChecked('entities[medium][status]');
     $this->assertSession()->checkboxNotChecked('entities[small][status]');
     $this->assertSession()->checkboxNotChecked('entities[smartwatch][status]');
 
     // Tests the listing page when no devices are present.
-    $device_storage = \Drupal::entityTypeManager()->getStorage('responsive_preview_device');
+    $device_storage = \Drupal::entityTypeManager()
+      ->getStorage('responsive_preview_device');
     $device_storage->delete($device_storage->loadMultiple());
 
     $this->drupalGet('admin/config/user-interface/responsive-preview');
-    $this->assertSession()->elementNotExists('xpath', '//input[type="submit" and text="Save"]');
-    $this->assertSession()->responseContains(t('No devices available. <a href=":link">Add devices</a>.', [
-      ':link' => Url::fromRoute('entity.responsive_preview_device.add_form')->toString(),
-    ]));
+    $this->assertSession()
+      ->elementNotExists('xpath', '//input[type="submit" and text="Save"]');
+    $this->assertSession()
+      ->responseContains(t('No devices available. <a href=":link">Add devices</a>.', [
+        ':link' => Url::fromRoute('entity.responsive_preview_device.add_form')
+          ->toString(),
+      ]));
 
   }
 
diff --git a/tests/src/Functional/ResponsivePreviewBlockTest.php b/tests/src/Functional/ResponsivePreviewBlockTest.php
index 70da90d..a613935 100644
--- a/tests/src/Functional/ResponsivePreviewBlockTest.php
+++ b/tests/src/Functional/ResponsivePreviewBlockTest.php
@@ -2,8 +2,6 @@
 
 namespace Drupal\Tests\responsive_preview\Functional;
 
-use Drupal\Tests\BrowserTestBase;
-
 /**
  * Tests the responsive preview block.
  *
diff --git a/tests/src/Functional/ResponsivePreviewTestBase.php b/tests/src/Functional/ResponsivePreviewTestBase.php
index bc70fcf..8136f6b 100644
--- a/tests/src/Functional/ResponsivePreviewTestBase.php
+++ b/tests/src/Functional/ResponsivePreviewTestBase.php
@@ -20,7 +20,7 @@ abstract class ResponsivePreviewTestBase extends BrowserTestBase {
   /**
    * Return the default devices.
    *
-   * @param boolean $enabled_only
+   * @param bool $enabled_only
    *   Whether return only devices enabled by default.
    *
    * @return array
@@ -42,7 +42,7 @@ abstract class ResponsivePreviewTestBase extends BrowserTestBase {
     $devices += [
       'large' => 'Typical desktop',
       'medium' => 'Tablet',
-      'small' => 'Smart phone'
+      'small' => 'Smart phone',
     ];
 
     return $devices;
@@ -68,36 +68,48 @@ abstract class ResponsivePreviewTestBase extends BrowserTestBase {
    * Asserts whether responsive preview cache metadata is present.
    */
   protected function assertResponsivePreviewCachesTagAndContexts() {
-    $this->assertSession()->responseHeaderContains('X-Drupal-Cache-Tags', 'config:responsive_preview_device_list');
-    $this->assertSession()->responseHeaderContains('X-Drupal-Cache-Contexts', 'route.is_admin');
+    $this->assertSession()
+      ->responseHeaderContains('X-Drupal-Cache-Tags', 'config:responsive_preview_device_list');
+    $this->assertSession()
+      ->responseHeaderContains('X-Drupal-Cache-Contexts', 'route.is_admin');
   }
 
   /**
    * Asserts whether responsive preview cache metadata is not present.
    */
   protected function assertNoResponsivePreviewCachesTagAndContexts() {
-    $this->assertSession()->responseHeaderNotContains('X-Drupal-Cache-Tags', 'config:responsive_preview_device_list');
-    $this->assertSession()->responseHeaderNotContains('X-Drupal-Cache-Contexts', 'route.is_admin');
+    $this->assertSession()
+      ->responseHeaderNotContains('X-Drupal-Cache-Tags', 'config:responsive_preview_device_list');
+    $this->assertSession()
+      ->responseHeaderNotContains('X-Drupal-Cache-Contexts', 'route.is_admin');
   }
 
   /**
    * Asserts whether responsive preview library is included.
    */
   protected function assertResponsivePreviewLibrary() {
-    $this->assertSession()->responseContains('responsive_preview/js/responsive-preview.js');
-    $this->assertSession()->responseContains('responsive_preview/css/responsive-preview.icons.css');
-    $this->assertSession()->responseContains('responsive_preview/css/responsive-preview.module.css');
-    $this->assertSession()->responseContains('responsive_preview/css/responsive-preview.theme.css');
+    $this->assertSession()
+      ->responseContains('responsive_preview/js/responsive-preview.js');
+    $this->assertSession()
+      ->responseContains('responsive_preview/css/responsive-preview.icons.css');
+    $this->assertSession()
+      ->responseContains('responsive_preview/css/responsive-preview.module.css');
+    $this->assertSession()
+      ->responseContains('responsive_preview/css/responsive-preview.theme.css');
   }
 
   /**
    * Asserts whether responsive preview library is not included.
    */
   protected function assertNoResponsivePreviewLibrary() {
-    $this->assertSession()->responseNotContains('responsive_preview/js/responsive-preview.js');
-    $this->assertSession()->responseNotContains('responsive_preview/css/responsive-preview.icons.css');
-    $this->assertSession()->responseNotContains('responsive_preview/css/responsive-preview.module.css');
-    $this->assertSession()->responseNotContains('responsive_preview/css/responsive-preview.theme.css');
+    $this->assertSession()
+      ->responseNotContains('responsive_preview/js/responsive-preview.js');
+    $this->assertSession()
+      ->responseNotContains('responsive_preview/css/responsive-preview.icons.css');
+    $this->assertSession()
+      ->responseNotContains('responsive_preview/css/responsive-preview.module.css');
+    $this->assertSession()
+      ->responseNotContains('responsive_preview/css/responsive-preview.theme.css');
   }
 
 }
diff --git a/tests/src/Functional/ResponsivePreviewToolbarTest.php b/tests/src/Functional/ResponsivePreviewToolbarTest.php
index 0ab6dce..adbc8ce 100644
--- a/tests/src/Functional/ResponsivePreviewToolbarTest.php
+++ b/tests/src/Functional/ResponsivePreviewToolbarTest.php
@@ -2,8 +2,6 @@
 
 namespace Drupal\Tests\responsive_preview\Functional;
 
-use Drupal\Tests\BrowserTestBase;
-
 /**
  * Tests the toolbar integration.
  *
@@ -102,7 +100,8 @@ class ResponsivePreviewToolbarTest extends ResponsivePreviewTestBase {
    * Tests cache invalidation.
    */
   public function testCacheInvalidation() {
-    $device_storage = \Drupal::entityTypeManager()->getStorage('responsive_preview_device');
+    $device_storage = \Drupal::entityTypeManager()
+      ->getStorage('responsive_preview_device');
 
     $device_ids = array_keys($this->getDefaultDevices(TRUE));
     $devices = array_combine($device_ids, $device_ids);
