diff --git a/src/Form/SharethisConfigurationForm.php b/src/Form/SharethisConfigurationForm.php
index d8d3c23..a7cb0c4 100644
--- a/src/Form/SharethisConfigurationForm.php
+++ b/src/Form/SharethisConfigurationForm.php
@@ -114,7 +114,7 @@ class SharethisConfigurationForm extends ConfigFormBase {
   public function buildForm(array $form, FormStateInterface $form_state) {
 
     global $base_url;
-    $my_path = drupal_get_path('module', 'sharethis');
+    $my_path = \Drupal::service('extension.list.module')->getPath('sharethis');
 
     // First, setup variables we will need.
     // Get the path variables setup.
diff --git a/tests/src/Functional/ShareThisTest.php b/tests/src/Functional/ShareThisTest.php
index f4112f4..a7ee6f9 100644
--- a/tests/src/Functional/ShareThisTest.php
+++ b/tests/src/Functional/ShareThisTest.php
@@ -50,8 +50,9 @@ class ShareThisTest extends BrowserTestBase {
     $edit = [];
     $edit['title[0][value]'] = $this->randomMachineName(8);
     $edit['body[0][value]'] = $this->randomMachineName(16);
-    $this->drupalPostForm('node/add/page', $edit, t('Preview'));
-    $this->assertResponse(200);
+    $this->drupalGet('node/add/page');
+    $this->submitForm($edit, t('Preview'));
+    $this->assertSession()->statusCodeEquals(200);
   }
 
 }
diff --git a/tests/src/Functional/SharethisBlockTest.php b/tests/src/Functional/SharethisBlockTest.php
index 4b53ede..aff2eeb 100644
--- a/tests/src/Functional/SharethisBlockTest.php
+++ b/tests/src/Functional/SharethisBlockTest.php
@@ -43,8 +43,9 @@ class SharethisBlockTest extends NodeTestBase {
    */
   public function testSharethisBlock() {
     $edit['location'] = 'block';
-    $this->drupalPostForm('admin/config/services/sharethis', $edit, t('Save configuration'));
-    $this->assertText(t('The configuration options have been saved.'));
+    $this->drupalGet('admin/config/services/sharethis');
+    $this->submitForm($edit, t('Save configuration'));
+    $this->assertSession()->pageTextContains(t('The configuration options have been saved.'));
     // Test availability of sharethis block in the admin 'Place blocks' list.
     \Drupal::service('theme_installer')->install(['bartik', 'seven', 'stark']);
     $theme_settings = $this->config('system.theme');
@@ -55,13 +56,14 @@ class SharethisBlockTest extends NodeTestBase {
       $block['id'] = strtolower($this->randomMachineName());
       $block['theme'] = $theme;
       $block['region'] = 'content';
-      $this->drupalPostForm('admin/structure/block/add/sharethis_block', $block, t('Save block'));
-      $this->assertText(t('The block configuration has been saved.'));
+      $this->drupalGet('admin/structure/block/add/sharethis_block');
+      $this->submitForm($block, t('Save block'));
+      $this->assertSession()->pageTextContains(t('The block configuration has been saved.'));
       // Set the default theme and ensure the block is placed.
       $theme_settings->set('default', $theme)->save();
       $this->drupalGet('');
       $result = $this->xpath('//div[@class=:class]', [':class' => 'sharethis-wrapper']);
-      $this->assertEqual(count($result), 1, 'Sharethis links found');
+      $this->assertEquals(count($result), 1, 'Sharethis links found');
     }
   }
 
diff --git a/tests/src/Functional/SharethisConfigFormTest.php b/tests/src/Functional/SharethisConfigFormTest.php
index cbf4c98..363b375 100644
--- a/tests/src/Functional/SharethisConfigFormTest.php
+++ b/tests/src/Functional/SharethisConfigFormTest.php
@@ -55,8 +55,9 @@ class SharethisConfigFormTest extends NodeTestBase {
   public function testSharethisConfigForm() {
     // Test that out of range values are picked up.
     $edit['location'] = 'content';
-    $this->drupalPostForm('admin/config/services/sharethis', $edit, t('Save configuration'));
-    $this->assertText(t('The configuration options have been saved.'));
+    $this->drupalGet('admin/config/services/sharethis');
+    $this->submitForm($edit, t('Save configuration'));
+    $this->assertSession()->pageTextContains(t('The configuration options have been saved.'));
     $settings = [
       'body' => [['value' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam vitae arcu at leo cursus laoreet. Curabitur dui tortor, adipiscing malesuada tempor in, bibendum ac diam. Cras non tellus a libero pellentesque condimentum. What is a Drupalism? Suspendisse ac lacus libero. Ut non est vel nisl faucibus interdum nec sed leo. Pellentesque sem risus, vulputate eu semper eget, auctor in libero. Ut fermentum est vitae metus convallis scelerisque. Phasellus pellentesque rhoncus tellus, eu dignissim purus posuere id. Quisque eu fringilla ligula. Morbi ullamcorper, lorem et mattis egestas, tortor neque pretium velit, eget eleifend odio turpis eu purus. Donec vitae metus quis leo pretium tincidunt a pulvinar sem. Morbi adipiscing laoreet mauris vel placerat. Nullam elementum, nisl sit amet scelerisque malesuada, dolor nunc hendrerit quam, eu ultrices erat est in orci. Curabitur feugiat egestas nisl sed accumsan.']],
       'promote' => 1,
@@ -66,7 +67,7 @@ class SharethisConfigFormTest extends NodeTestBase {
     // Render the node.
     $this->drupalGet('node/' . $node->id());
     $result = $this->xpath('//div[@class=:class]', [':class' => 'sharethis-wrapper']);
-    $this->assertEqual(count($result), 1, 'Sharethis links found');
+    $this->assertEquals(count($result), 1, 'Sharethis links found');
   }
 
   /**
@@ -78,9 +79,10 @@ class SharethisConfigFormTest extends NodeTestBase {
     $edit['location'] = 'links';
     $edit['article_options[full]'] = 'full';
     $edit['page_options[full]'] = 'full';
+    $this->drupalGet('admin/config/services/sharethis');
 
-    $this->drupalPostForm('admin/config/services/sharethis', $edit, t('Save configuration'));
-    $this->assertText(t('The configuration options have been saved.'));
+    $this->submitForm($edit, t('Save configuration'));
+    $this->assertSession()->pageTextContains(t('The configuration options have been saved.'));
     $settings = [
       'body' => [['value' => 'Lorem ipsum dolor sit amet, consectetur www.drupal.org']],
       'promote' => 1,
@@ -90,19 +92,19 @@ class SharethisConfigFormTest extends NodeTestBase {
     // Render the node.
     $this->drupalGet('node/' . $node->id());
     $result = $this->xpath('//div[@class=:class]', [':class' => 'sharethis-wrapper']);
-    $this->assertEqual(count($result), 1, 'Sharethis links found');
+    $this->assertEquals(count($result), 1, 'Sharethis links found');
     $result = $this->xpath('//span[@class=:class]', [':class' => 'st_facebook_button']);
-    $this->assertEqual(count($result), 1, 'Facebook button found');
+    $this->assertEquals(count($result), 1, 'Facebook button found');
     $result = $this->xpath('//span[@class=:class]', [':class' => 'st_twitter_button']);
-    $this->assertEqual(count($result), 1, 'Twitter button found');
+    $this->assertEquals(count($result), 1, 'Twitter button found');
     $result = $this->xpath('//span[@class=:class]', [':class' => 'st_linkedin_button']);
-    $this->assertEqual(count($result), 1, 'LinkedIn button found');
+    $this->assertEquals(count($result), 1, 'LinkedIn button found');
     $result = $this->xpath('//span[@class=:class]', [':class' => 'st_email_button']);
-    $this->assertEqual(count($result), 1, 'Email button found');
+    $this->assertEquals(count($result), 1, 'Email button found');
     $result = $this->xpath('//span[@class=:class]', [':class' => 'st_sharethis_button']);
-    $this->assertEqual(count($result), 1, 'Sharethis button links found');
+    $this->assertEquals(count($result), 1, 'Sharethis button links found');
     $result = $this->xpath('//span[@class=:class]', [':class' => 'st_pinterest_button']);
-    $this->assertEqual(count($result), 1, 'Pinterest button found');
+    $this->assertEquals(count($result), 1, 'Pinterest button found');
   }
 
 }
diff --git a/tests/src/Functional/Views/SharethisViewsPluginTest.php b/tests/src/Functional/Views/SharethisViewsPluginTest.php
index fcf947f..4318927 100644
--- a/tests/src/Functional/Views/SharethisViewsPluginTest.php
+++ b/tests/src/Functional/Views/SharethisViewsPluginTest.php
@@ -67,10 +67,10 @@ class SharethisViewsPluginTest extends ViewTestBase {
     $view = Views::getView('test_sharethis');
     $view->setDisplay('page_1');
     $this->executeView($view);
-    $this->assertEqual(count($view->result), 2);
+    $this->assertEquals(count($view->result), 2);
     $this->drupalGet('test-sharethis');
     $result = $this->xpath('//div[@class=:class]', [':class' => 'sharethis-wrapper']);
-    $this->assertEqual(count($result), 2, 'Sharethis links found');
+    $this->assertEquals(count($result), 2, 'Sharethis links found');
   }
 
 }
