Skip to content

Commit 1563a21

Browse files
authored
Fix DrupalDependenciesTest test (#6430)
1 parent 0808ecc commit 1563a21

File tree

2 files changed

+66
-49
lines changed

2 files changed

+66
-49
lines changed

CODEOWNERS

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
/src/Commands/config/ @bircher
1515

16+
/src/Commands/core/DrupalDependenciesCommands.php @claudiu-cristea
1617
/src/Commands/core/MigrateRunnerCommands.php @claudiu-cristea
1718
/src/Drupal/Migrate/ @claudiu-cristea
1819

@@ -31,5 +32,3 @@
3132
/src/Commands/core/LocaleCommands.php @Sutharsan
3233

3334
/src/Commands/core/QueueCommands.php @davereid
34-
35-

tests/integration/DrupalDependenciesTest.php

Lines changed: 65 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -31,53 +31,7 @@ public function testModuleDependentOfModule(): void
3131
'no-only-installed' => null,
3232
]);
3333

34-
// In Drupal 10, book, forum, statistics and tracker modules were part
35-
// of Drupal core. Ensure a backwards compatible expectation.
36-
// @todo Remove the BC layer when Drupal 10 support is dropped.
37-
$expected = DeprecationHelper::backwardsCompatibleCall(
38-
\Drupal::VERSION,
39-
'11.0.0',
40-
fn() => <<<EXPECTED
41-
node
42-
├─dependent1
43-
│ └─dependent2
44-
│ ├─dependent3
45-
│ └─dependent4
46-
├─dependent2
47-
│ ├─dependent3
48-
│ └─dependent4
49-
├─history
50-
│ └─dependent1
51-
│ └─dependent2 (circular)
52-
└─taxonomy
53-
└─dependent1
54-
└─dependent2 (circular)
55-
EXPECTED,
56-
// @deprecated
57-
fn() => <<<EXPECTED
58-
node
59-
├─book
60-
├─dependent1
61-
│ └─dependent2
62-
│ ├─dependent3
63-
│ └─dependent4
64-
├─dependent2
65-
│ ├─dependent3
66-
│ └─dependent4
67-
├─forum
68-
├─history
69-
│ ├─dependent1
70-
│ │ └─dependent2 (circular)
71-
│ └─forum
72-
├─statistics
73-
├─taxonomy
74-
│ ├─dependent1
75-
│ │ └─dependent2 (circular)
76-
│ └─forum
77-
└─tracker
78-
EXPECTED,
79-
);
80-
$this->assertSame($expected, $this->getOutput());
34+
$this->assertSame($this->getModuleDependentOfUninstalledModuleExpectation(), $this->getOutput());
8135

8236
// Install node module.
8337
$this->drush('pm:install', ['node'], ['yes' => null]);
@@ -264,4 +218,68 @@ protected function tearDown(): void
264218
}
265219
parent::tearDown();
266220
}
221+
222+
protected function getModuleDependentOfUninstalledModuleExpectation(): string
223+
{
224+
// In Drupal 10, book, forum, statistics and tracker modules were part
225+
// of Drupal core. Ensure a backwards compatible expectation.
226+
// @todo Remove the BC layer when Drupal 10 support is dropped.
227+
return DeprecationHelper::backwardsCompatibleCall(
228+
\Drupal::VERSION,
229+
'11.0.0',
230+
function (): string {
231+
// Starting with 11.3.x the field.storage.node.body is no longer
232+
// shipped but, for backwards compatibility reasons, a new and
233+
// deprecated `node_storage_body_field` module is offered.
234+
// @see https://www.drupal.org/node/3540814
235+
// @todo Remove when 11.3.0 is the minimum Drupal requirement.
236+
$nodeStorageBodyField = DeprecationHelper::backwardsCompatibleCall(
237+
\Drupal::VERSION,
238+
'11.3.0',
239+
fn(): string => "├─node_storage_body_field\n",
240+
fn(): string => '',
241+
);
242+
243+
return <<<EXPECTED
244+
node
245+
├─dependent1
246+
│ └─dependent2
247+
│ ├─dependent3
248+
│ └─dependent4
249+
├─dependent2
250+
│ ├─dependent3
251+
│ └─dependent4
252+
├─history
253+
│ └─dependent1
254+
│ └─dependent2 (circular)
255+
{$nodeStorageBodyField}└─taxonomy
256+
└─dependent1
257+
└─dependent2 (circular)
258+
EXPECTED;
259+
},
260+
// @deprecated
261+
fn(): string => <<<EXPECTED
262+
node
263+
├─book
264+
├─dependent1
265+
│ └─dependent2
266+
│ ├─dependent3
267+
│ └─dependent4
268+
├─dependent2
269+
│ ├─dependent3
270+
│ └─dependent4
271+
├─forum
272+
├─history
273+
│ ├─dependent1
274+
│ │ └─dependent2 (circular)
275+
│ └─forum
276+
├─statistics
277+
├─taxonomy
278+
│ ├─dependent1
279+
│ │ └─dependent2 (circular)
280+
│ └─forum
281+
└─tracker
282+
EXPECTED,
283+
);
284+
}
267285
}

0 commit comments

Comments
 (0)