|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
use PHPUnit\Framework\TestCase; |
|
|
|
|
|
|
4
|
|
|
use TwinDigital\WPTools\PluginTools; |
|
5
|
|
|
|
|
6
|
|
|
class PluginToolsTest extends TestCase { |
|
7
|
|
|
|
|
8
|
|
|
/** |
|
9
|
|
|
* Tests if the plugin_list is loaded. |
|
10
|
|
|
* |
|
11
|
|
|
* @covers \TwinDigital\WPTools\PluginTools::loadPluginList() |
|
12
|
|
|
* @return void |
|
13
|
|
|
*/ |
|
14
|
|
|
public function testLoadPluginList() { |
|
15
|
|
|
$this->assertNotCount(0, PluginTools::$loadedPlugins, 'Pluginlist is empty, probably failed loading the list of plugins.'); |
|
16
|
|
|
} |
|
17
|
|
|
|
|
18
|
|
|
/** |
|
19
|
|
|
* Tests if the plugin_list is loaded. |
|
20
|
|
|
* |
|
21
|
|
|
* @covers \TwinDigital\WPTools\PluginTools::loadPluginList() |
|
22
|
|
|
* @return void |
|
23
|
|
|
*/ |
|
24
|
|
|
public function testLoadPluginListForced() { |
|
25
|
|
|
PluginTools::loadPluginList(true); |
|
26
|
|
|
$this->assertNotCount(0, PluginTools::$loadedPlugins, 'Pluginlist is empty, probably failed loading the list of plugins.'); |
|
27
|
|
|
} |
|
28
|
|
|
|
|
29
|
|
|
/** |
|
30
|
|
|
* Tests if the plugin_list is loaded. |
|
31
|
|
|
* |
|
32
|
|
|
* @covers \TwinDigital\WPTools\PluginTools::refreshLoadedPlugins() |
|
33
|
|
|
* @return void |
|
34
|
|
|
*/ |
|
35
|
|
|
public function testRefreshLoadedPlugins() { |
|
36
|
|
|
PluginTools::$loadedPlugins = null; |
|
37
|
|
|
PluginTools::refreshLoadedPlugins(); |
|
38
|
|
|
$this->assertNotCount(0, PluginTools::$loadedPlugins, 'Pluginlist is empty, probably failed loading the list of plugins.'); |
|
39
|
|
|
} |
|
40
|
|
|
|
|
41
|
|
|
/** |
|
42
|
|
|
* Tests if the plugin_list is loaded. |
|
43
|
|
|
* |
|
44
|
|
|
* @covers \TwinDigital\WPTools\PluginTools::getPluginByTitle() |
|
45
|
|
|
* @return void |
|
46
|
|
|
*/ |
|
47
|
|
|
public function testGetPluginByTitle() { |
|
48
|
|
|
PluginTools::refreshLoadedPlugins(); |
|
49
|
|
|
$this->assertEmpty(PluginTools::getPluginByTitle('Non-existing-plugin', 'Found a plugin that is non-existing? Oops')); |
|
|
|
|
|
|
50
|
|
|
$this->assertNotEmpty(PluginTools::getPluginByTitle('WPTools', 'Current plugin is not active?')); |
|
51
|
|
|
} |
|
52
|
|
|
} |
|
53
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths