Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I'm not sure if this is a bug or misuse, however please consider that
calling
function setUp() {
...
$this->drupalCreateContentType(array('type' => 'page', 'name' => 'Page'));
...
}
produces a fail. However the test (in my case) resumes normally after that.
I guess the problem is the following lines from drupal_web_test_case.php:
protected function drupalCreateContentType($settings = array()) {
...
// Populate defaults array.
$defaults = array(
'type' => $name,
'name' => $name,
...
$type = $forced + $settings + $defaults; // <-- custom type gets overridden by $defaults.
Comment | File | Size | Author |
---|---|---|---|
#3 | Page content type creation marked as failed, why? | 22.71 KB | lex0r |
Comments
Comment #1
Damien Tournoud CreditAttribution: Damien Tournoud commentedThanks for your report. Could you elaborate on what you mean by "produces a fail"?
The code you pasted looks ok (the + operator in PHP does not override keys from the left operand), so I'm requalifying this as a support request until you can provide more information.
Comment #3
lex0r CreditAttribution: lex0r commentedYou are right regarding the keys, but the issue happens anyway.
I attached a screenshot. Hope it will clarify the issue...
Comment #4
lex0r CreditAttribution: lex0r commentedMade it "active" to attract attention...
Comment #5
lex0r CreditAttribution: lex0r commentedBump!
Comment #6
lex0r CreditAttribution: lex0r commentedStill no feedback. I want the issue to be either confirmed as bug, or closed.
You may reproduce the issue by running test suite for menu_import module.
Comment #7
xjmWhatever this is, it's certainly not a major bug. There's likely some problem with your test case code.
Comment #8
lex0r CreditAttribution: lex0r commentedOk, then I would like anyone who's expert in Drupal unit testing to take a look at it and tell me what's wrong. Please :)
I just create a new CT for testing purposes (no more code regarding this CT exists) and get the error.