/** * @test * it should allow setting up conditional calls to the original static method */ public function it_should_allow_setting_up_conditional_calls_to_the_original_static_method() { FunctionMocker::replace(__NAMESPACE__ . '\\PassingClass::passingStaticMethodWithArgs', function ($one, $two) { if ($one === 'some') { return 'test'; } return FunctionMocker::callOriginal([$one, $two]); }); $this->assertEquals('foo and baz', PassingClass::passingStaticMethodWithArgs('foo', 'baz')); $this->assertEquals('test', PassingClass::passingStaticMethodWithArgs('some', 'baz')); }