mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-10-04 06:37:06 +00:00
Tests: Use more appropriate assertions in various tests.
This replaces instances of `assertTrue( isset( ... ) )` with `assertArrayHasKey()` to use native PHPUnit functionality. Follow-up to [51335], [51337], [51367]. See #53363. git-svn-id: https://develop.svn.wordpress.org/trunk@51397 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -72,15 +72,15 @@ if ( is_multisite() ) :
|
||||
// Each site retrieved should match the expected structure.
|
||||
foreach ( $blogs_of_user as $blog_id => $blog ) {
|
||||
$this->assertSame( $blog_id, $blog->userblog_id );
|
||||
$this->assertTrue( isset( $blog->userblog_id ) );
|
||||
$this->assertTrue( isset( $blog->blogname ) );
|
||||
$this->assertTrue( isset( $blog->domain ) );
|
||||
$this->assertTrue( isset( $blog->path ) );
|
||||
$this->assertTrue( isset( $blog->site_id ) );
|
||||
$this->assertTrue( isset( $blog->siteurl ) );
|
||||
$this->assertTrue( isset( $blog->archived ) );
|
||||
$this->assertTrue( isset( $blog->spam ) );
|
||||
$this->assertTrue( isset( $blog->deleted ) );
|
||||
$this->assertObjectHasAttribute( 'userblog_id', $blog );
|
||||
$this->assertObjectHasAttribute( 'blogname', $blog );
|
||||
$this->assertObjectHasAttribute( 'domain', $blog );
|
||||
$this->assertObjectHasAttribute( 'path', $blog );
|
||||
$this->assertObjectHasAttribute( 'site_id', $blog );
|
||||
$this->assertObjectHasAttribute( 'siteurl', $blog );
|
||||
$this->assertObjectHasAttribute( 'archived', $blog );
|
||||
$this->assertObjectHasAttribute( 'spam', $blog );
|
||||
$this->assertObjectHasAttribute( 'deleted', $blog );
|
||||
}
|
||||
|
||||
// Mark each remaining site as spam, archived, and deleted.
|
||||
|
||||
Reference in New Issue
Block a user