lithium\tests\cases\test\MockerChainTest::testMethodWithParamsCalledBefore PHP Method

testMethodWithParamsCalledBefore() public method

    public function testMethodWithParamsCalledBefore()
    {
        $mock = new \lithium\tests\mocks\test\mockStdClass\Mock();
        $mock->method1('foo');
        $mock->method2('bar');
        $mock->method1('baz');
        $chain = Mocker::chain($mock);
        $this->assertTrue($chain->called('method1')->called('method2')->with('bar')->called('method1')->success());
        $this->assertFalse($chain->called('method1')->with('bar')->called('method2')->with('bar')->called('method1')->success());
        $this->assertFalse($chain->called('method1')->called('method2')->with('bar')->called('method1')->with('bar')->success());
    }