3 namespace Drupal\Tests\system\Functional\Update;
5 use Drupal\Tests\BrowserTestBase;
8 * Tests that missing update dependencies are correctly flagged.
12 class DependencyMissingTest extends BrowserTestBase {
19 public static $modules = ['update_test_0', 'update_test_2'];
21 protected function setUp() {
22 // Only install update_test_2.module, even though its updates have a
23 // dependency on update_test_3.module.
25 require_once $this->root . '/core/includes/update.inc';
28 public function testMissingUpdate() {
30 'update_test_2' => 8001,
32 $update_graph = update_resolve_dependencies($starting_updates);
33 $this->assertTrue($update_graph['update_test_2_update_8001']['allowed'], "The module's first update function is allowed to run, since it does not have any missing dependencies.");
34 $this->assertFalse($update_graph['update_test_2_update_8002']['allowed'], "The module's second update function is not allowed to run, since it has a direct dependency on a missing update.");
35 $this->assertFalse($update_graph['update_test_2_update_8003']['allowed'], "The module's third update function is not allowed to run, since it has an indirect dependency on a missing update.");