-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #44 from Yoast/develop
Release version 1.1.0
- Loading branch information
Showing
14 changed files
with
815 additions
and
45 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Dependabot configuration. | ||
# | ||
# Please see the documentation for all configuration options: | ||
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file | ||
|
||
version: 2 | ||
updates: | ||
# Maintain dependencies for GitHub Actions. | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
open-pull-requests-limit: 5 | ||
commit-message: | ||
prefix: "GH Actions:" | ||
labels: | ||
- "yoastcs/qa" | ||
|
||
# Maintain dependencies for Composer. | ||
- package-ecosystem: "composer" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
open-pull-requests-limit: 5 # Set to 0 to (temporarily) disable. | ||
versioning-strategy: "increase-if-necessary" | ||
commit-message: | ||
prefix: "Composer:" | ||
labels: | ||
- "yoastcs/qa" |
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
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
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
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,38 @@ | ||
<?php | ||
|
||
namespace Yoast\WPTestUtils\BrainMonkey\Doubles; | ||
|
||
use stdClass; | ||
|
||
/** | ||
* This is a "dummy" test double class for use with Mockery. | ||
* | ||
* This class allows to mock classes which are unavailable during the test run | ||
* and on which properties need to be set, either from within the test or | ||
* from within the code under test, by aliasing this class ahead of creating the mock. | ||
* | ||
* Mocking unavailable classes using an anonymous mock - `Mockery::mock()` or | ||
* a mock for a specific named, but unavailable class - `Mockery::mock( 'Unavailable' )` - | ||
* worked fine prior to PHP 8.2. | ||
* However, PHP 8.2 deprecates the use of dynamic properties, which means that if | ||
* either of the above code patterns is used and either the test or the code under | ||
* test sets properties on the Mock, tests will throw deprecation notices and, | ||
* depending on the value for the PHPUnit `convertDeprecationsToExceptions` configuration | ||
* option, tests may show as errored. | ||
* | ||
* The "go to" pattern to solve this is to let the mock extend `stdClass`, but | ||
* as `stdClass` always exists, the class will then identify as an instance of `stdClass` | ||
* and no longer as an instance of the "Unavailable" class, which causes problems | ||
* with code using type declarations of calls to `instanceof`. | ||
* | ||
* The other alternative would be to used `Mockery::namedMock()` or an alias mock, but | ||
* both of these require each test using these to run in a separate process, which | ||
* makes debugging of failing tests more complicated as well as making the test suite | ||
* slower. | ||
* | ||
* Note: aliasing `stdClass` directly is not allowed in PHP, which is why this | ||
* dummy test double class is put in place. | ||
* | ||
* @link https://github.com/mockery/mockery/issues/1197 | ||
*/ | ||
class DummyTestDouble extends stdClass {} |
Oops, something went wrong.