|
@@ 62-74 (lines=13) @@
|
| 59 |
|
/** |
| 60 |
|
* Tests should_autoloader_reset() with an already active plugin. |
| 61 |
|
*/ |
| 62 |
|
public function test_should_autoloader_reset_known_plugin() { |
| 63 |
|
global $jetpack_autoloader_activating_plugins_paths; |
| 64 |
|
|
| 65 |
|
$autoloader_handler = new Autoloader_Handler( |
| 66 |
|
TEST_DATA_PATH . '/plugins/plugin_current', |
| 67 |
|
array( TEST_DATA_PATH . '/plugins/plugin_current' ), |
| 68 |
|
new Autoloader_Locator( new Version_Selector() ), |
| 69 |
|
new Version_Selector() |
| 70 |
|
); |
| 71 |
|
|
| 72 |
|
$this->assertFalse( $autoloader_handler->should_autoloader_reset() ); |
| 73 |
|
$this->assertEmpty( $jetpack_autoloader_activating_plugins_paths ); |
| 74 |
|
} |
| 75 |
|
|
| 76 |
|
/** |
| 77 |
|
* Tests should_autoloader_reset() with an activating, unknown plugin. |
|
@@ 79-92 (lines=14) @@
|
| 76 |
|
/** |
| 77 |
|
* Tests should_autoloader_reset() with an activating, unknown plugin. |
| 78 |
|
*/ |
| 79 |
|
public function test_should_autoloader_reset_unknown_plugin() { |
| 80 |
|
global $jetpack_autoloader_activating_plugins_paths; |
| 81 |
|
|
| 82 |
|
$autoloader_handler = new Autoloader_Handler( |
| 83 |
|
TEST_DATA_PATH . '/plugins/plugin_current', |
| 84 |
|
array(), |
| 85 |
|
new Autoloader_Locator( new Version_Selector() ), |
| 86 |
|
new Version_Selector() |
| 87 |
|
); |
| 88 |
|
|
| 89 |
|
$this->assertTrue( $autoloader_handler->should_autoloader_reset() ); |
| 90 |
|
$this->assertCount( 1, $jetpack_autoloader_activating_plugins_paths ); |
| 91 |
|
$this->assertEquals( TEST_DATA_PATH . '/plugins/plugin_current', $jetpack_autoloader_activating_plugins_paths[0] ); |
| 92 |
|
} |
| 93 |
|
|
| 94 |
|
/** |
| 95 |
|
* Tests that the handler is able to build a loader. |