Skip to content

Commit

Permalink
Add test for #17939 bug
Browse files Browse the repository at this point in the history
  • Loading branch information
kraftbj committed Dec 1, 2020
1 parent a4175da commit b4412c2
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
3 changes: 3 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
<testsuite name="comment-likes">
<directory prefix="test" suffix=".php">tests/php/modules/comment-likes</directory>
</testsuite>
<testsuite name="calypsoify">
<directory prefix="test" suffix=".php">tests/php/modules/calypsoify</directory>
</testsuite>
<testsuite name="likes">
<directory prefix="test_" suffix=".php">tests/php/modules/likes</directory>
</testsuite>
Expand Down
37 changes: 37 additions & 0 deletions tests/php/modules/calypsoify/test-class.jetpack-calypsoify.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php
/**
* Class Calypsoify.
*
* @package Jetpack
*/

require_jetpack_file( 'modules/calypsoify/class.jetpack-calypsoify.php' );

/**
* Class WP_Test_Jetpack_Calypsoify
*/
class WP_Test_Jetpack_Calypsoify extends WP_UnitTestCase {

/**
* Sets up each test.
*
* @inheritDoc
*/
public function setUp() {
parent::setUp();
$this->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' ) );
}
}

0 comments on commit b4412c2

Please sign in to comment.