Problem/Motivation

------ ----------------------------------------------------------------
Line src/Exporter.php
------ ----------------------------------------------------------------
234 Call to deprecated function file_prepare_directory():
in drupal:8.7.0 and is removed from drupal:9.0.0.
Use \Drupal\Core\File\FileSystemInterface::prepareDirectory().
------ ----------------------------------------------------------------

------ -------------------------------------------------------------------------------------------------------------------------------------------------------------
Line tests/src/Kernel/ExporterIntegrationTest.php
------ -------------------------------------------------------------------------------------------------------------------------------------------------------------
21 Usage of deprecated trait Drupal\field\Tests\EntityReference\EntityReferenceTestTrait in class Drupal\Tests\default_content\Kernel\ExporterIntegrationTest:
in drupal:8.6.2 and is removed from drupal:9.0.0. Use
Drupal\Tests\field\Traits\EntityReferenceTestTrait instead.
201 Call to deprecated method setExpectedException() of class Drupal\KernelTests\KernelTestBase:
in drupal:8.8.0 and is removed from drupal:9.0.0.
Backward compatibility for PHPUnit 4 will no longer be supported.
------ -------------------------------------------------------------------------------------------------------------------------------------------------------------

Proposed resolution

Remove deprecated code

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

chr.fritsch created an issue. See original summary.

chr.fritsch’s picture

Here is a patch to fix the deprecations

larowlan’s picture

I think we have to hold off until 8.7 is EOL for some of these?

chr.fritsch’s picture

+++ b/tests/src/Kernel/ExporterIntegrationTest.php
@@ -198,7 +198,7 @@ class ExporterIntegrationTest extends KernelTestBase {
-    $this->setExpectedException(\InvalidArgumentException::class);
+    $this->expectException(\InvalidArgumentException::class);

This is the only D8.8 deprecation. So since it's only test related, I think we can already commit this.

Berdir’s picture

Failing tests makes it hard to ensure that everything else still works on 8.7, I'd suggest to combine this with core_version_requirement: ^8.8 || ^9 and wait until @larowlan feels OK with no longer supporting 8.7.

larowlan’s picture

Yeah either that or we have two branches, not fussed - if two branches unblocks people - so be it

Berdir’s picture

Status: Needs review » Needs work

Whether new branch or no, we need the version requirement, so needs work for that.

chr.fritsch’s picture

Should we also remove the drush 8 (not supported with D9) integration here? We already have drush 9+ support

Berdir’s picture

There's no need for that, removing drush8 support can be done later when support for D8 is removed entirely, no need to break sites that still use drush8 on D8.

andypost’s picture

I'd prefer to get commit first #2921377: When Drupal 8.6.0 is released, remove TermEntityNormalizer and tag a new release

So added 8.7.7 requirement to info file and hardened check in for exception message

+++ b/tests/src/Kernel/ExporterIntegrationTest.php
@@ -198,7 +198,7 @@ class ExporterIntegrationTest extends KernelTestBase {
-    $this->setExpectedException(\InvalidArgumentException::class);
+    $this->expectException(\InvalidArgumentException::class);

this method is deprecated in phpunit6 IIRC, so I thing it's good to go

andypost’s picture

Assigned: Unassigned » larowlan

FYI https://phpunit.de/getting-started/phpunit-5.html so since phpunit5 expectException is recommended method

Assigning to Lee to decide - at least clean-up of test is no longer blocker

+++ b/src/Exporter.php
@@ -231,7 +242,7 @@ class Exporter implements ExporterInterface {
-    file_prepare_directory($path, FILE_CREATE_DIRECTORY);

is deprecated in 8.7

andypost’s picture

andypost’s picture

andypost’s picture

and it will need tuning of composer.json

Berdir’s picture

Status: Needs review » Needs work

Going to need a reroll and updating composer.json too as we already have the drupal/core require there.

andypost’s picture

Assigned: larowlan » andypost
andypost’s picture

Assigned: andypost » Unassigned
andypost’s picture

Assigned: Unassigned » larowlan
Status: Needs work » Needs review
FileSize
1.01 KB
7.63 KB

Fixed remains

andypost’s picture

Title: Remove deprecated code » Remove deprecated code and declare 9.0 compatibility
andypost’s picture

Assigned: larowlan » Unassigned
Berdir’s picture

+++ b/default_content.info.yml
@@ -4,4 +4,4 @@ description: 'Imports default content when a module is enabled'
 dependencies:
-  - drupal:hal (>=8.6.x)
+  - drupal:hal (>=8.7.7)

I'd say we should remove the version from drupal:hal because it's covered with the line above and it's one thing less we'll need to update in the future.

  • Berdir committed 8c6535b on 8.x-1.x
    Issue #3098095 by andypost, Berdir, chr.fritsch: Remove deprecated code...
Berdir’s picture

Status: Needs review » Fixed

Thanks, since this only requires 8.7 it's fine to commit now.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.