Skip to content

Commit 598a0fb

Browse files
gziolowestonruter
andcommitted
Update src/wp-includes/rest-api/endpoints/class-wp-rest-abilities-list-controller.php
Co-authored-by: Weston Ruter <[email protected]>
1 parent 1603ce9 commit 598a0fb

File tree

7 files changed

+10
-17
lines changed

7 files changed

+10
-17
lines changed

src/wp-includes/abilities-api/class-wp-abilities-category-registry.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ final class WP_Abilities_Category_Registry {
3030
* Holds the registered categories.
3131
*
3232
* @since 6.9.0
33-
* @var \WP_Ability_Category[]
33+
* @var WP_Ability_Category[]
3434
*/
3535
private $registered_categories = array();
3636

src/wp-includes/abilities-api/class-wp-abilities-registry.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ final class WP_Abilities_Registry {
3030
* Holds the registered abilities.
3131
*
3232
* @since 6.9.0
33-
* @var \WP_Ability[]
33+
* @var WP_Ability[]
3434
*/
3535
private $registered_abilities = array();
3636

src/wp-includes/rest-api/endpoints/class-wp-rest-abilities-list-controller.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -315,8 +315,6 @@ public function get_collection_params(): array {
315315
'description' => __( 'Current page of the collection.' ),
316316
'type' => 'integer',
317317
'default' => 1,
318-
'sanitize_callback' => 'absint',
319-
'validate_callback' => 'rest_validate_request_arg',
320318
'minimum' => 1,
321319
),
322320
'per_page' => array(
@@ -325,8 +323,6 @@ public function get_collection_params(): array {
325323
'default' => self::DEFAULT_PER_PAGE,
326324
'minimum' => 1,
327325
'maximum' => 100,
328-
'sanitize_callback' => 'absint',
329-
'validate_callback' => 'rest_validate_request_arg',
330326
),
331327
'category' => array(
332328
'description' => __( 'Limit results to abilities in specific category.' ),

tests/phpunit/tests/abilities-api/wpAbilitiesRegistry.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class Tests_Abilities_API_WpAbilitiesRegistry extends WP_UnitTestCase {
1515
/**
1616
* Mock abilities registry.
1717
*
18-
* @var \WP_Abilities_Registry
18+
* @var WP_Abilities_Registry
1919
*/
2020
private $registry = null;
2121

tests/phpunit/tests/abilities-api/wpAbilityCategory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class Tests_Abilities_API_WpAbilityCategory extends WP_UnitTestCase {
1717
/**
1818
* Category registry instance.
1919
*
20-
* @var \WP_Abilities_Category_Registry
20+
* @var WP_Abilities_Category_Registry
2121
*/
2222
private $registry;
2323

tests/phpunit/tests/rest-api/wpRestAbilitiesListController.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class Tests_REST_API_WpRestAbilitiesListController extends WP_UnitTestCase {
1313
/**
1414
* REST Server instance.
1515
*
16-
* @var \WP_REST_Server
16+
* @var WP_REST_Server
1717
*/
1818
protected $server;
1919

@@ -47,10 +47,6 @@ public static function set_up_before_class(): void {
4747
'abilities_api_categories_init',
4848
array( __CLASS__, 'register_test_categories' )
4949
);
50-
51-
// Initialize Abilities API.
52-
do_action( 'abilities_api_init' );
53-
5450
}
5551

5652
/**
@@ -78,6 +74,8 @@ public function set_up(): void {
7874

7975
do_action( 'rest_api_init' );
8076

77+
// Initialize Abilities API.
78+
do_action( 'abilities_api_init' );
8179
$this->register_test_abilities();
8280

8381
// Set default user for tests

tests/phpunit/tests/rest-api/wpRestAbilitiesRunController.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class Tests_REST_API_WpRestAbilitiesRunController extends WP_UnitTestCase {
1313
/**
1414
* REST Server instance.
1515
*
16-
* @var \WP_REST_Server
16+
* @var WP_REST_Server
1717
*/
1818
protected $server;
1919

@@ -59,9 +59,6 @@ public static function set_up_before_class(): void {
5959
'abilities_api_categories_init',
6060
array( __CLASS__, 'register_test_categories' )
6161
);
62-
63-
// Initialize Abilities API.
64-
do_action( 'abilities_api_init' );
6562
}
6663

6764
/**
@@ -88,6 +85,8 @@ public function set_up(): void {
8885

8986
do_action( 'rest_api_init' );
9087

88+
// Initialize Abilities API.
89+
do_action( 'abilities_api_init' );
9190
$this->register_test_abilities();
9291

9392
// Set default user for tests

0 commit comments

Comments
 (0)