wordpress-develop/tests/phpunit/tests/admin/wpUsersListTable.php
Sergey Biryukov 2a6b527f73 Tests: Improve the @group annotation accuracy and consistency.
Includes removing `.php` from some older group names, because most of the groups are no longer named based on the file containing the function, and sometimes functions move around, making the file-based group name inaccurate.

Props afercia, aristath, poena, SergeyBiryukov.
See #59647.

git-svn-id: https://develop.svn.wordpress.org/trunk@56971 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-19 13:51:04 +00:00

34 lines
814 B
PHP

<?php
/**
* @group admin
* @group user
*
* @covers WP_Users_List_Table
*/
class Tests_Admin_wpUsersListTable extends WP_UnitTestCase {
/**
* @var WP_Users_List_Table
*/
public $table = false;
public function set_up() {
parent::set_up();
$this->table = _get_list_table( 'WP_Users_List_Table', array( 'screen' => 'users' ) );
}
/**
* @ticket 42066
*
* @covers WP_Users_List_Table::get_views
*/
public function test_get_views_should_return_views_by_default() {
$expected = array(
'all' => '<a href="users.php" class="current" aria-current="page">All <span class="count">(1)</span></a>',
'administrator' => '<a href="users.php?role=administrator">Administrator <span class="count">(1)</span></a>',
);
$this->assertSame( $expected, $this->table->get_views() );
}
}