Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions tests/phpunit/tests/abilities-api/wpAbility.php
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ public function test_meta_public_throws_exception_for_non_boolean() {
*
* @return array<string, array{0: array, 1: callable, 2: mixed, 3: mixed}> Data sets with different configurations.
*/
public function data_execute_input() {
public static function data_execute_input() {
return array(
'null input' => array(
array(
Expand Down Expand Up @@ -524,7 +524,7 @@ public function test_execute_input( $input_schema, $execute_callback, $input, $r
*
* @return array<string, array{0: array, 1: mixed, 2: bool}> Data sets.
*/
public function data_validate_input_top_level_required() {
public static function data_validate_input_top_level_required() {
$required_true = array(
'type' => 'string',
'required' => true,
Expand Down Expand Up @@ -634,7 +634,7 @@ public function my_instance_execute_callback( string $input ): int {
*
* @return array<string, array{0: callable}> Data sets with different execute callbacks.
*/
public function data_execute_callback() {
public static function data_execute_callback() {
return array(
'function name string' => array(
'strlen',
Expand All @@ -651,7 +651,14 @@ static function ( string $input ): int {
array( 'Tests_Abilities_API_WpAbility', 'my_static_execute_callback' ),
),
'object method' => array(
array( $this, 'my_instance_execute_callback' ),
array(
new class() {
public function my_instance_execute_callback( string $input ): int {
return strlen( $input );
}
},
'my_instance_execute_callback',
),
),
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ public function test_category_with_special_characters(): void {
*
* @return array<int, array<string>> Valid ability category slugs.
*/
public function data_valid_slug_provider(): array {
public static function data_valid_slug_provider(): array {
return array(
array( 'test-simple' ),
array( 'test-multiple-words' ),
Expand Down Expand Up @@ -430,7 +430,7 @@ public function test_category_slug_valid_formats( string $slug ): void {
*
* @return array<int, array<string>> Invalid ability category slugs.
*/
public function data_invalid_slug_provider(): array {
public static function data_invalid_slug_provider(): array {
return array(
array( 'Test-Uppercase' ),
array( 'test_underscore' ),
Expand Down
Loading