Nelmio\Alice\FixtureBuilder\ExpressionLanguage\TokenTest::testWithersReturnNewModifiedInstance PHP Method

testWithersReturnNewModifiedInstance() public method

    public function testWithersReturnNewModifiedInstance()
    {
        $value = 'bob';
        $newValue = 'alice';
        $type = new TokenType(TokenType::DYNAMIC_ARRAY_TYPE);
        $token = new Token($value, $type);
        $newToken = $token->withValue($newValue);
        $this->assertEquals($value, $token->getValue());
        $this->assertEquals($type->getValue(), $token->getType());
        $this->assertInstanceOf(Token::class, $newToken);
        $this->assertEquals($newValue, $newToken->getValue());
        $this->assertEquals($type->getValue(), $newToken->getType());
    }