Skip to content

Commit 5599c23

Browse files
author
costdev
committed
Tests: Get actual user counts in test data.
This test was previously faulty and used the counts from a local install. This has now been resolved using: - `get_user_count()` for 'all' - `count( get_super_admins() )` for 'super'
1 parent 432fbb5 commit 5599c23

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

tests/phpunit/tests/multisite/wpMsUsersListTable.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,12 @@ public static function wpTearDownAfterClass() {
9595
* @covers WP_MS_Users_List_Table::get_views
9696
*/
9797
public function test_get_views_should_return_views_by_default() {
98+
$all = get_user_count();
99+
$super = count( get_super_admins() );
100+
98101
$expected = array(
99-
'all' => '<a href="http://example.org/wp-admin/network/users.php" class="current" aria-current="page">All <span class="count">(1)</span></a>',
100-
'super' => '<a href="http://example.org/wp-admin/network/users.php?role=super">Super Admin <span class="count">(1)</span></a>',
102+
'all' => '<a href="http://example.org/wp-admin/network/users.php" class="current" aria-current="page">All <span class="count">(' . $all . ')</span></a>',
103+
'super' => '<a href="http://example.org/wp-admin/network/users.php?role=super">Super Admin <span class="count">(' . $super . ')</span></a>',
101104
);
102105

103106
$this->assertSame( $expected, $this->table->get_views() );

0 commit comments

Comments
 (0)