diff --git a/integrations/vip-governance.php b/integrations/vip-governance.php new file mode 100644 index 0000000000..de9bdce570 --- /dev/null +++ b/integrations/vip-governance.php @@ -0,0 +1,63 @@ +is_loaded() ) { + return; + } + + // Load the version of the plugin that should be set to the latest version, otherwise if it's not found deactivate the integration. + $load_path = WPMU_PLUGIN_DIR . '/vip-integrations/vip-governance-' . $this->version . '/vip-governance.php'; + if ( file_exists( $load_path ) ) { + require_once $load_path; + } else { + $this->is_active = false; + } + } ); + } + + /** + * Configure `VIP Governance` for VIP Platform. + */ + public function configure(): void {} +} diff --git a/tests/integrations/test-vip-block-data-api.php b/tests/integrations/test-vip-block-data-api.php new file mode 100644 index 0000000000..5d32c50489 --- /dev/null +++ b/tests/integrations/test-vip-block-data-api.php @@ -0,0 +1,30 @@ +slug ); + + $block_data_api_integration->load(); + + $this->assertFalse( $block_data_api_integration->is_active() ); + } + + public function test__if_is_loaded_gives_back_true_when_loaded(): void { + $block_data_api_integration = new BlockDataApiIntegration( $this->slug ); + + $this->assertFalse( $block_data_api_integration->is_loaded() ); + } +} diff --git a/tests/integrations/test-vip-governance.php b/tests/integrations/test-vip-governance.php new file mode 100644 index 0000000000..ab1754ef63 --- /dev/null +++ b/tests/integrations/test-vip-governance.php @@ -0,0 +1,30 @@ +slug ); + + $vip_governance_integration->load(); + + $this->assertFalse( $vip_governance_integration->is_active() ); + } + + public function test__if_is_loaded_gives_back_true_when_loaded(): void { + $vip_governance_integration = new VipGovernanceIntegration( $this->slug ); + + $this->assertFalse( $vip_governance_integration->is_loaded() ); + } +} diff --git a/vip-integrations.php b/vip-integrations.php index 207804117f..0767948588 100644 --- a/vip-integrations.php +++ b/vip-integrations.php @@ -14,6 +14,8 @@ defined( 'ABSPATH' ) || die(); +// @codeCoverageIgnoreStart - the actual code here is tested individually in the unit tests. + require_once __DIR__ . '/integrations/integration.php'; require_once __DIR__ . '/integrations/integrations.php'; require_once __DIR__ . '/integrations/enums.php'; @@ -25,6 +27,14 @@ IntegrationsSingleton::instance()->register( new BlockDataApiIntegration( 'block-data-api' ) ); IntegrationsSingleton::instance()->register( new ParselyIntegration( 'parsely' ) ); +// ToDo: Remove this after the initial deployment of the VIP Governance integration. +if ( file_exists( __DIR__ . '/integrations/vip-governance.php' ) ) { + require_once __DIR__ . '/integrations/vip-governance.php'; + IntegrationsSingleton::instance()->register( new VipGovernanceIntegration( 'vip-governance' ) ); +} + +// @codeCoverageIgnoreEnd + /** * Activates an integration with an optional configuration value. *