diff --git a/modules/authcache_commerce/authcache_commerce.test b/modules/authcache_commerce/authcache_commerce.test
index 0faf69c..c4f3516 100644
--- a/modules/authcache_commerce/authcache_commerce.test
+++ b/modules/authcache_commerce/authcache_commerce.test
@@ -4,6 +4,12 @@
  * Test cases for the Authcache Commerce module.
  */
 
+if (!class_exists('CommerceCartTestCase')) {
+  class CommerceCartTestCase extends DrupalWebTestCase {
+    protected $_commerce_missing = TRUE;
+  }
+}
+
 /**
  * Tests for markup substitution.
  */
@@ -27,6 +33,12 @@ class AuthcacheCommerceTest extends CommerceCartTestCase {
    * {@inheritdoc}
    */
   public function setUp() {
+    if (isset($this->_commerce_missing)) {
+      parent::setUp();
+      $this->fail(t('Failed to run test. Commerce module not installed.'));
+      return;
+    }
+
     $this->setUpHelper('all', array(
       'authcache_commerce',
       'authcache_form',
@@ -133,6 +145,10 @@ class AuthcacheCommerceTest extends CommerceCartTestCase {
    * Bug: https://www.drupal.org/node/2475503
    */
   public function testCommerceAddToCartWithFormCache() {
+    if (isset($this->_commerce_missing)) {
+      return;
+    }
+
     $this->stubmod->hook('authcache_p13n_client', array(
       'authcache_p13n_test' => array(
         'title' => t('Test Client'),
