Skip to content

Commit 153072e

Browse files
committed
Tests: make dataproviders static
As of PHPUnit 10, data providers are (again) expected to be `static` methods. This updates the test suite to respect that.
1 parent 7d83656 commit 153072e

3 files changed

Lines changed: 9 additions & 9 deletions

File tree

tests/BrainMonkey/TestCaseTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ public function testMakeDoubleForUnavailableClass( $class_name ) {
184184
*
185185
* @return array
186186
*/
187-
public function dataMakeDoubleForUnavailableClass() {
187+
public static function dataMakeDoubleForUnavailableClass() {
188188
return [
189189
'Global class name' => [ 'GlobalClassName' ],
190190
'Global class name with leading backslash' => [ '\BackslashedClassName' ],
@@ -220,7 +220,7 @@ public function testMakeDoubleForUnavailableClassThrowsExceptionWithInvalidName(
220220
*
221221
* @return array
222222
*/
223-
public function dataMakeDoubleForUnavailableClassThrowsExceptionWithInvalidName() {
223+
public static function dataMakeDoubleForUnavailableClassThrowsExceptionWithInvalidName() {
224224
return [
225225
'Empty string as class name' => [ '' ],
226226
'Only backslashes' => [ '\\\\\\' ],

tests/BrainMonkey/YoastTestCaseTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function testStubGetBlogInfo( $show, $expected ) {
3030
*
3131
* @return array
3232
*/
33-
public function dataStubGetBlogInfo() {
33+
public static function dataStubGetBlogInfo() {
3434
return [
3535
// Explicit cases.
3636
'charset' => [
@@ -140,7 +140,7 @@ public function testStubWpParseArgs( $settings, $defaults, $expected ) {
140140
*
141141
* @return array
142142
*/
143-
public function dataStubWpParseArgs() {
143+
public static function dataStubWpParseArgs() {
144144
return [
145145
'two empty arrays' => [
146146
'settings' => [],
@@ -221,7 +221,7 @@ public function testStubWpStripAllTags( $text, $remove_breaks, $expected ) {
221221
*
222222
* @return array
223223
*/
224-
public function dataStubWpStripAllTags() {
224+
public static function dataStubWpStripAllTags() {
225225
return [
226226
'Empty string' => [
227227
'text' => '',
@@ -284,7 +284,7 @@ public function testStubWpSlash( $input ) {
284284
*
285285
* @return array
286286
*/
287-
public function dataStubWpSlash() {
287+
public static function dataStubWpSlash() {
288288
return [
289289
'string' => [
290290
'input' => "O'Reilly?",
@@ -322,7 +322,7 @@ public function testStubWpUnslash( $input, $expected ) {
322322
*
323323
* @return array
324324
*/
325-
public function dataStubWpUnslash() {
325+
public static function dataStubWpUnslash() {
326326
return [
327327
'string' => [
328328
'input' => "O\'Reilly\?",

tests/Helpers/ExpectOutputHelperTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ public function testMatchingSubstringsWithMismatchedLineEndingsAmount( $expected
125125
*
126126
* @return array
127127
*/
128-
public function dataMatchingSubstringsMismatchedLineEndings() {
128+
public static function dataMatchingSubstringsMismatchedLineEndings() {
129129
return [
130130
// Actual line ending type.
131131
[ "fox\njumps" ],
@@ -233,7 +233,7 @@ public function testNormalizeLineEndings( $input, $expected ) {
233233
*
234234
* @return array
235235
*/
236-
public function dataNormalizeLineEndings() {
236+
public static function dataNormalizeLineEndings() {
237237
return [
238238
'already-lf' => [ "foo\n\nbar\n", "foo\n\nbar\n" ],
239239
'windows-crlf' => [ "foo\r\n\r\nbar\r\n", "foo\n\nbar\n" ],

0 commit comments

Comments
 (0)