diff --git a/Makefile b/Makefile index 72f661dd9..84a03d521 100644 --- a/Makefile +++ b/Makefile @@ -319,6 +319,7 @@ TEST_WEB_56 := \ test_web_wordpress_48 \ test_web_wordpress_55 \ test_web_zend_1 \ + test_web_drupal_7 \ test_web_custom TEST_INTEGRATIONS_70 := \ @@ -465,6 +466,7 @@ TEST_WEB_73 := \ test_web_yii_2 \ test_web_zend_1 \ test_web_custom \ + test_web_drupal_7 \ test_web_drupal_89 TEST_INTEGRATIONS_74 := \ @@ -501,6 +503,7 @@ TEST_WEB_74 := \ test_web_yii_2 \ test_web_zend_1 \ test_web_custom \ + test_web_drupal_7 \ test_web_drupal_89 # NOTE: test_integrations_phpredis5 is not included in the PHP 8.0 integrations tests because of this bug that only diff --git a/src/DDTrace/Integrations/IntegrationsLoader.php b/src/DDTrace/Integrations/IntegrationsLoader.php index 94682e1a8..d557a68fc 100644 --- a/src/DDTrace/Integrations/IntegrationsLoader.php +++ b/src/DDTrace/Integrations/IntegrationsLoader.php @@ -73,6 +73,8 @@ public function __construct(array $integrations) '\DDTrace\Integrations\Mysqli\MysqliIntegration'; $this->integrations[SymfonyIntegration::NAME] = '\DDTrace\Integrations\Symfony\SymfonyIntegration'; + $this->integrations[DrupalIntegration::NAME] = + '\DDTrace\Integrations\Drupal\DrupalIntegration'; return; } @@ -96,11 +98,8 @@ public function __construct(array $integrations) '\DDTrace\Integrations\Symfony\SymfonyIntegration'; $this->integrations[ZendFrameworkIntegration::NAME] = '\DDTrace\Integrations\ZendFramework\ZendFrameworkIntegration'; - - if (\PHP_MAJOR_VERSION == 7) { - $this->integrations[DrupalIntegration::NAME] = - '\DDTrace\Integrations\Drupal\DrupalIntegration'; - } + $this->integrations[DrupalIntegration::NAME] = + '\DDTrace\Integrations\Drupal\DrupalIntegration'; // For PHP 7.0+ use C level deferred integration loader if (\PHP_MAJOR_VERSION < 7) { diff --git a/tests/Integrations/Drupal/V7/CommonScenariosTest.php b/tests/Integrations/Drupal/V7/CommonScenariosTest.php index 01143411d..5b80a4c19 100644 --- a/tests/Integrations/Drupal/V7/CommonScenariosTest.php +++ b/tests/Integrations/Drupal/V7/CommonScenariosTest.php @@ -91,7 +91,7 @@ public function testSuccessfulRequest() [ SpanAssertion::exists('module_invoke', 'system_cron')->withChildren(array_merge( array_fill(0, 15, SpanAssertion::exists('PDO.prepare')), - array_fill(0, 15, SpanAssertion::exists('PDOStatement.execute')), + array_fill(0, 15, SpanAssertion::exists('PDOStatement.execute')) )), SpanAssertion::exists('module_invoke', 'search_cron')->withChildren([ SpanAssertion::exists('PDO.prepare'), @@ -103,7 +103,7 @@ public function testSuccessfulRequest() ]), SpanAssertion::exists('module_invoke', 'field_cron')->withChildren(array_merge( array_fill(0, 11, SpanAssertion::exists('PDO.prepare')), - array_fill(0, 11, SpanAssertion::exists('PDOStatement.execute')), + array_fill(0, 11, SpanAssertion::exists('PDOStatement.execute')) )), SpanAssertion::exists('module_invoke', 'dblog_cron')->withChildren([ SpanAssertion::exists('PDO.prepare'), diff --git a/tests/Unit/Integrations/IntegrationsLoaderTest.php b/tests/Unit/Integrations/IntegrationsLoaderTest.php index 9952e6fc5..94cd393e1 100644 --- a/tests/Unit/Integrations/IntegrationsLoaderTest.php +++ b/tests/Unit/Integrations/IntegrationsLoaderTest.php @@ -157,7 +157,6 @@ public function testWeDidNotForgetToRegisterALibraryForAutoLoading() $excluded = []; if (\PHP_MAJOR_VERSION < 7) { $excluded[] = 'phpredis'; // PHP 7 only integration - $excluded[] = 'drupal'; } else { // Deferred loading integrations $excluded[] = 'elasticsearch'; @@ -175,7 +174,6 @@ public function testWeDidNotForgetToRegisterALibraryForAutoLoading() $excluded[] = 'lumen'; $excluded[] = 'mongo'; $excluded[] = 'zendframework'; - $excluded[] = 'drupal'; } foreach ($excluded as $integrationToExclude) { $index = array_search($integrationToExclude, $expected, true);