mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
This replaces all references to the `WP_UnitTestCase_Base::$factory` property with static function calls to the `WP_UnitTestCase_Base::factory()` method. This is a consistency improvement for the test suite. Follow up to [35225], [35242], [49603], [54087], [54088]. Props jrf. See #55652. git-svn-id: https://develop.svn.wordpress.org/trunk@54090 602fd350-edb4-49c9-b593-d223f7449a82
34 lines
662 B
PHP
34 lines
662 B
PHP
<?php
|
|
|
|
/**
|
|
* @group comment
|
|
* @covers ::comments_open
|
|
*/
|
|
class Tests_Comment_CommentsOpen extends WP_UnitTestCase {
|
|
|
|
/**
|
|
* @ticket 54159
|
|
*/
|
|
public function test_post_does_not_exist() {
|
|
$this->assertFalse( comments_open( 99999 ) );
|
|
}
|
|
|
|
/**
|
|
* @ticket 54159
|
|
*/
|
|
public function test_post_exist_status_open() {
|
|
$post = self::factory()->post->create_and_get();
|
|
$this->assertTrue( comments_open( $post ) );
|
|
}
|
|
|
|
/**
|
|
* @ticket 54159
|
|
*/
|
|
public function test_post_exist_status_closed() {
|
|
$post = self::factory()->post->create_and_get();
|
|
$post->comment_status = 'closed';
|
|
|
|
$this->assertFalse( comments_open( $post ) );
|
|
}
|
|
}
|