Nelmio\Alice\Definition\Value\FunctionCallValueTest::testIsImmutable PHP Method

testIsImmutable() public method

public testIsImmutable ( )
    public function testIsImmutable()
    {
        $arguments = [$arg0 = new \stdClass()];
        $value = new FunctionCallValue('setUsername', $arguments);
        // Mutate injected value
        $arg0->foo = 'bar';
        // Mutate returned value
        $value->getArguments()[0]->foo = 'baz';
        $this->assertEquals([new \stdClass()], $value->getArguments());
        $this->assertEquals(['setUsername', [new \stdClass()]], $value->getValue());
    }