|
@@ 36-51 (lines=16) @@
|
| 33 |
|
$this->clear_enqueued_scripts(); |
| 34 |
|
} |
| 35 |
|
|
| 36 |
|
public function test_jitm_disabled_by_filter() { |
| 37 |
|
$this->mock_filters( array( |
| 38 |
|
array( 'jetpack_just_in_time_msgs', false, false ), |
| 39 |
|
), "Automattic\Jetpack\JITMS" ); |
| 40 |
|
|
| 41 |
|
// Used for Status->is_development_mode(). |
| 42 |
|
$this->mock_filters( array( |
| 43 |
|
array( 'jetpack_just_in_time_msgs', false, false ), |
| 44 |
|
), "Automattic\Jetpack" ); |
| 45 |
|
$this->mock_site_url(); |
| 46 |
|
|
| 47 |
|
$jitm = new JITM(); |
| 48 |
|
$this->assertFalse( $jitm->register() ); |
| 49 |
|
|
| 50 |
|
$this->clear_mock_filters(); |
| 51 |
|
} |
| 52 |
|
|
| 53 |
|
public function test_jitm_enabled_by_default() { |
| 54 |
|
$this->mock_filters( array( |
|
@@ 53-68 (lines=16) @@
|
| 50 |
|
$this->clear_mock_filters(); |
| 51 |
|
} |
| 52 |
|
|
| 53 |
|
public function test_jitm_enabled_by_default() { |
| 54 |
|
$this->mock_filters( array( |
| 55 |
|
array( 'jetpack_just_in_time_msgs', false, true ), |
| 56 |
|
), "Automattic\Jetpack\JITMS" ); |
| 57 |
|
|
| 58 |
|
// Used for Status->is_development_mode(). |
| 59 |
|
$this->mock_filters( array( |
| 60 |
|
array( 'jetpack_just_in_time_msgs', false, true ), |
| 61 |
|
), "Automattic\Jetpack" ); |
| 62 |
|
$this->mock_site_url(); |
| 63 |
|
|
| 64 |
|
$jitm = new JITM(); |
| 65 |
|
$this->assertTrue( $jitm->register() ); |
| 66 |
|
|
| 67 |
|
$this->clear_mock_filters(); |
| 68 |
|
} |
| 69 |
|
|
| 70 |
|
/** |
| 71 |
|
* This is an example of a test which uses Mockery to tests a class static method. |