We need to replace the use of $this->setExpectedException with $this->expectException and $this->expectExceptionMessage. This is due to support for PHPUnit 4 being removed.
8x: \Drupal\Tests\PhpunitCompatibilityTrait:setExpectedException() is deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Backward compatibility for PHPUnit 4 will no longer be supported. See https://www.drupal.org/node/3056869
The 8 ocurrences are:
Unit\ContextHandlerTraitTest::testMissingContext
Unit\Integration\Action\DataConvertTest::testInvalidValueException
Unit\Integration\Action\DataConvertTest::testInvalidRoundingBehavior
Unit\Integration\Action\DataConvertTest::testInvalidRoundingBehaviorException
Unit\Integration\Action\DataConvertTest::testInvalidTargetTypeException
Unit\Integration\Condition\UserHasRoleTest::testInvalidOperationException
Unit\Integration\Engine\LoopTest::testOutOfScopeVariableExecution
Unit\RulesActionBaseTest::testSummaryThrowingException
Original issue: #3059090: Deprecate \Drupal\Tests\PhpunitCompatibilityTrait::setExpectedException()
Change record: https://www.drupal.org/node/3056869
Comments
Comment #2
tr commentedSee #3096756: setExpectedException() is deprecated : Remove support for PHPUnit 4 when Drupal 8.8 becomes the lowest supported version - this can't be done until core 8.7.x become unsupported ~June 2020.
Comment #3
tr commentedComment #4
tr commentedI'm going to postpone this because it's going to be a long time before we can do this. I'll re-open it ~1 month ahead of time so that we can work on a patch at that time.
Comment #5
tr commentedComment #7
tr commentedCommitted.
Comment #8
jonathan1055 commentedThank you TR. It's good to finally be able to get this done.