Skip to content

Commit

Permalink
Add test to cover custom site list column.
Browse files Browse the repository at this point in the history
  • Loading branch information
jblz committed Jan 11, 2022
1 parent aa6dc3f commit 71ad94e
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions tests/Integration/UI/NetworkAdminSitesListTest.php
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 );
}
}

0 comments on commit 71ad94e

Please sign in to comment.