Nelmio\Alice\Definition\MethodCallBagTest::testStackCalls PHP Method

testStackCalls() public method

public testStackCalls ( )
    public function testStackCalls()
    {
        $methodCall1 = new DummyMethodCall('mc1');
        $methodCall2 = new DummyMethodCall('mc1');
        $bag1 = (new MethodCallBag())->with($methodCall1);
        $bag2 = $bag1->with($methodCall2);
        $this->assertSame([$methodCall1], $this->propRefl->getValue($bag1));
        $this->assertSame([$methodCall1, $methodCall2], $this->propRefl->getValue($bag2));
    }