Add default function for whether comments are allowed
Some checks failed
Some checks failed
This commit is contained in:
parent
ef3389e64d
commit
356a96adb6
2 changed files with 3 additions and 5 deletions
|
@ -54,7 +54,7 @@ class Event extends Post {
|
|||
* Get a sane default for whether comments are enabled.
|
||||
*/
|
||||
protected function get_comments_enabled() {
|
||||
'open';
|
||||
return comments_open( $this->wp_object );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -94,8 +94,8 @@ class Test_Events_Manager extends WP_UnitTestCase {
|
|||
$this->assertEquals( 'Events Manager Test event', $event_array['name'] );
|
||||
$this->assertEquals( '', $event_array['content'] );
|
||||
$this->assertEquals( gmdate( 'Y-m-d', strtotime( '+10 days 15:00:00' ) ) . 'T15:00:00Z', $event_array['startTime'] );
|
||||
// $this->assertTrue( $event_array['commentsEnabled'] );
|
||||
// $this->assertEquals( 'allow_all', $event_array['repliesModerationOption'] );
|
||||
$this->assertEquals( comments_open( $event->post_id ), $event_array['commentsEnabled'] );
|
||||
$this->assertEquals( comments_open( $event->post_id )? 'allow_all' : 'closed', $event_array['repliesModerationOption'] );
|
||||
$this->assertEquals( 'external', $event_array['joinMode'] );
|
||||
$this->assertArrayNotHasKey( 'location', $event_array );
|
||||
$this->assertEquals( 'MEETING', $event_array['category'] );
|
||||
|
@ -142,8 +142,6 @@ class Test_Events_Manager extends WP_UnitTestCase {
|
|||
$this->assertEquals( 'Events Manager Test event', $event_array['name'] );
|
||||
$this->assertEquals( '', $event_array['content'] );
|
||||
$this->assertEquals( gmdate( 'Y-m-d', strtotime( '+10 days 15:00:00' ) ) . 'T15:00:00Z', $event_array['startTime'] );
|
||||
// $this->assertTrue( $event_array['commentsEnabled'] );
|
||||
// $this->assertEquals( 'allow_all', $event_array['repliesModerationOption'] );
|
||||
$this->assertEquals( 'external', $event_array['joinMode'] );
|
||||
$this->assertEquals( 'MEETING', $event_array['category'] );
|
||||
$this->assertArrayHasKey( 'location', $event_array );
|
||||
|
|
Loading…
Reference in a new issue