- Issue created by @scott_euser
- First commit to issue fork.
- 🇮🇳India immaculatexavier
Done the below Fixes for PHPUnit 10:
- Removed usage of $this in static providerCanLoginWithoutTfa().
- Replaced $this->equalTo() with Assert::equalTo() from PHPUnit\Framework\Assert.
- Replaced $this->stringContains() with Assert::stringContains().
- Used UnitTestCase::createStub(TranslationInterface::class) for generating translation stubs inside static context.
Needs review.
- 🇬🇧United Kingdom scott_euser
Thanks! I think still somehow its too strict though. E.g. if I run
ddev exec -d /var/www/html "./vendor/bin/phpunit -c ./core/phpunit.xml.dist ./modules/contrib/tfa/tests/src/Unit/TfaContextTest.php"
At:
/var/www/html/modules/contrib/tfa/tests/src/Unit/TfaContextTest.php:430
I get false errors like
- 'stringTranslation' => MockObject_TranslationInterface_00404523 Object #398 ( - '__phpunit_state' => PHPUnit\Framework\MockObject\TestDoubleState Object #433 ( + 'stringTranslation' => MockObject_TranslationInterface_3106f881 Object #2004 ( + '__phpunit_state' => PHPUnit\Framework\MockObject\TestDoubleState Object #2006 (
Which are nearly the same and for the purposes of the test should be considered the same I believe