-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test to cover custom site list column.
- Loading branch information
Showing
1 changed file
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?php | ||
/** | ||
* UI Tests for the Network Admin Sites List. | ||
* | ||
* @package Parsely\Tests\UI | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Parsely\Tests\Integration\UI; | ||
|
||
use Parsely\Tests\Integration\TestCase; | ||
|
||
/** | ||
* UI Tests for the Network Admin Sites List. | ||
*/ | ||
final class NetworkAdminSitesListTest extends TestCase { | ||
/** | ||
* Skip all tests for non-multisite runs. | ||
* Set up an instance variable to hold a `WP_MS_Sites_List_Table` object. | ||
* | ||
* @return void | ||
*/ | ||
protected function setUp(): void { | ||
parent::setUp(); | ||
|
||
if ( ! is_multisite() ) { | ||
self::markTestSkipped(); | ||
} | ||
|
||
$this->table = _get_list_table( 'WP_MS_Sites_List_Table', array( 'screen' => 'ms-sites' ) ); | ||
} | ||
|
||
/** | ||
* Make sure the custom column is included. | ||
* | ||
* @return void | ||
*/ | ||
public function test_api_key_column_is_present(): void { | ||
$columns = $this->table->get_columns(); | ||
|
||
// phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_var_export | ||
var_export( $columns ); | ||
|
||
self::assertArrayNotHasKey( 'parsely-api-key', $columns ); | ||
} | ||
} |