Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test on PHP 8.3 and Drupal 10.3 #1007

Merged
merged 9 commits into from
Apr 9, 2024
Merged

Test on PHP 8.3 and Drupal 10.3 #1007

merged 9 commits into from
Apr 9, 2024

Conversation

rosiel
Copy link
Member

@rosiel rosiel commented Mar 8, 2024

GitHub Issue: (link)

What does this Pull Request do?

Tests now run on PHP 8.1, 8.2, and 8.3 and Drupal 10.1, 10.2, and 10.3-dev.

What's new?

  • Does this change add any new dependencies? no
  • Does this change require any other modifications to be made to the repository
    (i.e. Regeneration activity, etc.)? no
  • Could this change impact execution of existing code? no

How should this be tested?

  • Tests should pass.

Documentation Status

  • Does this change existing behaviour that's currently documented? no
  • Does this change require new pages or sections of documentation? no
  • Who does this need to be documented for? no
  • Associated documentation pull request(s): ___ or documentation issue ___

Additional Notes:

Any additional information that you think would be helpful when reviewing this
PR.

Interested parties

Tag (@ mention) interested parties or, if unsure, @Islandora/committers

@rosiel
Copy link
Member Author

rosiel commented Mar 11, 2024

I could use some help here. I "fixed"(?) all the tests so that they don't use $this->t() anymore (this seems to have been a best practice that has now been changed?) but they are still failing, and I do not have the setup to diagnose this:

Testing 
.................E........                                        26 / 26 (100%)

Time: 25:02.194, Memory: 16.00 MB

There was 1 error:

1) Drupal\Tests\islandora\Functional\LinkHeaderTest::testMediaLinkHeaders
TypeError: Behat\Mink\Session::setRequestHeader(): Argument #1 ($name) must be of type string, int given, called in /opt/drupal/web/core/tests/Drupal/Tests/UiHelperTrait.php on line 235

/opt/drupal/vendor/behat/mink/src/Session.php:199
/opt/drupal/web/core/tests/Drupal/Tests/UiHelperTrait.php:235
/home/runner/work/islandora/islandora/build_dir/tests/src/Functional/LinkHeaderTest.php:145
/opt/drupal/vendor/phpunit/phpunit/src/Framework/TestResult.php:728

@alxp
Copy link

alxp commented Mar 20, 2024

I think I can run these tests fro ma local homebrew PHP8.3 setup. I know there a re a few PHPUnit tests that assume the existence of an ActiveMQ server but I should be able to get to the problem you're seeing. Will report back.

@adam-vessey
Copy link

Checking out the line in question from the test:

$this->drupalGet($media_url, [], ['Cache-Control: no-cache']);
and comparing against the documentation for the method, looks like it expects things as key/value, not a numbered/sequential array, so it should maybe instead be:

$this->drupalGet($media_url, [], ['Cache-Control' => 'no-cache']);

As in, I'm thinking it's trying to use the numerical offset as the $name of a header (which should be a string, as so causing the error).

There may be some other sections requiring a similar fix, such as

$this->drupalGet($media_url, [], ['Cache-Control: no-cache']);

@aOelschlager
Copy link

@alxp You should be able to test this now with the tag issue-329. Nigel updated those images to use PHP 8.3.

Copy link

@alxp alxp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All changes look good.

@alxp alxp merged commit 089a365 into Islandora:2.x Apr 9, 2024
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants