process( $this->get_rule() ); $this->assertEquals( true, $result ); } /** * Tests that the processor passes a publish_before_time rule with a * publish_before time right now. * * @group fast */ public function test_spec_passes_for_time_now() { $mock_date_time_provider = new MockDateTimeProvider( new \DateTime( '2020-04-22 12:00:00' ) ); $processor = new PublishBeforeTimeRuleProcessor( $mock_date_time_provider ); $result = $processor->process( $this->get_rule() ); $this->assertEquals( true, $result ); } /** * Tests that the processor does not pass a publish_before_time rule with a * publish_before time in the past. * * @group fast */ public function test_spec_does_not_pass_for_time_in_the_future() { $mock_date_time_provider = new MockDateTimeProvider( new \DateTime( '2020-04-22 14:00:00' ) ); $processor = new PublishBeforeTimeRuleProcessor( $mock_date_time_provider ); $result = $processor->process( $this->get_rule() ); $this->assertEquals( false, $result ); } }