|
@@ 76-87 (lines=12) @@
|
| 73 |
|
* @runInSeparateProcess |
| 74 |
|
* @preserveGlobalState disabled |
| 75 |
|
*/ |
| 76 |
|
public function test_should_stop_init_when_autoloader_already_initialized() { |
| 77 |
|
global $jetpack_autoloader_latest_version; |
| 78 |
|
$jetpack_autoloader_latest_version = Test_Plugin_Factory::VERSION_CURRENT; |
| 79 |
|
|
| 80 |
|
$this->assertTrue( |
| 81 |
|
$this->guard->should_stop_init( |
| 82 |
|
TEST_PLUGIN_DIR, |
| 83 |
|
array(), |
| 84 |
|
false |
| 85 |
|
) |
| 86 |
|
); |
| 87 |
|
} |
| 88 |
|
|
| 89 |
|
/** |
| 90 |
|
* Tests that the guard allows initialization when the autoloader has been initialized but we've been deliberately included by it. |
|
@@ 94-106 (lines=13) @@
|
| 91 |
|
* |
| 92 |
|
* @preserveGlobalState disabled |
| 93 |
|
*/ |
| 94 |
|
public function test_should_allow_init_when_including_latest() { |
| 95 |
|
// Mark it as already initialized so we can make sure it overrides it. |
| 96 |
|
global $jetpack_autoloader_latest_version; |
| 97 |
|
$jetpack_autoloader_latest_version = Test_Plugin_Factory::VERSION_CURRENT; |
| 98 |
|
|
| 99 |
|
$this->assertFalse( |
| 100 |
|
$this->guard->should_stop_init( |
| 101 |
|
TEST_PLUGIN_DIR, |
| 102 |
|
array(), |
| 103 |
|
true |
| 104 |
|
) |
| 105 |
|
); |
| 106 |
|
} |
| 107 |
|
|
| 108 |
|
/** |
| 109 |
|
* Tests that the guard stops initialization when not the latest autoloader. |