Skip to content

Commit

Permalink
Fix PHP 8.2 deprecation warnings (#165)
Browse files Browse the repository at this point in the history
* Fix PHP 8.2 deprication warnings

This fixes the following warnings:

 8192: Creation of dynamic property WP_CLI\Tests\Context\FeatureContext::$result is deprecated in /wp-cli-tests/src/Context/WhenStepDefinitions.php line 39

8192: Creation of dynamic property WP_CLI\Tests\Context\FeatureContext::$email_sends is deprecated in /wp-cli-dev/wp-cli-tests/src/Context/WhenStepDefinitions.php line 40

Which cause behat tests to fail with PHP 8.2

* Add code comments for these variables

---------

Co-authored-by: Daniel Bachhuber <daniel.bachhuber@automattic.com>
  • Loading branch information
mrsdizzie and danielbachhuber authored Apr 6, 2023
1 parent ff44534 commit c606e43
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Context/FeatureContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,16 @@ class FeatureContext implements SnippetAcceptingContext {
use ThenStepDefinitions;
use WhenStepDefinitions;

/**
* The result of the last command run with `When I run` or `When I try`. Lives until the end of the scenario.
*/
private $result;

/**
* The number of emails sent by the last command run with `When I run` or `When I try`. Lives until the end of the scenario.
*/
private $email_sends;

/**
* The current working directory for scenarios that have a "Given a WP installation" or "Given an empty directory" step. Variable RUN_DIR. Lives until the end of the scenario.
*/
Expand Down

0 comments on commit c606e43

Please sign in to comment.