diff --git a/modules/calypsoify/class.jetpack-calypsoify.php b/modules/calypsoify/class.jetpack-calypsoify.php
index 293636135f4ad..f3937495f20ef 100644
--- a/modules/calypsoify/class.jetpack-calypsoify.php
+++ b/modules/calypsoify/class.jetpack-calypsoify.php
@@ -4,6 +4,7 @@
* Ported from an internal Automattic plugin.
*/
+use Automattic\Jetpack\Dashboard_Customizations\Masterbar;
use Automattic\Jetpack\Redirect;
use Automattic\Jetpack\Status;
@@ -76,8 +77,8 @@ public function admin_color_override( $color ) {
}
public function mock_masterbar_activation() {
- include_once JETPACK__PLUGIN_DIR . 'modules/masterbar/masterbar.php';
- new A8C_WPCOM_Masterbar;
+ include_once JETPACK__PLUGIN_DIR . 'modules/masterbar/masterbar/class-masterbar.php';
+ new Masterbar();
}
public function remove_core_menus() {
diff --git a/phpunit.xml.dist b/phpunit.xml.dist
index 4bde03b85c4d1..f366b871676cf 100644
--- a/phpunit.xml.dist
+++ b/phpunit.xml.dist
@@ -30,6 +30,9 @@
tests/php/modules/comment-likes
+
+ tests/php/modules/calypsoify
+
tests/php/modules/likes
diff --git a/tests/php/modules/calypsoify/test-class.jetpack-calypsoify.php b/tests/php/modules/calypsoify/test-class.jetpack-calypsoify.php
new file mode 100644
index 0000000000000..1847fbca84fd9
--- /dev/null
+++ b/tests/php/modules/calypsoify/test-class.jetpack-calypsoify.php
@@ -0,0 +1,37 @@
+instance = Jetpack_Calypsoify::getInstance();
+ }
+
+ /**
+ * Sets up the Masterbar mock.
+ *
+ * For sites when Masterbar is not active, we mock it. This test confirms that functions.
+ *
+ * @covers Jetpack_Calypsoify::mock_masterbar_activation
+ * @see https://github.com/Automattic/jetpack/pull/17939
+ */
+ public function test_mock_masterbar_activation() {
+ $this->instance->mock_masterbar_activation();
+ $this->assertTrue( class_exists( '\Automattic\Jetpack\Dashboard_Customizations\Masterbar' ) );
+ }
+}