process( $rule ); $this->assertEquals( true, $result ); } /** * Operand that evaluates to true negated to false. * * @group fast */ public function test_spec_fails_for_passing_operand() { $get_rule_processor = new MockGetRuleProcessor(); $processor = new NotRuleProcessor( new RuleEvaluator( $get_rule_processor ) ); $rule = json_decode( '{ "type": "not", "operand": [ { "type": "publish_after_time", "publish_after": "2020-04-24 09:00:00" } ] }' ); $result = $processor->process( $rule ); $this->assertEquals( false, $result ); } /** * Operand that evaluates to false negated to true. * * @group fast */ public function test_spec_passes_for_failing_operand() { $get_rule_processor = new MockGetRuleProcessor(); $processor = new NotRuleProcessor( new RuleEvaluator( $get_rule_processor ) ); $rule = json_decode( '{ "type": "not", "operand": [ { "type": "publish_after_time", "publish_after": "2020-04-24 11:00:00" } ] }' ); $result = $processor->process( $rule ); $this->assertEquals( true, $result ); } }