-
Notifications
You must be signed in to change notification settings - Fork 674
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TASK] Replace usages of getMockForAbstractClass in EXT:core
`getMockForAbstractClass` has been (soft-)deprecated in PHPUnit 10.1: sebastianbergmann/phpunit#5241 Hence, we should replace its usages to follow best practices and avoid deprecation warnings later with PHPUnit 11. We do this by creating dedicated fixture subclasses of the affected abstract classes. Resolves: #101630 Related: #101601 Releases: main Change-Id: I27f526cb7ee4e1f2081c05befd3d70549dd0e2fd Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/80470 Tested-by: Christian Kuhn <[email protected]> Reviewed-by: Christian Kuhn <[email protected]> Tested-by: Anja Leichsenring <[email protected]> Tested-by: Andreas Nedbal <[email protected]> Reviewed-by: Lina Wolf <[email protected]> Tested-by: core-ci <[email protected]> Tested-by: Lina Wolf <[email protected]> Reviewed-by: Anja Leichsenring <[email protected]> Reviewed-by: Andreas Nedbal <[email protected]>
- Loading branch information
1 parent
97d5db5
commit 9bdfcfd
Showing
13 changed files
with
443 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
typo3/sysext/core/Tests/Unit/Log/Processor/Fixtures/TestingMemoryProcessor.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* This file is part of the TYPO3 CMS project. | ||
* | ||
* It is free software; you can redistribute it and/or modify it under | ||
* the terms of the GNU General Public License, either version 2 | ||
* of the License, or any later version. | ||
* | ||
* For the full copyright and license information, please read the | ||
* LICENSE.txt file that was distributed with this source code. | ||
* | ||
* The TYPO3 project - inspiring people to share! | ||
*/ | ||
|
||
namespace TYPO3\CMS\Core\Tests\Unit\Log\Processor\Fixtures; | ||
|
||
use TYPO3\CMS\Core\Log\LogRecord; | ||
use TYPO3\CMS\Core\Log\Processor\AbstractMemoryProcessor; | ||
|
||
/** | ||
* Testing subclass of `AbstractMemoryProcessor`. | ||
*/ | ||
final class TestingMemoryProcessor extends AbstractMemoryProcessor | ||
{ | ||
public function processLogRecord(LogRecord $logRecord): LogRecord | ||
{ | ||
throw new \BadMethodCallException('Not implemented', 1691578434); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
typo3/sysext/core/Tests/Unit/Resource/Collection/Fixtures/TestingFileCollection.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* This file is part of the TYPO3 CMS project. | ||
* | ||
* It is free software; you can redistribute it and/or modify it under | ||
* the terms of the GNU General Public License, either version 2 | ||
* of the License, or any later version. | ||
* | ||
* For the full copyright and license information, please read the | ||
* LICENSE.txt file that was distributed with this source code. | ||
* | ||
* The TYPO3 project - inspiring people to share! | ||
*/ | ||
|
||
namespace TYPO3\CMS\Core\Tests\Unit\Resource\Collection\Fixtures; | ||
|
||
use TYPO3\CMS\Core\Resource\Collection\AbstractFileCollection; | ||
|
||
/** | ||
* Testing subclass of `AbstractFileCollection`. | ||
*/ | ||
final class TestingFileCollection extends AbstractFileCollection | ||
{ | ||
public function loadContents(): void | ||
{ | ||
// stub | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.