MDL-49329 admin: Add core_plugin_manager::available_updates() method
[moodle.git] / lib / tests / plugin_manager_test.php
CommitLineData
bde002b8
PS
1<?php
2// This file is part of Moodle - http://moodle.org/
3//
4// Moodle is free software: you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published by
6// the Free Software Foundation, either version 3 of the License, or
7// (at your option) any later version.
8//
9// Moodle is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU General Public License for more details.
13//
14// You should have received a copy of the GNU General Public License
15// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
16
17/**
18 * Unit tests for plugin manager class.
19 *
20 * @package core
21 * @category phpunit
22 * @copyright 2013 Petr Skoda {@link http://skodak.org}
23 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
24 */
25
26defined('MOODLE_INTERNAL') || die();
27
361feecd
DM
28global $CFG;
29require_once($CFG->dirroot.'/lib/tests/fixtures/testable_plugin_manager.php');
5a92cd0b 30require_once($CFG->dirroot.'/lib/tests/fixtures/testable_plugininfo_base.php');
361feecd 31
bde002b8
PS
32/**
33 * Tests of the basic API of the plugin manager.
34 */
35class core_plugin_manager_testcase extends advanced_testcase {
36
35f2b674
DM
37 public function tearDown() {
38 // The caches of the testable singleton must be reset explicitly. It is
39 // safer to kill the whole testable singleton at the end of every test.
40 testable_core_plugin_manager::reset_caches();
41 }
42
bde002b8 43 public function test_instance() {
361feecd
DM
44 $pluginman1 = core_plugin_manager::instance();
45 $this->assertInstanceOf('core_plugin_manager', $pluginman1);
e87214bd 46 $pluginman2 = core_plugin_manager::instance();
361feecd
DM
47 $this->assertSame($pluginman1, $pluginman2);
48 $pluginman3 = testable_core_plugin_manager::instance();
49 $this->assertInstanceOf('core_plugin_manager', $pluginman3);
50 $this->assertInstanceOf('testable_core_plugin_manager', $pluginman3);
51 $pluginman4 = testable_core_plugin_manager::instance();
52 $this->assertSame($pluginman3, $pluginman4);
53 $this->assertNotSame($pluginman1, $pluginman3);
bde002b8
PS
54 }
55
56 public function test_reset_caches() {
57 // Make sure there are no warnings or errors.
e87214bd 58 core_plugin_manager::reset_caches();
361feecd 59 testable_core_plugin_manager::reset_caches();
bde002b8
PS
60 }
61
35f2b674
DM
62 /**
63 * Make sure that the tearDown() really kills the singleton after this test.
64 */
65 public function test_teardown_works_precheck() {
66 $pluginman = testable_core_plugin_manager::instance();
67 $pluginfo = testable_plugininfo_base::fake_plugin_instance('fake', '/dev/null', 'one', '/dev/null/fake',
68 'testable_plugininfo_base', $pluginman);
69 $pluginman->inject_testable_plugininfo('fake', 'one', $pluginfo);
70
71 $this->assertInstanceOf('\core\plugininfo\base', $pluginman->get_plugin_info('fake_one'));
72 $this->assertNull($pluginman->get_plugin_info('fake_two'));
73 }
74
75 public function test_teardown_works_postcheck() {
76 $pluginman = testable_core_plugin_manager::instance();
77 $this->assertNull($pluginman->get_plugin_info('fake_one'));
78 $this->assertNull($pluginman->get_plugin_info('fake_two'));
79 }
80
bde002b8
PS
81 public function test_get_plugin_types() {
82 // Make sure there are no warnings or errors.
e87214bd 83 $types = core_plugin_manager::instance()->get_plugin_types();
bde002b8
PS
84 $this->assertInternalType('array', $types);
85 foreach ($types as $type => $fulldir) {
86 $this->assertFileExists($fulldir);
87 }
88 }
89
90 public function test_get_installed_plugins() {
e87214bd 91 $types = core_plugin_manager::instance()->get_plugin_types();
bde002b8 92 foreach ($types as $type => $fulldir) {
e87214bd 93 $installed = core_plugin_manager::instance()->get_installed_plugins($type);
bde002b8
PS
94 foreach ($installed as $plugin => $version) {
95 $this->assertRegExp('/^[a-z]+[a-z0-9_]*$/', $plugin);
96 $this->assertTrue(is_numeric($version), 'All plugins should have a version, plugin '.$type.'_'.$plugin.' does not have version info.');
97 }
98 }
99 }
100
101 public function test_get_enabled_plugins() {
e87214bd 102 $types = core_plugin_manager::instance()->get_plugin_types();
bde002b8 103 foreach ($types as $type => $fulldir) {
e87214bd 104 $enabled = core_plugin_manager::instance()->get_enabled_plugins($type);
bde002b8
PS
105 if (is_array($enabled)) {
106 foreach ($enabled as $key => $val) {
107 $this->assertRegExp('/^[a-z]+[a-z0-9_]*$/', $key);
108 $this->assertSame($key, $val);
109 }
110 } else {
111 $this->assertNull($enabled);
112 }
113 }
114 }
115
116 public function test_get_present_plugins() {
e87214bd 117 $types = core_plugin_manager::instance()->get_plugin_types();
bde002b8 118 foreach ($types as $type => $fulldir) {
e87214bd 119 $present = core_plugin_manager::instance()->get_present_plugins($type);
bde002b8
PS
120 if (is_array($present)) {
121 foreach ($present as $plugin => $version) {
122 $this->assertRegExp('/^[a-z]+[a-z0-9_]*$/', $plugin, 'All plugins are supposed to have version.php file.');
123 $this->assertInternalType('object', $version);
124 $this->assertTrue(is_numeric($version->version), 'All plugins should have a version, plugin '.$type.'_'.$plugin.' does not have version info.');
125 }
126 } else {
127 // No plugins of this type exist.
128 $this->assertNull($present);
129 }
130 }
131 }
132
133 public function test_get_plugins() {
361feecd
DM
134 $plugininfos1 = core_plugin_manager::instance()->get_plugins();
135 foreach ($plugininfos1 as $type => $infos) {
bde002b8 136 foreach ($infos as $name => $info) {
e87214bd 137 $this->assertInstanceOf('\core\plugininfo\base', $info);
bde002b8
PS
138 }
139 }
361feecd
DM
140
141 // The testable variant of the manager holds its own tree of the
142 // plugininfo objects.
143 $plugininfos2 = testable_core_plugin_manager::instance()->get_plugins();
144 $this->assertNotSame($plugininfos1['mod']['forum'], $plugininfos2['mod']['forum']);
145
146 // Singletons of each manager class share the same tree.
147 $plugininfos3 = core_plugin_manager::instance()->get_plugins();
148 $this->assertSame($plugininfos1['mod']['forum'], $plugininfos3['mod']['forum']);
149 $plugininfos4 = testable_core_plugin_manager::instance()->get_plugins();
150 $this->assertSame($plugininfos2['mod']['forum'], $plugininfos4['mod']['forum']);
bde002b8
PS
151 }
152
2d488c8f
DM
153 public function test_plugininfo_back_reference_to_the_plugin_manager() {
154 $plugman1 = core_plugin_manager::instance();
155 $plugman2 = testable_core_plugin_manager::instance();
156
157 foreach ($plugman1->get_plugins() as $type => $infos) {
158 foreach ($infos as $info) {
159 $this->assertSame($info->pluginman, $plugman1);
160 }
161 }
162
163 foreach ($plugman2->get_plugins() as $type => $infos) {
164 foreach ($infos as $info) {
165 $this->assertSame($info->pluginman, $plugman2);
166 }
167 }
168 }
169
bde002b8 170 public function test_get_plugins_of_type() {
e87214bd 171 $plugininfos = core_plugin_manager::instance()->get_plugins();
bde002b8 172 foreach ($plugininfos as $type => $infos) {
e87214bd 173 $this->assertSame($infos, core_plugin_manager::instance()->get_plugins_of_type($type));
bde002b8
PS
174 }
175 }
176
177 public function test_get_subplugins_of_plugin() {
178 global $CFG;
179
180 // Any standard plugin with subplugins is suitable.
181 $this->assertFileExists("$CFG->dirroot/lib/editor/tinymce", 'TinyMCE is not present.');
182
e87214bd 183 $subplugins = core_plugin_manager::instance()->get_subplugins_of_plugin('editor_tinymce');
bde002b8 184 foreach ($subplugins as $component => $info) {
e87214bd 185 $this->assertInstanceOf('\core\plugininfo\base', $info);
bde002b8
PS
186 }
187 }
188
189 public function test_get_subplugins() {
190 // Tested already indirectly from test_get_subplugins_of_plugin().
e87214bd 191 $subplugins = core_plugin_manager::instance()->get_subplugins();
bde002b8
PS
192 $this->assertInternalType('array', $subplugins);
193 }
194
195 public function test_get_parent_of_subplugin() {
196 global $CFG;
197
198 // Any standard plugin with subplugins is suitable.
199 $this->assertFileExists("$CFG->dirroot/lib/editor/tinymce", 'TinyMCE is not present.');
200
e87214bd 201 $parent = core_plugin_manager::instance()->get_parent_of_subplugin('tinymce');
bde002b8
PS
202 $this->assertSame('editor_tinymce', $parent);
203 }
204
205 public function test_plugin_name() {
206 global $CFG;
207
208 // Any standard plugin is suitable.
209 $this->assertFileExists("$CFG->dirroot/lib/editor/tinymce", 'TinyMCE is not present.');
210
e87214bd 211 $name = core_plugin_manager::instance()->plugin_name('editor_tinymce');
bde002b8
PS
212 $this->assertSame(get_string('pluginname', 'editor_tinymce'), $name);
213 }
214
215 public function test_plugintype_name() {
e87214bd 216 $name = core_plugin_manager::instance()->plugintype_name('editor');
bde002b8
PS
217 $this->assertSame(get_string('type_editor', 'core_plugin'), $name);
218 }
219
220 public function test_plugintype_name_plural() {
e87214bd 221 $name = core_plugin_manager::instance()->plugintype_name_plural('editor');
bde002b8
PS
222 $this->assertSame(get_string('type_editor_plural', 'core_plugin'), $name);
223 }
224
225 public function test_get_plugin_info() {
226 global $CFG;
227
228 // Any standard plugin is suitable.
229 $this->assertFileExists("$CFG->dirroot/lib/editor/tinymce", 'TinyMCE is not present.');
230
e87214bd
PS
231 $info = core_plugin_manager::instance()->get_plugin_info('editor_tinymce');
232 $this->assertInstanceOf('\core\plugininfo\editor', $info);
bde002b8
PS
233 }
234
235 public function test_can_uninstall_plugin() {
236 global $CFG;
237
238 // Any standard plugin that is required by some other standard plugin is ok.
239 $this->assertFileExists("$CFG->dirroot/$CFG->admin/tool/assignmentupgrade", 'assign upgrade tool is not present');
240 $this->assertFileExists("$CFG->dirroot/mod/assign", 'assign module is not present');
241
e87214bd
PS
242 $this->assertFalse(core_plugin_manager::instance()->can_uninstall_plugin('mod_assign'));
243 $this->assertTrue(core_plugin_manager::instance()->can_uninstall_plugin('tool_assignmentupgrade'));
bde002b8
PS
244 }
245
246 public function test_plugin_states() {
247 global $CFG;
248 $this->resetAfterTest();
249
250 // Any standard plugin that is ok.
251 $this->assertFileExists("$CFG->dirroot/mod/assign", 'assign module is not present');
252 $this->assertFileExists("$CFG->dirroot/mod/forum", 'forum module is not present');
253 $this->assertFileExists("$CFG->dirroot/$CFG->admin/tool/phpunit", 'phpunit tool is not present');
254 $this->assertFileNotExists("$CFG->dirroot/mod/xxxxxxx");
255 $this->assertFileNotExists("$CFG->dirroot/enrol/autorize");
256
257 // Ready for upgrade.
258 $assignversion = get_config('mod_assign', 'version');
259 set_config('version', $assignversion - 1, 'mod_assign');
260 // Downgrade problem.
261 $forumversion = get_config('mod_forum', 'version');
262 set_config('version', $forumversion + 1, 'mod_forum');
263 // Not installed yet.
264 unset_config('version', 'tool_phpunit');
265 // Missing already installed.
266 set_config('version', 2013091300, 'mod_xxxxxxx');
267 // Deleted present.
268 set_config('version', 2013091300, 'enrol_authorize');
269
e87214bd 270 core_plugin_manager::reset_caches();
bde002b8 271
e87214bd 272 $plugininfos = core_plugin_manager::instance()->get_plugins();
bde002b8
PS
273 foreach ($plugininfos as $type => $infos) {
274 foreach ($infos as $name => $info) {
6b61c2c4 275 /** @var core\plugininfo\base $info */
bde002b8 276 if ($info->component === 'mod_assign') {
e87214bd 277 $this->assertSame(core_plugin_manager::PLUGIN_STATUS_UPGRADE, $info->get_status(), 'Invalid '.$info->component.' state');
bde002b8 278 } else if ($info->component === 'mod_forum') {
e87214bd 279 $this->assertSame(core_plugin_manager::PLUGIN_STATUS_DOWNGRADE, $info->get_status(), 'Invalid '.$info->component.' state');
bde002b8 280 } else if ($info->component === 'tool_phpunit') {
e87214bd 281 $this->assertSame(core_plugin_manager::PLUGIN_STATUS_NEW, $info->get_status(), 'Invalid '.$info->component.' state');
bde002b8 282 } else if ($info->component === 'mod_xxxxxxx') {
e87214bd 283 $this->assertSame(core_plugin_manager::PLUGIN_STATUS_MISSING, $info->get_status(), 'Invalid '.$info->component.' state');
bde002b8 284 } else if ($info->component === 'enrol_authorize') {
e87214bd 285 $this->assertSame(core_plugin_manager::PLUGIN_STATUS_DELETE, $info->get_status(), 'Invalid '.$info->component.' state');
bde002b8 286 } else {
e87214bd 287 $this->assertSame(core_plugin_manager::PLUGIN_STATUS_UPTODATE, $info->get_status(), 'Invalid '.$info->component.' state');
bde002b8
PS
288 }
289 }
290 }
291 }
c44bbe35
DM
292
293 public function test_plugin_available_updates() {
c44bbe35
DM
294 $pluginman = testable_core_plugin_manager::instance();
295
cc5bc55e
DM
296 $foobar = testable_plugininfo_base::fake_plugin_instance('foo', '/dev/null', 'bar', '/dev/null/fake',
297 'testable_plugininfo_base', $pluginman);
298 $foobar->versiondb = 2015092900;
299 $foobar->versiondisk = 2015092900;
300
c44bbe35 301 foreach ($pluginman->get_plugins() as $type => $infos) {
cc5bc55e
DM
302 foreach ($infos as $name => $plugin) {
303 $updates = $plugin->available_updates();
304 if ($plugin->component != 'foo_bar') {
c44bbe35
DM
305 $this->assertNull($updates);
306 } else {
cc5bc55e
DM
307 $this->assertTrue(is_array($updates));
308 $this->assertEquals(3, count($updates));
309 foreach ($updates as $update) {
310 $this->assertInstanceOf('\core\update\info', $update);
311 $this->assertEquals($update->component, $plugin->component);
312 $this->assertTrue($update->version > $plugin->versiondb);
313 }
c44bbe35
DM
314 }
315 }
316 }
317 }
318
cc5bc55e 319 public function test_some_plugins_updatable_none() {
c44bbe35 320 $pluginman = testable_core_plugin_manager::instance();
cc5bc55e
DM
321 $this->assertFalse($pluginman->some_plugins_updatable());
322 }
323
324 public function test_some_plugins_updatable_some() {
325 $pluginman = testable_core_plugin_manager::instance();
326
327 $foobar = testable_plugininfo_base::fake_plugin_instance('foo', '/dev/null', 'bar', '/dev/null/fake',
328 'testable_plugininfo_base', $pluginman);
329 $foobar->versiondb = 2015092900;
330 $foobar->versiondisk = 2015092900;
331 $pluginman->inject_testable_plugininfo('foo', 'bar', $foobar);
332
c44bbe35
DM
333 $this->assertTrue($pluginman->some_plugins_updatable());
334 }
5a92cd0b 335
cc5bc55e
DM
336 public function test_available_updates() {
337 $pluginman = testable_core_plugin_manager::instance();
338
339 $foobar = testable_plugininfo_base::fake_plugin_instance('foo', '/dev/null', 'bar', '/dev/null/fake',
340 'testable_plugininfo_base', $pluginman);
341 $foobar->versiondb = 2015092900;
342 $foobar->versiondisk = 2015092900;
343 $pluginman->inject_testable_plugininfo('foo', 'bar', $foobar);
344
345 $updates = $pluginman->available_updates();
346
347 $this->assertTrue(is_array($updates));
348 $this->assertEquals(1, count($updates));
349 $update = $updates['foo_bar'];
350 $this->assertEquals('foo_bar', $update->component);
351 $this->assertEquals(2015100400, $update->version->version);
352 }
353
35f2b674
DM
354 public function test_get_remote_plugin_info() {
355 $pluginman = testable_core_plugin_manager::instance();
356
357 $this->assertFalse($pluginman->get_remote_plugin_info('not_exists', ANY_VERSION, false));
358
359 $info = $pluginman->get_remote_plugin_info('foo_bar', 2015093000, true);
360 $this->assertEquals(2015093000, $info->version->version);
361
362 $info = $pluginman->get_remote_plugin_info('foo_bar', 2015093000, false);
363 $this->assertEquals(2015100400, $info->version->version);
364 }
365
366 /**
367 * @expectedException moodle_exception
368 */
369 public function test_get_remote_plugin_info_exception() {
370 $pluginman = testable_core_plugin_manager::instance();
371 // The combination of ANY_VERSION + $exactmatch is illegal.
372 $pluginman->get_remote_plugin_info('any_thing', ANY_VERSION, true);
373 }
374
5a92cd0b 375 public function test_is_remote_plugin_available() {
5a92cd0b 376 $pluginman = testable_core_plugin_manager::instance();
35f2b674
DM
377
378 $this->assertFalse($pluginman->is_remote_plugin_available('not_exists', ANY_VERSION, false));
379 $this->assertTrue($pluginman->is_remote_plugin_available('foo_bar', 2013131313, false));
380 $this->assertFalse($pluginman->is_remote_plugin_available('foo_bar', 2013131313, true));
5a92cd0b
DM
381 }
382
383 public function test_resolve_requirements() {
5a92cd0b
DM
384 $pluginman = testable_core_plugin_manager::instance();
385
386 // Prepare a fake pluginfo instance.
387 $pluginfo = testable_plugininfo_base::fake_plugin_instance('fake', '/dev/null', 'one', '/dev/null/fake',
388 'testable_plugininfo_base', $pluginman);
4441d5e5 389 $pluginfo->versiondisk = 2015060600;
5a92cd0b
DM
390
391 // Test no $plugin->requires is specified in version.php.
392 $pluginfo->versionrequires = null;
393 $this->assertTrue($pluginfo->is_core_dependency_satisfied(2015100100));
394 $reqs = $pluginman->resolve_requirements($pluginfo, 2015100100, 29);
395 $this->assertEquals(2015100100, $reqs['core']->hasver);
396 $this->assertEquals(ANY_VERSION, $reqs['core']->reqver);
397 $this->assertEquals($pluginman::REQUIREMENT_STATUS_OK, $reqs['core']->status);
398
399 // Test plugin requires higher core version.
400 $pluginfo->versionrequires = 2015110900;
401 $this->assertFalse($pluginfo->is_core_dependency_satisfied(2015100100));
402 $reqs = $pluginman->resolve_requirements($pluginfo, 2015100100, 29);
403 $this->assertEquals(2015100100, $reqs['core']->hasver);
404 $this->assertEquals(2015110900, $reqs['core']->reqver);
405 $this->assertEquals($pluginman::REQUIREMENT_STATUS_OUTDATED, $reqs['core']->status);
406
407 // Test plugin requires current core version.
408 $pluginfo->versionrequires = 2015110900;
409 $this->assertTrue($pluginfo->is_core_dependency_satisfied(2015110900));
410 $reqs = $pluginman->resolve_requirements($pluginfo, 2015110900, 30);
411 $this->assertEquals(2015110900, $reqs['core']->hasver);
412 $this->assertEquals(2015110900, $reqs['core']->reqver);
413 $this->assertEquals($pluginman::REQUIREMENT_STATUS_OK, $reqs['core']->status);
414
415 // Test plugin requires lower core version.
416 $pluginfo->versionrequires = 2014122400;
417 $this->assertTrue($pluginfo->is_core_dependency_satisfied(2015100100));
418 $reqs = $pluginman->resolve_requirements($pluginfo, 2015100100, 29);
419 $this->assertEquals(2015100100, $reqs['core']->hasver);
420 $this->assertEquals(2014122400, $reqs['core']->reqver);
421 $this->assertEquals($pluginman::REQUIREMENT_STATUS_OK, $reqs['core']->status);
422
423 // Test plugin dependencies and their availability.
35f2b674
DM
424 // See {@link \core\update\testable_api} class.
425
426 $pluginfo->dependencies = array('foo_bar' => ANY_VERSION, 'not_exists' => ANY_VERSION);
5a92cd0b
DM
427 $reqs = $pluginman->resolve_requirements($pluginfo, 2015110900, 30);
428 $this->assertNull($reqs['foo_bar']->hasver);
429 $this->assertEquals(ANY_VERSION, $reqs['foo_bar']->reqver);
430 $this->assertEquals($pluginman::REQUIREMENT_STATUS_MISSING, $reqs['foo_bar']->status);
431 $this->assertEquals($pluginman::REQUIREMENT_AVAILABLE, $reqs['foo_bar']->availability);
35f2b674
DM
432 $this->assertEquals($pluginman::REQUIREMENT_UNAVAILABLE, $reqs['not_exists']->availability);
433
434 $pluginfo->dependencies = array('foo_bar' => 2013122400);
435 $reqs = $pluginman->resolve_requirements($pluginfo, 2015110900, 30);
436 $this->assertEquals($pluginman::REQUIREMENT_AVAILABLE, $reqs['foo_bar']->availability);
5a92cd0b 437
35f2b674 438 $pluginfo->dependencies = array('foo_bar' => 2015093000);
5a92cd0b 439 $reqs = $pluginman->resolve_requirements($pluginfo, 2015110900, 30);
35f2b674
DM
440 $this->assertEquals($pluginman::REQUIREMENT_AVAILABLE, $reqs['foo_bar']->availability);
441
442 $pluginfo->dependencies = array('foo_bar' => 2015100500);
443 $reqs = $pluginman->resolve_requirements($pluginfo, 2015110900, 30);
444 $this->assertEquals($pluginman::REQUIREMENT_AVAILABLE, $reqs['foo_bar']->availability);
5a92cd0b 445
35f2b674 446 $pluginfo->dependencies = array('foo_bar' => 2025010100);
5a92cd0b 447 $reqs = $pluginman->resolve_requirements($pluginfo, 2015110900, 30);
35f2b674 448 $this->assertEquals($pluginman::REQUIREMENT_UNAVAILABLE, $reqs['foo_bar']->availability);
4441d5e5
DM
449
450 // Plugin missing from disk - no version.php available.
451 $pluginfo = testable_plugininfo_base::fake_plugin_instance('fake', '/dev/null', 'missing', '/dev/null/fake',
452 'testable_plugininfo_base', $pluginman);
453 $pluginfo->versiondisk = null;
454 $this->assertEmpty($pluginman->resolve_requirements($pluginfo, 2015110900, 30));
35f2b674
DM
455 }
456
457 public function test_missing_dependencies() {
458 $pluginman = testable_core_plugin_manager::instance();
459
460 $one = testable_plugininfo_base::fake_plugin_instance('fake', '/dev/null', 'one', '/dev/null/fake',
461 'testable_plugininfo_base', $pluginman);
4441d5e5
DM
462 $one->versiondisk = 2015070800;
463
35f2b674
DM
464 $two = testable_plugininfo_base::fake_plugin_instance('fake', '/dev/null', 'two', '/dev/null/fake',
465 'testable_plugininfo_base', $pluginman);
4441d5e5 466 $two->versiondisk = 2015070900;
35f2b674
DM
467
468 $pluginman->inject_testable_plugininfo('fake', 'one', $one);
469 $pluginman->inject_testable_plugininfo('fake', 'two', $two);
470
471 $this->assertEmpty($pluginman->missing_dependencies());
472
473 $one->dependencies = array('foo_bar' => ANY_VERSION);
474 $misdeps = $pluginman->missing_dependencies();
475 $this->assertEquals(2015100400, $misdeps['foo_bar']->version->version);
476
477 $two->dependencies = array('foo_bar' => 2015100500);
478 $misdeps = $pluginman->missing_dependencies();
479 $this->assertEquals(2015100500, $misdeps['foo_bar']->version->version);
5a92cd0b 480 }
bde002b8 481}