| 1 | <?php |
| 2 | /** |
| 3 | * Test cases for the `WP_User_Request` class. |
| 4 | * |
| 5 | * @package WordPress |
| 6 | */ |
| 7 | |
| 8 | /** |
| 9 | * Tests_WP_User_Request class. |
| 10 | * |
| 11 | * @group user |
| 12 | */ |
| 13 | class Tests_WP_User_Request extends WP_UnitTestCase { |
| 14 | |
| 15 | /** |
| 16 | * Tests if the author id has been casted to an integer. |
| 17 | * |
| 18 | * @ticket 44723 |
| 19 | */ |
| 20 | public function testAuthorToIntCasting() { |
| 21 | $user = self::factory()->user->create_and_get( |
| 22 | array( |
| 23 | 'post_author' => '2', |
| 24 | ) |
| 25 | ); |
| 26 | |
| 27 | $user_request = new WP_User_Request( $user ); |
| 28 | |
| 29 | $this->assertTrue( is_int( $user_request->user_id ) ); |
| 30 | } |
| 31 | } |