Skip to content

Commit

Permalink
Fix some PHPUnit deprecated warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
remcotolsma committed May 15, 2024
1 parent 26ed1b3 commit eacd33b
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@
/wp-content/

# PHPUnit
/.phpunit.cache/
/.phpunit.result.cache
4 changes: 2 additions & 2 deletions tests/src/Core/UtilTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function test_class_method_exists( $class_name, $method_name, $expected )
*
* @return array
*/
public function status_matrix_provider() {
public static function status_matrix_provider() {
return [
[ __NAMESPACE__ . '\Util', 'class_method_exists', true ],
[ 'ClassDoesNotExist', 'method_does_not_exist', false ],
Expand Down Expand Up @@ -78,7 +78,7 @@ public function test_get_remote_address( $server, $expected ) {
*
* @return array
*/
public function server_ip_matrix_provider() {
public static function server_ip_matrix_provider() {
return [
[
[
Expand Down
2 changes: 1 addition & 1 deletion tests/src/CreditCardTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public function test_get_expiration_date( $year, $month, $expected_date ) {
*
* @return array
*/
public function expiration_dates_provider() {
public static function expiration_dates_provider() {
return [
[ '2018', '12', new \DateTime( 'first day of December 2018' ) ],
[ 2018, 12, new \DateTime( 'first day of December 2018' ) ],
Expand Down
4 changes: 2 additions & 2 deletions tests/src/Payments/PaymentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function test_set_and_get( $set_function, $get_function, $value, $expect_
*
* @return array
*/
public function get_and_set_provider() {
public static function get_and_set_provider() {
$now = new DateTime();

return [
Expand Down Expand Up @@ -127,7 +127,7 @@ public function test_get( $property, $get_function, $value, $expect_deprecated =
*
* @return array
*/
public function get_provider() {
public static function get_provider() {
return [
[ 'order_id', 'get_order_id', 1234 ],
[ 'email', 'get_email', '[email protected]' ],
Expand Down
2 changes: 1 addition & 1 deletion tests/src/Subscriptions/SubscriptionHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public function test_next_payment_date( $start_date, $interval_spec, $recurrence
*
* @return array
*/
public function subscription_interval_provider() {
public static function subscription_interval_provider() {
return [
[ '2005-05-05', 'P1W', 1, null ],
[ '2005-05-05', 'P3W', 2, '2005-05-26' ],
Expand Down
4 changes: 2 additions & 2 deletions tests/src/Subscriptions/SubscriptionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function test_set_and_get( $set_function, $get_function, $value ) {
*
* @return array
*/
public function get_and_set_provider() {
public static function get_and_set_provider() {
return [
[ 'set_id', 'get_id', uniqid() ],
[ 'set_status', 'get_status', 'completed' ],
Expand Down Expand Up @@ -82,7 +82,7 @@ public function test_get( $property, $get_function, $value ) {
*
* @return array
*/
public function get_provider() {
public static function get_provider() {
return [
[ 'key', 'get_key', uniqid() ],
[ 'source', 'get_source', 'woocommerce' ],
Expand Down

0 comments on commit eacd33b

Please sign in to comment.