Skip to content

Commit

Permalink
Merge pull request #63 from Yoast/JRF/tests-static-dataproviders
Browse files Browse the repository at this point in the history
Tests: make dataproviders `static`
  • Loading branch information
jrfnl authored Sep 23, 2023
2 parents 55643b9 + 153072e commit 6de43fc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions tests/BrainMonkey/TestCaseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ public function testMakeDoubleForUnavailableClass( $class_name ) {
*
* @return array<string, array<string>>
*/
public function dataMakeDoubleForUnavailableClass() {
public static function dataMakeDoubleForUnavailableClass() {
return [
'Global class name' => [ 'GlobalClassName' ],
'Global class name with leading backslash' => [ '\BackslashedClassName' ],
Expand Down Expand Up @@ -220,7 +220,7 @@ public function testMakeDoubleForUnavailableClassThrowsExceptionWithInvalidName(
*
* @return array<string, array<string>>
*/
public function dataMakeDoubleForUnavailableClassThrowsExceptionWithInvalidName() {
public static function dataMakeDoubleForUnavailableClassThrowsExceptionWithInvalidName() {
return [
'Empty string as class name' => [ '' ],
'Only backslashes' => [ '\\\\\\' ],
Expand Down
10 changes: 5 additions & 5 deletions tests/BrainMonkey/YoastTestCaseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function testStubGetBlogInfo( $show, $expected ) {
*
* @return array<string, array<string, string>>
*/
public function dataStubGetBlogInfo() {
public static function dataStubGetBlogInfo() {
return [
// Explicit cases.
'charset' => [
Expand Down Expand Up @@ -140,7 +140,7 @@ public function testStubWpParseArgs( $settings, $defaults, $expected ) {
*
* @return array<string, array<string, array<string, mixed>>>
*/
public function dataStubWpParseArgs() {
public static function dataStubWpParseArgs() {
return [
'two empty arrays' => [
'settings' => [],
Expand Down Expand Up @@ -221,7 +221,7 @@ public function testStubWpStripAllTags( $text, $remove_breaks, $expected ) {
*
* @return array<string, array<string, string|bool>>
*/
public function dataStubWpStripAllTags() {
public static function dataStubWpStripAllTags() {
return [
'Empty string' => [
'text' => '',
Expand Down Expand Up @@ -284,7 +284,7 @@ public function testStubWpSlash( $input ) {
*
* @return array<string, array<string, mixed>>
*/
public function dataStubWpSlash() {
public static function dataStubWpSlash() {
return [
'string' => [
'input' => "O'Reilly?",
Expand Down Expand Up @@ -322,7 +322,7 @@ public function testStubWpUnslash( $input, $expected ) {
*
* @return array<string, array<string, mixed>>
*/
public function dataStubWpUnslash() {
public static function dataStubWpUnslash() {
return [
'string' => [
'input' => "O\'Reilly\?",
Expand Down
4 changes: 2 additions & 2 deletions tests/Helpers/ExpectOutputHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public function testMatchingSubstringsWithMismatchedLineEndingsAmount( $expected
*
* @return array<array<string>>
*/
public function dataMatchingSubstringsMismatchedLineEndings() {
public static function dataMatchingSubstringsMismatchedLineEndings() {
return [
// Actual line ending type.
[ "fox\njumps" ],
Expand Down Expand Up @@ -233,7 +233,7 @@ public function testNormalizeLineEndings( $input, $expected ) {
*
* @return array<string, array<string>>
*/
public function dataNormalizeLineEndings() {
public static function dataNormalizeLineEndings() {
return [
'already-lf' => [ "foo\n\nbar\n", "foo\n\nbar\n" ],
'windows-crlf' => [ "foo\r\n\r\nbar\r\n", "foo\n\nbar\n" ],
Expand Down

0 comments on commit 6de43fc

Please sign in to comment.