/** * @test */ public function itShouldReturnAnInvalidCallbackExceptionIfFailCallbackIsProvidedAndIsNotCallable() { $this->setExpectedException('subzeta\\Ruling\\Exception\\InvalidCallbackException', 'Fail callback must be callable.'); $this->ruling->given(['heyyo' => true])->when('2 > 3')->then(function () { return null; })->otherwise('morcilla')->execute(); }
/** * @dataProvider getData * @param array $context * @param string|string[] $rules * @param bool $expectation * @test */ public function itShouldReturnTheExpectedCallback($context, $rules, $expectation) { $this->assertSame($expectation, $this->ruling->given($context)->when($rules)->execute()); }