Problem/Motivation

PHPUnit 12.5.0+ is changing the way that mock objects work:

  • Mock objects that do not configure expectations should be converted to stubs. Otherwise, they throw a notice: No expectations were configured for the mock object for \Drupal\comment\CommentManagerInterface. You should refactor your test code and use a test stub instead.
  • $this->any() is deprecated. It was equivalent to having no expectation, in which case the object should be a stub (see the previous bullet) or a more exact number of expectations should be added.
  • with() is deprecated for stubs because it was deemed to be equally pointless.

Steps to reproduce

  1. Require PHPUnit 12 with Composer.
  2. Fix compatibility issues with PHPUnit 12 by applying this patch.
  3. Run the Unit tests for a library with --display-phpunit-notices --display-phpunit-deprecations.
  4. Observe the PHPUnit notices that occur.

Uses of any() crept into already-fixed modules while we were waiting for #3573259: Prevent new expects($this->any()) in tests to be committed. Also, some issues got committed before $stub->with() got deprecated. And I hadn't checked any kernel tests for notices before now.

Proposed resolution

Clean these up, with the exception of core/tests/Drupal/KernelTests/Core/Database/TransactionTest.php (see #8).

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3581058

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

dcam created an issue. See original summary.

dcam’s picture

And apparently I didn't fix the local task tests like I thought I had. That fix must have gotten lost long the way. So I get to recreate it, which I think was kind of problematic. Joy.

dcam’s picture

Status: Active » Needs review
dcam’s picture

Output of running Core module kernel tests:

28 tests triggered 42 PHPUnit notices:

1) Drupal\Tests\jsonapi\Kernel\Normalizer\LinkCollectionNormalizerTest::testLinkAccess@the edit-form link is present because uid 2 has access to the targeted resource (its own edit form) with data (2, 2, ['edit-form'], ['url.site', 'user'])
No expectations were configured for the mock object for Drupal\jsonapi\JsonApiResource\ResourceObject. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

/var/www/html/core/modules/jsonapi/tests/src/Kernel/Normalizer/LinkCollectionNormalizerTest.php:117

2) Drupal\Tests\jsonapi\Kernel\Normalizer\LinkCollectionNormalizerTest::testLinkAccess@the edit-form link is omitted because uid 3 doesn't have access to the targeted resource (another account's edit form) with data (3, 2, [], ['url.site', 'user'])
No expectations were configured for the mock object for Drupal\jsonapi\JsonApiResource\ResourceObject. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

/var/www/html/core/modules/jsonapi/tests/src/Kernel/Normalizer/LinkCollectionNormalizerTest.php:117

3) Drupal\Tests\migrate\Kernel\MigrateEntityContentBaseTest::testTranslated
No expectations were configured for the mock object for Drupal\migrate\Plugin\MigrationInterface. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

/var/www/html/core/modules/migrate/tests/src/Kernel/MigrateEntityContentBaseTest.php:124

4) Drupal\Tests\migrate\Kernel\MigrateEntityContentBaseTest::testStubRows
No expectations were configured for the mock object for Drupal\migrate\Plugin\MigrationInterface. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

/var/www/html/core/modules/migrate/tests/src/Kernel/MigrateEntityContentBaseTest.php:298

5) Drupal\Tests\migrate\Kernel\SqlBaseTest::testConnectionTypes
No expectations were configured for the mock object for Drupal\migrate\Plugin\MigrationInterface. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

/var/www/html/core/modules/migrate/tests/src/Kernel/SqlBaseTest.php:48

6) Drupal\Tests\migrate\Kernel\SqlBaseTest::testBrokenConnection
No expectations were configured for the mock object for Drupal\migrate\Plugin\MigrationInterface. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

/var/www/html/core/modules/migrate/tests/src/Kernel/SqlBaseTest.php:137

7) Drupal\Tests\migrate\Kernel\SqlBaseTest::testHighWater
* No expectations were configured for the mock object for Drupal\migrate\Plugin\MigrationInterface. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

* No expectations were configured for the mock object for Drupal\Core\Database\Query\ConditionInterface. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

/var/www/html/core/modules/migrate/tests/src/Kernel/SqlBaseTest.php:168

8) Drupal\Tests\migrate\Kernel\SqlBaseTest::testHighWater@high-water value set with data (33)
* No expectations were configured for the mock object for Drupal\migrate\Plugin\MigrationInterface. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

* No expectations were configured for the mock object for Drupal\Core\Database\Query\ConditionInterface. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

/var/www/html/core/modules/migrate/tests/src/Kernel/SqlBaseTest.php:168

9) Drupal\Tests\migrate\Kernel\SqlBaseTest::testPrepareQuery
No expectations were configured for the mock object for Drupal\migrate\Plugin\MigrationInterface. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

/var/www/html/core/modules/migrate/tests/src/Kernel/SqlBaseTest.php:209

10) Drupal\Tests\migrate\Kernel\process\DownloadTest::testOverwritingDownload
* No expectations were configured for the mock object for GuzzleHttp\Client. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

* No expectations were configured for the mock object for Drupal\migrate\MigrateExecutableInterface. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

/var/www/html/core/modules/migrate/tests/src/Kernel/process/DownloadTest.php:35

11) Drupal\Tests\migrate\Kernel\process\DownloadTest::testNonDestructiveDownload
* No expectations were configured for the mock object for GuzzleHttp\Client. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

* No expectations were configured for the mock object for Drupal\migrate\MigrateExecutableInterface. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

/var/www/html/core/modules/migrate/tests/src/Kernel/process/DownloadTest.php:48

12) Drupal\Tests\migrate\Kernel\process\DownloadTest::testWriteProtectedDestination
* No expectations were configured for the mock object for GuzzleHttp\Client. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

* No expectations were configured for the mock object for Drupal\migrate\MigrateExecutableInterface. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

/var/www/html/core/modules/migrate/tests/src/Kernel/process/DownloadTest.php:61

13) Drupal\Tests\migrate\Kernel\process\FileCopyTest::testSuccessfulCopies
* No expectations were configured for the mock object for GuzzleHttp\Client. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

* No expectations were configured for the mock object for GuzzleHttp\Client. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

* No expectations were configured for the mock object for GuzzleHttp\Client. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

/var/www/html/core/modules/migrate/tests/src/Kernel/process/FileCopyTest.php:52

14) Drupal\Tests\migrate\Kernel\process\FileCopyTest::testSuccessfulReuse@0 with data ('/var/www/html/core/tests/fixt...st.jpg', 'public://file1.jpg')
* No expectations were configured for the mock object for GuzzleHttp\Client. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

* No expectations were configured for the mock object for GuzzleHttp\Client. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

* No expectations were configured for the mock object for GuzzleHttp\Client. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

/var/www/html/core/modules/migrate/tests/src/Kernel/process/FileCopyTest.php:91

15) Drupal\Tests\migrate\Kernel\process\FileCopyTest::testSuccessfulReuse@1 with data ('https://www.drupal.org/favicon.ico', 'public://file2.jpg')
* No expectations were configured for the mock object for GuzzleHttp\Client. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

* No expectations were configured for the mock object for GuzzleHttp\Client. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

* No expectations were configured for the mock object for GuzzleHttp\Client. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

/var/www/html/core/modules/migrate/tests/src/Kernel/process/FileCopyTest.php:91

16) Drupal\Tests\migrate\Kernel\process\FileCopyTest::testSuccessfulMoves
* No expectations were configured for the mock object for GuzzleHttp\Client. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

* No expectations were configured for the mock object for GuzzleHttp\Client. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

* No expectations were configured for the mock object for GuzzleHttp\Client. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

/var/www/html/core/modules/migrate/tests/src/Kernel/process/FileCopyTest.php:132

17) Drupal\Tests\migrate\Kernel\process\FileCopyTest::testNonExistentSourceFile
No expectations were configured for the mock object for GuzzleHttp\Client. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

/var/www/html/core/modules/migrate/tests/src/Kernel/process/FileCopyTest.php:167

18) Drupal\Tests\migrate\Kernel\process\FileCopyTest::testNonWritableDestination
* No expectations were configured for the mock object for GuzzleHttp\Client. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

* No expectations were configured for the mock object for GuzzleHttp\Client. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

/var/www/html/core/modules/migrate/tests/src/Kernel/process/FileCopyTest.php:179

19) Drupal\Tests\migrate\Kernel\process\FileCopyTest::testRenameFile
No expectations were configured for the mock object for GuzzleHttp\Client. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

/var/www/html/core/modules/migrate/tests/src/Kernel/process/FileCopyTest.php:204

20) Drupal\Tests\migrate\Kernel\process\FileCopyTest::testDownloadRemoteUri
No expectations were configured for the mock object for Drupal\migrate\MigrateExecutableInterface. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

/var/www/html/core/modules/migrate/tests/src/Kernel/process/FileCopyTest.php:216

21) Drupal\Tests\mysql\Kernel\mysql\MysqlDriverTest::testConnection
No expectations were configured for the mock object for Pdo\Mysql. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

/var/www/html/core/modules/mysql/tests/src/Kernel/mysql/MysqlDriverTest.php:25

22) Drupal\Tests\package_manager\Kernel\StageCommitExceptionTest::testCommitException@PreconditionException with data ('PhpTuf\ComposerStager\API\Exc...eption', 'Drupal\package_manager\Except...eption')
No expectations were configured for the mock object for PhpTuf\ComposerStager\API\Precondition\Service\PreconditionInterface. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

/var/www/html/core/modules/package_manager/tests/src/Kernel/StageCommitExceptionTest.php:88

23) Drupal\Tests\package_manager\Kernel\StageConflictTest::testDestroyDuringApply@force destroy on pre-apply, stale with data ('Drupal\package_manager\Event\...yEvent', true, 7200, 'Stage directory does not exist')
No expectations were configured for the mock object for PhpTuf\ComposerStager\API\Precondition\Service\PreconditionInterface. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

/var/www/html/core/modules/package_manager/tests/src/Kernel/StageConflictTest.php:133

24) Drupal\Tests\package_manager\Kernel\StageConflictTest::testDestroyDuringApply@destroy on pre-apply, stale with data ('Drupal\package_manager\Event\...yEvent', false, 7200, 'Stage directory does not exist')
No expectations were configured for the mock object for PhpTuf\ComposerStager\API\Precondition\Service\PreconditionInterface. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

/var/www/html/core/modules/package_manager/tests/src/Kernel/StageConflictTest.php:133

25) Drupal\Tests\package_manager\Kernel\StageConflictTest::testDestroyDuringApply@force destroy on post-apply, stale with data ('Drupal\package_manager\Event\...yEvent', true, 7200, null)
No expectations were configured for the mock object for PhpTuf\ComposerStager\API\Precondition\Service\PreconditionInterface. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

/var/www/html/core/modules/package_manager/tests/src/Kernel/StageConflictTest.php:133

26) Drupal\Tests\package_manager\Kernel\StageConflictTest::testDestroyDuringApply@destroy on post-apply, stale with data ('Drupal\package_manager\Event\...yEvent', false, 7200, null)
No expectations were configured for the mock object for PhpTuf\ComposerStager\API\Precondition\Service\PreconditionInterface. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

/var/www/html/core/modules/package_manager/tests/src/Kernel/StageConflictTest.php:133

27) Drupal\Tests\package_manager\Kernel\StageEventsTest::testAddResult
No expectations were configured for the mock object for PhpTuf\ComposerStager\API\Path\Value\PathListInterface. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

/var/www/html/core/modules/package_manager/tests/src/Kernel/StageEventsTest.php:163

28) Drupal\Tests\syslog\Kernel\SyslogTest::testSyslogWriting
No expectations were configured for the mock object for Drupal\Core\Session\AccountInterface. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

/var/www/html/core/modules/syslog/tests/src/Kernel/SyslogTest.php:42
dcam’s picture

Output of running core/tests/Drupal/KernelTests:

54 tests triggered 73 PHPUnit notices:

1) Drupal\KernelTests\Core\Action\GotoActionTest::testGotoAction@<front> with data ('<front>', '/')
No expectations were configured for the mock object for Drupal\Core\Entity\EntityInterface. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

/var/www/html/core/tests/Drupal/KernelTests/Core/Action/GotoActionTest.php:35

2) Drupal\KernelTests\Core\Action\GotoActionTest::testGotoAction@empty string with data ('', '/')
No expectations were configured for the mock object for Drupal\Core\Entity\EntityInterface. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

/var/www/html/core/tests/Drupal/KernelTests/Core/Action/GotoActionTest.php:35

3) Drupal\KernelTests\Core\Action\GotoActionTest::testGotoAction@internal path with data ('/user', '/user')
No expectations were configured for the mock object for Drupal\Core\Entity\EntityInterface. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

/var/www/html/core/tests/Drupal/KernelTests/Core/Action/GotoActionTest.php:35

4) Drupal\KernelTests\Core\Action\GotoActionTest::testGotoAction@internal path with query and fragment with data ('/user?foo=bar#baz', '/user?foo=bar#baz')
No expectations were configured for the mock object for Drupal\Core\Entity\EntityInterface. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

/var/www/html/core/tests/Drupal/KernelTests/Core/Action/GotoActionTest.php:35

5) Drupal\KernelTests\Core\Action\GotoActionTest::testGotoAction@external URL with data ('https://example.com', 'https://example.com')
No expectations were configured for the mock object for Drupal\Core\Entity\EntityInterface. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

/var/www/html/core/tests/Drupal/KernelTests/Core/Action/GotoActionTest.php:35

6) Drupal\KernelTests\Core\Database\SelectExtenderTest::testExtend@0 with data ('Drupal\Core\Database\Query\Pa...tender', 'Drupal\CoreFake\Driver\Databa...reFake', 'Drupal\Core\Database\Query\Pa...tender')
No expectations were configured for the mock object for Drupal\Tests\Core\Database\Stub\StubPDO. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

/var/www/html/core/tests/Drupal/KernelTests/Core/Database/SelectExtenderTest.php:127

7) Drupal\KernelTests\Core\Database\SelectExtenderTest::testExtend@1 with data ('Drupal\Core\Database\Query\Pa...tender', 'Drupal\CoreFake\Driver\Databa...reFake', '\Drupal\Core\Database\Query\P...tender')
No expectations were configured for the mock object for Drupal\Tests\Core\Database\Stub\StubPDO. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

/var/www/html/core/tests/Drupal/KernelTests/Core/Database/SelectExtenderTest.php:127

8) Drupal\KernelTests\Core\Database\SelectExtenderTest::testExtend@2 with data ('Drupal\Core\Database\Query\Ta...tender', 'Drupal\CoreFake\Driver\Databa...reFake', 'Drupal\Core\Database\Query\Ta...tender')
No expectations were configured for the mock object for Drupal\Tests\Core\Database\Stub\StubPDO. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

/var/www/html/core/tests/Drupal/KernelTests/Core/Database/SelectExtenderTest.php:127

9) Drupal\KernelTests\Core\Database\SelectExtenderTest::testExtend@3 with data ('Drupal\Core\Database\Query\Ta...tender', 'Drupal\CoreFake\Driver\Databa...reFake', '\Drupal\Core\Database\Query\T...tender')
No expectations were configured for the mock object for Drupal\Tests\Core\Database\Stub\StubPDO. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

/var/www/html/core/tests/Drupal/KernelTests/Core/Database/SelectExtenderTest.php:127

10) Drupal\KernelTests\Core\Database\SelectExtenderTest::testExtend@4 with data ('Drupal\search\SearchQuery', 'Drupal\CoreFake\Driver\Databa...reFake', 'Drupal\search\SearchQuery')
No expectations were configured for the mock object for Drupal\Tests\Core\Database\Stub\StubPDO. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

/var/www/html/core/tests/Drupal/KernelTests/Core/Database/SelectExtenderTest.php:127

11) Drupal\KernelTests\Core\Database\SelectExtenderTest::testExtend@5 with data ('Drupal\search\SearchQuery', 'Drupal\CoreFake\Driver\Databa...reFake', '\Drupal\search\SearchQuery')
No expectations were configured for the mock object for Drupal\Tests\Core\Database\Stub\StubPDO. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

/var/www/html/core/tests/Drupal/KernelTests/Core/Database/SelectExtenderTest.php:127

12) Drupal\KernelTests\Core\Database\SelectExtenderTest::testExtend@6 with data ('Drupal\search\ViewsSearchQuery', 'Drupal\CoreFake\Driver\Databa...reFake', 'Drupal\search\ViewsSearchQuery')
No expectations were configured for the mock object for Drupal\Tests\Core\Database\Stub\StubPDO. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

/var/www/html/core/tests/Drupal/KernelTests/Core/Database/SelectExtenderTest.php:127

13) Drupal\KernelTests\Core\Database\SelectExtenderTest::testExtend@7 with data ('Drupal\search\ViewsSearchQuery', 'Drupal\CoreFake\Driver\Databa...reFake', '\Drupal\search\ViewsSearchQuery')
No expectations were configured for the mock object for Drupal\Tests\Core\Database\Stub\StubPDO. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

/var/www/html/core/tests/Drupal/KernelTests/Core/Database/SelectExtenderTest.php:127

14) Drupal\KernelTests\Core\Database\SelectExtenderTest::testExtend@8 with data ('Drupal\core_fake\Driver\Datab...tender', 'Drupal\core_fake\Driver\Datab...lasses', 'Drupal\Core\Database\Query\Pa...tender')
No expectations were configured for the mock object for Drupal\Tests\Core\Database\Stub\StubPDO. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

/var/www/html/core/tests/Drupal/KernelTests/Core/Database/SelectExtenderTest.php:127

15) Drupal\KernelTests\Core\Database\SelectExtenderTest::testExtend@9 with data ('Drupal\core_fake\Driver\Datab...tender', 'Drupal\core_fake\Driver\Datab...lasses', '\Drupal\Core\Database\Query\P...tender')
No expectations were configured for the mock object for Drupal\Tests\Core\Database\Stub\StubPDO. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

/var/www/html/core/tests/Drupal/KernelTests/Core/Database/SelectExtenderTest.php:127

16) Drupal\KernelTests\Core\Database\SelectExtenderTest::testExtend@10 with data ('Drupal\core_fake\Driver\Datab...tender', 'Drupal\core_fake\Driver\Datab...lasses', 'Drupal\Core\Database\Query\Ta...tender')
No expectations were configured for the mock object for Drupal\Tests\Core\Database\Stub\StubPDO. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

/var/www/html/core/tests/Drupal/KernelTests/Core/Database/SelectExtenderTest.php:127

17) Drupal\KernelTests\Core\Database\SelectExtenderTest::testExtend@11 with data ('Drupal\core_fake\Driver\Datab...tender', 'Drupal\core_fake\Driver\Datab...lasses', '\Drupal\Core\Database\Query\T...tender')
No expectations were configured for the mock object for Drupal\Tests\Core\Database\Stub\StubPDO. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

/var/www/html/core/tests/Drupal/KernelTests/Core/Database/SelectExtenderTest.php:127

18) Drupal\KernelTests\Core\Database\SelectExtenderTest::testExtend@12 with data ('Drupal\core_fake\Driver\Datab...hQuery', 'Drupal\core_fake\Driver\Datab...lasses', 'Drupal\search\SearchQuery')
No expectations were configured for the mock object for Drupal\Tests\Core\Database\Stub\StubPDO. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

/var/www/html/core/tests/Drupal/KernelTests/Core/Database/SelectExtenderTest.php:127

19) Drupal\KernelTests\Core\Database\SelectExtenderTest::testExtend@13 with data ('Drupal\core_fake\Driver\Datab...hQuery', 'Drupal\core_fake\Driver\Datab...lasses', '\Drupal\search\SearchQuery')
No expectations were configured for the mock object for Drupal\Tests\Core\Database\Stub\StubPDO. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

/var/www/html/core/tests/Drupal/KernelTests/Core/Database/SelectExtenderTest.php:127

20) Drupal\KernelTests\Core\Database\SelectExtenderTest::testExtend@14 with data ('Drupal\core_fake\Driver\Datab...hQuery', 'Drupal\core_fake\Driver\Datab...lasses', 'Drupal\search\ViewsSearchQuery')
No expectations were configured for the mock object for Drupal\Tests\Core\Database\Stub\StubPDO. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

/var/www/html/core/tests/Drupal/KernelTests/Core/Database/SelectExtenderTest.php:127

21) Drupal\KernelTests\Core\Database\SelectExtenderTest::testExtend@15 with data ('Drupal\core_fake\Driver\Datab...hQuery', 'Drupal\core_fake\Driver\Datab...lasses', '\Drupal\search\ViewsSearchQuery')
No expectations were configured for the mock object for Drupal\Tests\Core\Database\Stub\StubPDO. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

/var/www/html/core/tests/Drupal/KernelTests/Core/Database/SelectExtenderTest.php:127

22) Drupal\KernelTests\Core\Database\TransactionTest::testMockTransaction
* No expectations were configured for the mock object for Drupal\Core\Database\Connection. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

* No expectations were configured for the mock object for Drupal\Core\Database\Transaction. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

/var/www/html/core/tests/Drupal/KernelTests/Core/Database/TransactionTest.php:1284

23) Drupal\KernelTests\Core\Entity\Sql\SqlContentEntityStorageTest::testDeleteFromDedicatedTablesExecutesOneDelete
* No expectations were configured for the mock object for Drupal\Core\Field\FieldStorageDefinitionInterface. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

* No expectations were configured for the mock object for Drupal\Core\Entity\EntityTypeInterface. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

/var/www/html/core/tests/Drupal/KernelTests/Core/Entity/Sql/SqlContentEntityStorageTest.php:26

24) Drupal\KernelTests\Core\Installer\InstallerRedirectTraitTest::testShouldRedirectToInstaller@0 with data (true, 'Drupal\Core\Database\Database...eption', false, false)
No expectations were configured for the mock object for Drupal\KernelTests\Core\Installer\InstallerRedirectTraitMockableClass. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

/var/www/html/core/tests/Drupal/KernelTests/Core/Installer/InstallerRedirectTraitTest.php:76

25) Drupal\KernelTests\Core\Installer\InstallerRedirectTraitTest::testShouldRedirectToInstaller@1 with data (true, 'Drupal\Core\Database\Database...eption', true, false)
* No expectations were configured for the mock object for Drupal\KernelTests\Core\Installer\InstallerRedirectTraitMockableClass. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

* No expectations were configured for the mock object for Drupal\Tests\Core\Database\Stub\StubConnection. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

/var/www/html/core/tests/Drupal/KernelTests/Core/Installer/InstallerRedirectTraitTest.php:76

26) Drupal\KernelTests\Core\Installer\InstallerRedirectTraitTest::testShouldRedirectToInstaller@2 with data (true, 'Drupal\Core\Database\Database...eption', false, true)
No expectations were configured for the mock object for Drupal\KernelTests\Core\Installer\InstallerRedirectTraitMockableClass. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

/var/www/html/core/tests/Drupal/KernelTests/Core/Installer/InstallerRedirectTraitTest.php:76

27) Drupal\KernelTests\Core\Installer\InstallerRedirectTraitTest::testShouldRedirectToInstaller@3 with data (true, 'Drupal\Core\Database\Database...eption', true, true)
* No expectations were configured for the mock object for Drupal\KernelTests\Core\Installer\InstallerRedirectTraitMockableClass. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

* No expectations were configured for the mock object for Drupal\Tests\Core\Database\Stub\StubConnection. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

/var/www/html/core/tests/Drupal/KernelTests/Core/Installer/InstallerRedirectTraitTest.php:76

28) Drupal\KernelTests\Core\Installer\InstallerRedirectTraitTest::testShouldRedirectToInstaller@4 with data (true, 'Drupal\Core\Database\Database...eption', true, true, false)
* No expectations were configured for the mock object for Drupal\KernelTests\Core\Installer\InstallerRedirectTraitMockableClass. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

* No expectations were configured for the mock object for Drupal\Tests\Core\Database\Stub\StubConnection. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

/var/www/html/core/tests/Drupal/KernelTests/Core/Installer/InstallerRedirectTraitTest.php:76

29) Drupal\KernelTests\Core\Installer\InstallerRedirectTraitTest::testShouldRedirectToInstaller@5 with data (true, 'PDOException', false, false)
No expectations were configured for the mock object for Drupal\KernelTests\Core\Installer\InstallerRedirectTraitMockableClass. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

/var/www/html/core/tests/Drupal/KernelTests/Core/Installer/InstallerRedirectTraitTest.php:76

30) Drupal\KernelTests\Core\Installer\InstallerRedirectTraitTest::testShouldRedirectToInstaller@6 with data (true, 'PDOException', true, false)
* No expectations were configured for the mock object for Drupal\KernelTests\Core\Installer\InstallerRedirectTraitMockableClass. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

* No expectations were configured for the mock object for Drupal\Tests\Core\Database\Stub\StubConnection. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

/var/www/html/core/tests/Drupal/KernelTests/Core/Installer/InstallerRedirectTraitTest.php:76

31) Drupal\KernelTests\Core\Installer\InstallerRedirectTraitTest::testShouldRedirectToInstaller@7 with data (false, 'PDOException', false, true)
No expectations were configured for the mock object for Drupal\KernelTests\Core\Installer\InstallerRedirectTraitMockableClass. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

/var/www/html/core/tests/Drupal/KernelTests/Core/Installer/InstallerRedirectTraitTest.php:76

32) Drupal\KernelTests\Core\Installer\InstallerRedirectTraitTest::testShouldRedirectToInstaller@8 with data (false, 'PDOException', true, true)
* No expectations were configured for the mock object for Drupal\KernelTests\Core\Installer\InstallerRedirectTraitMockableClass. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

* No expectations were configured for the mock object for Drupal\Tests\Core\Database\Stub\StubConnection. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

/var/www/html/core/tests/Drupal/KernelTests/Core/Installer/InstallerRedirectTraitTest.php:76

33) Drupal\KernelTests\Core\Installer\InstallerRedirectTraitTest::testShouldRedirectToInstaller@9 with data (true, 'PDOException', true, true, false)
* No expectations were configured for the mock object for Drupal\KernelTests\Core\Installer\InstallerRedirectTraitMockableClass. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

* No expectations were configured for the mock object for Drupal\Tests\Core\Database\Stub\StubConnection. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

/var/www/html/core/tests/Drupal/KernelTests/Core/Installer/InstallerRedirectTraitTest.php:76

34) Drupal\KernelTests\Core\Installer\InstallerRedirectTraitTest::testShouldRedirectToInstaller@10 with data (true, 'Drupal\Core\Database\Database...rapper', false, false)
No expectations were configured for the mock object for Drupal\KernelTests\Core\Installer\InstallerRedirectTraitMockableClass. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

/var/www/html/core/tests/Drupal/KernelTests/Core/Installer/InstallerRedirectTraitTest.php:76

35) Drupal\KernelTests\Core\Installer\InstallerRedirectTraitTest::testShouldRedirectToInstaller@11 with data (true, 'Drupal\Core\Database\Database...rapper', true, false)
* No expectations were configured for the mock object for Drupal\KernelTests\Core\Installer\InstallerRedirectTraitMockableClass. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

* No expectations were configured for the mock object for Drupal\Tests\Core\Database\Stub\StubConnection. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

/var/www/html/core/tests/Drupal/KernelTests/Core/Installer/InstallerRedirectTraitTest.php:76

36) Drupal\KernelTests\Core\Installer\InstallerRedirectTraitTest::testShouldRedirectToInstaller@12 with data (false, 'Drupal\Core\Database\Database...rapper', false, true)
No expectations were configured for the mock object for Drupal\KernelTests\Core\Installer\InstallerRedirectTraitMockableClass. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

/var/www/html/core/tests/Drupal/KernelTests/Core/Installer/InstallerRedirectTraitTest.php:76

37) Drupal\KernelTests\Core\Installer\InstallerRedirectTraitTest::testShouldRedirectToInstaller@13 with data (false, 'Drupal\Core\Database\Database...rapper', true, true)
* No expectations were configured for the mock object for Drupal\KernelTests\Core\Installer\InstallerRedirectTraitMockableClass. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

* No expectations were configured for the mock object for Drupal\Tests\Core\Database\Stub\StubConnection. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

/var/www/html/core/tests/Drupal/KernelTests/Core/Installer/InstallerRedirectTraitTest.php:76

38) Drupal\KernelTests\Core\Installer\InstallerRedirectTraitTest::testShouldRedirectToInstaller@14 with data (true, 'Drupal\Core\Database\Database...rapper', true, true, false)
* No expectations were configured for the mock object for Drupal\KernelTests\Core\Installer\InstallerRedirectTraitMockableClass. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

* No expectations were configured for the mock object for Drupal\Tests\Core\Database\Stub\StubConnection. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

/var/www/html/core/tests/Drupal/KernelTests/Core/Installer/InstallerRedirectTraitTest.php:76

39) Drupal\KernelTests\Core\Installer\InstallerRedirectTraitTest::testShouldRedirectToInstaller@15 with data (true, 'Symfony\Component\HttpKernel\...eption', false, false)
No expectations were configured for the mock object for Drupal\KernelTests\Core\Installer\InstallerRedirectTraitMockableClass. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

/var/www/html/core/tests/Drupal/KernelTests/Core/Installer/InstallerRedirectTraitTest.php:76

40) Drupal\KernelTests\Core\Installer\InstallerRedirectTraitTest::testShouldRedirectToInstaller@16 with data (true, 'Symfony\Component\HttpKernel\...eption', true, false)
* No expectations were configured for the mock object for Drupal\KernelTests\Core\Installer\InstallerRedirectTraitMockableClass. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

* No expectations were configured for the mock object for Drupal\Tests\Core\Database\Stub\StubConnection. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

/var/www/html/core/tests/Drupal/KernelTests/Core/Installer/InstallerRedirectTraitTest.php:76

41) Drupal\KernelTests\Core\Installer\InstallerRedirectTraitTest::testShouldRedirectToInstaller@17 with data (false, 'Symfony\Component\HttpKernel\...eption', false, true)
No expectations were configured for the mock object for Drupal\KernelTests\Core\Installer\InstallerRedirectTraitMockableClass. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

/var/www/html/core/tests/Drupal/KernelTests/Core/Installer/InstallerRedirectTraitTest.php:76

42) Drupal\KernelTests\Core\Installer\InstallerRedirectTraitTest::testShouldRedirectToInstaller@18 with data (false, 'Symfony\Component\HttpKernel\...eption', true, true)
* No expectations were configured for the mock object for Drupal\KernelTests\Core\Installer\InstallerRedirectTraitMockableClass. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

* No expectations were configured for the mock object for Drupal\Tests\Core\Database\Stub\StubConnection. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

/var/www/html/core/tests/Drupal/KernelTests/Core/Installer/InstallerRedirectTraitTest.php:76

43) Drupal\KernelTests\Core\Installer\InstallerRedirectTraitTest::testShouldRedirectToInstaller@19 with data (true, 'Symfony\Component\HttpKernel\...eption', true, true, false)
* No expectations were configured for the mock object for Drupal\KernelTests\Core\Installer\InstallerRedirectTraitMockableClass. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

* No expectations were configured for the mock object for Drupal\Tests\Core\Database\Stub\StubConnection. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

/var/www/html/core/tests/Drupal/KernelTests/Core/Installer/InstallerRedirectTraitTest.php:76

44) Drupal\KernelTests\Core\Installer\InstallerRedirectTraitTest::testShouldRedirectToInstaller@20 with data (false, 'Exception', false, false)
No expectations were configured for the mock object for Drupal\KernelTests\Core\Installer\InstallerRedirectTraitMockableClass. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

/var/www/html/core/tests/Drupal/KernelTests/Core/Installer/InstallerRedirectTraitTest.php:76

45) Drupal\KernelTests\Core\Installer\InstallerRedirectTraitTest::testShouldRedirectToInstaller@21 with data (false, 'Exception', true, false)
* No expectations were configured for the mock object for Drupal\KernelTests\Core\Installer\InstallerRedirectTraitMockableClass. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

* No expectations were configured for the mock object for Drupal\Tests\Core\Database\Stub\StubConnection. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

/var/www/html/core/tests/Drupal/KernelTests/Core/Installer/InstallerRedirectTraitTest.php:76

46) Drupal\KernelTests\Core\Installer\InstallerRedirectTraitTest::testShouldRedirectToInstaller@22 with data (false, 'Exception', false, true)
No expectations were configured for the mock object for Drupal\KernelTests\Core\Installer\InstallerRedirectTraitMockableClass. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

/var/www/html/core/tests/Drupal/KernelTests/Core/Installer/InstallerRedirectTraitTest.php:76

47) Drupal\KernelTests\Core\Installer\InstallerRedirectTraitTest::testShouldRedirectToInstaller@23 with data (false, 'Exception', true, true)
* No expectations were configured for the mock object for Drupal\KernelTests\Core\Installer\InstallerRedirectTraitMockableClass. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

* No expectations were configured for the mock object for Drupal\Tests\Core\Database\Stub\StubConnection. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

/var/www/html/core/tests/Drupal/KernelTests/Core/Installer/InstallerRedirectTraitTest.php:76

48) Drupal\KernelTests\Core\Installer\InstallerRedirectTraitTest::testShouldRedirectToInstaller@24 with data (false, 'Exception', true, true, false)
* No expectations were configured for the mock object for Drupal\KernelTests\Core\Installer\InstallerRedirectTraitMockableClass. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

* No expectations were configured for the mock object for Drupal\Tests\Core\Database\Stub\StubConnection. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

/var/www/html/core/tests/Drupal/KernelTests/Core/Installer/InstallerRedirectTraitTest.php:76

49) Drupal\KernelTests\Core\Recipe\InputTest::testPromptArgumentsAreForwarded
No expectations were configured for the mock object for Symfony\Component\Console\Input\InputInterface. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

/var/www/html/core/tests/Drupal/KernelTests/Core/Recipe/InputTest.php:118

50) Drupal\KernelTests\Core\Recipe\InputTest::testMissingArgumentsThrowsException
* No expectations were configured for the mock object for Symfony\Component\Console\Input\InputInterface. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

* No expectations were configured for the mock object for Symfony\Component\Console\Style\StyleInterface. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

/var/www/html/core/tests/Drupal/KernelTests/Core/Recipe/InputTest.php:155

51) Drupal\KernelTests\Core\Recipe\InputTest::testAskHiddenPromptArgumentsForwarded
* No expectations were configured for the mock object for Symfony\Component\Console\Input\InputInterface. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

* No expectations were configured for the mock object for Symfony\Component\Console\Output\OutputInterface. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

/var/www/html/core/tests/Drupal/KernelTests/Core/Recipe/InputTest.php:334

52) Drupal\KernelTests\Core\Recipe\InputTest::testAskPromptArgumentsInteger
No expectations were configured for the mock object for Symfony\Component\Console\Input\InputInterface. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

/var/www/html/core/tests/Drupal/KernelTests/Core/Recipe/InputTest.php:447

53) Drupal\KernelTests\Core\Theme\Icon\IconPackManagerKernelTest::testGetExtractorPluginForms
No expectations were configured for the mock object for Drupal\Core\Form\FormState. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

/var/www/html/core/tests/Drupal/KernelTests/Core/Theme/Icon/IconPackManagerKernelTest.php:173

54) Drupal\KernelTests\Core\Theme\Icon\IconPackManagerKernelTest::testGetExtractorPluginFormsWithAllowed
No expectations were configured for the mock object for Drupal\Core\Form\FormState. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.

/var/www/html/core/tests/Drupal/KernelTests/Core/Theme/Icon/IconPackManagerKernelTest.php:225
dcam’s picture

Meh. There's enough kernel tests with issues that they probably ought to be handled separately.

dcam’s picture

I changed my mind about adding the kernel tests to the MR. Only 16 classes were affected. Most of the changes were incredibly small and straight-forward. Here's the command to run PHPUnit on those classes (it may have to be tweaked for your local environment's setup):

phpunit --display-phpunit-notices --display-phpunit-deprecations core/modules/jsonapi/tests/src/Kernel/Normalizer/LinkCollectionNormalizerTest.php core/modules/migrate/tests/src/Kernel/MigrateEntityContentBaseTest.php core/modules/migrate/tests/src/Kernel/SqlBaseTest.php core/modules/migrate/tests/src/Kernel/process/DownloadTest.php core/modules/migrate/tests/src/Kernel/process/FileCopyTest.php core/modules/mysql/tests/src/Kernel/mysql/MysqlDriverTest.php core/modules/package_manager/tests/src/Kernel/StageCommitExceptionTest.php core/modules/package_manager/tests/src/Kernel/StageEventsTest.php core/modules/syslog/tests/src/Kernel/SyslogTest.php core/tests/Drupal/KernelTests/Core/Action/GotoActionTest.php core/tests/Drupal/KernelTests/Core/Database/SelectExtenderTest.php core/tests/Drupal/KernelTests/Core/Database/TransactionTest.php core/tests/Drupal/KernelTests/Core/Entity/Sql/SqlContentEntityStorageTest.php core/tests/Drupal/KernelTests/Core/Installer/InstallerRedirectTraitTest.php core/tests/Drupal/KernelTests/Core/Recipe/InputTest.php core/tests/Drupal/KernelTests/Core/Theme/Icon/IconPackManagerKernelTest.php

One test is not completely fixed, core/tests/Drupal/KernelTests/Core/Database/TransactionTest.php. The test's docblock says that it exists solely to ensure that we are capable of creating mock object transactions - and that's all it does. Apparently it needs to create a mock object, but there's no opportunity to check methods unless you add an incredibly unnecessary and blatant dummy assertion. And so, for the first time and at the end of this project I'm going to declare that we need to add the #[AllowMockObjectsWithoutExpectations] attribute to a test. This can't be done with the current version of PHPUnit. It has to be added as part of the PHPUnit 12 upgrade. So if you run the tests looking for notices, then don't worry that it isn't fixed.

dcam’s picture

Issue summary: View changes
smustgrave’s picture

Saving this one for last once the others land to do a better search. Most are RTBC but the views one which is a bear.

mondrake’s picture

Made a suggestion inline.

dcam’s picture

It should be noted that with this MR there are no more instances of disallowed.method in the baseline, meaning we got rid of all the uses of any() that we added to it. 👍

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Applied the MR locally and all instances of any() appear to be replaced in the repo.

I have no additional feedback

mondrake’s picture

There is only one test class failing in #3527936: Introduce support for PHPUnit 12 once this MR is included:

    PHPUnit 12.5.14 by Sebastian Bergmann and contributors.
    
    Runtime:       PHP 8.5.4
    Configuration: /builds/core/phpunit.xml.dist
    
    ..NN..NN..                                                        10 / 10 (100%)
    
    Time: 01:12.520, Memory: 14.00 MB
    
    Stage Conflict (Drupal\Tests\package_manager\Kernel\StageConflict)
     ✔ Destroy during apply with force·destroy·on·pre-apply,·fresh
     ✔ Destroy during apply with destroy·on·pre-apply,·fresh
     ✔ Destroy during apply with force·destroy·on·pre-apply,·stale
     ✔ Destroy during apply with destroy·on·pre-apply,·stale
     ✔ Destroy during apply with force·destroy·on·post-apply,·fresh
     ✔ Destroy during apply with destroy·on·post-apply,·fresh
     ✔ Destroy during apply with force·destroy·on·post-apply,·stale
     ✔ Destroy during apply with destroy·on·post-apply,·stale
     ✔ Apply and post apply in same request
     ✔ Uninstall module during apply
    
    4 tests triggered 4 PHPUnit notices:
    
    1) Drupal\Tests\package_manager\Kernel\StageConflictTest::testDestroyDuringApply@force destroy on pre-apply, stale with data ('Drupal\package_manager\Event\...yEvent', true, 7200, 'Stage directory does not exist')
    No expectations were configured for the mock object for PhpTuf\ComposerStager\API\Precondition\Service\PreconditionInterface. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.
    
    /builds/core/modules/package_manager/tests/src/Kernel/StageConflictTest.php:133
    
    2) Drupal\Tests\package_manager\Kernel\StageConflictTest::testDestroyDuringApply@destroy on pre-apply, stale with data ('Drupal\package_manager\Event\...yEvent', false, 7200, 'Stage directory does not exist')
    No expectations were configured for the mock object for PhpTuf\ComposerStager\API\Precondition\Service\PreconditionInterface. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.
    
    /builds/core/modules/package_manager/tests/src/Kernel/StageConflictTest.php:133
    
    3) Drupal\Tests\package_manager\Kernel\StageConflictTest::testDestroyDuringApply@force destroy on post-apply, stale with data ('Drupal\package_manager\Event\...yEvent', true, 7200, null)
    No expectations were configured for the mock object for PhpTuf\ComposerStager\API\Precondition\Service\PreconditionInterface. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.
    
    /builds/core/modules/package_manager/tests/src/Kernel/StageConflictTest.php:133
    
    4) Drupal\Tests\package_manager\Kernel\StageConflictTest::testDestroyDuringApply@destroy on post-apply, stale with data ('Drupal\package_manager\Event\...yEvent', false, 7200, null)
    No expectations were configured for the mock object for PhpTuf\ComposerStager\API\Precondition\Service\PreconditionInterface. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.
    
    /builds/core/modules/package_manager/tests/src/Kernel/StageConflictTest.php:133
    
    OK, but there were issues!
    Tests: 10, Assertions: 86, PHPUnit Notices: 4.

Would it make sense to try and fix it here?

smustgrave’s picture

@dcam did you have a separate issue for the kernel tests?

dcam’s picture

Status: Reviewed & tested by the community » Needs work

@dcam did you have a separate issue for the kernel tests?

No. They're all in this MR. I'll fix the package_manager class now.

dcam’s picture

Status: Needs work » Needs review

It was a quick fix.

mondrake’s picture

Status: Needs review » Reviewed & tested by the community

Thanks

mondrake’s picture

A new misusage was just introduced by Drupal\Tests\language\Unit\ConfigurableLanguageManagerSwitchLinksTest, but at this point I'd rather get this in and fix any stragglers in the PHPUnit 12 bump issue.

smustgrave’s picture

I posted in core-development and think longwave is going to be able to take a look later. I got the phpunit12 tab open and ready to peak after this lands

dcam’s picture

I have a fix for that class ready on my local env. I can apply it here or in the bump issue.

mondrake’s picture

Status: Reviewed & tested by the community » Needs work

#21 there are test failures, probably random - I think it would be good to get the fix here and then trigger new tests. I'll keep an eye on this and re-RTBC asap.

dcam’s picture

Status: Needs work » Needs review

The new class was added to the MR.

mondrake’s picture

Status: Needs review » Reviewed & tested by the community

Some test failure still, random ones I assume. The latest changes seem good to me.

dcam’s picture

Some test failure still, random ones I assume.

FWIW those two failed tests pass in my local environment.

catch’s picture

Status: Reviewed & tested by the community » Fixed

All looks good. Thanks once again for the self-review comments.

Committed/pushed to main, thanks! Can't believe this is the last one.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • catch committed f31d17ae on main
    task: #3581058 Convert expectation-less test mocks to stubs - cleanup...
smustgrave’s picture

Congrats yall!

Status: Fixed » Closed (fixed)

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