mirror of
https://github.com/danog/parser.git
synced 2024-11-27 04:14:55 +01:00
parser: test variable variable method calls
This commit is contained in:
parent
63aa82a1cd
commit
ac97dbf2fa
@ -4259,6 +4259,20 @@ mod tests {
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn variable_variable_method_calls() {
|
||||
assert_ast(
|
||||
"<?php $a->$$b;",
|
||||
&[expr!(Expression::MethodCall {
|
||||
target: Box::new(Expression::Variable { name: "a".into() }),
|
||||
method: Box::new(Expression::DynamicVariable {
|
||||
name: Box::new(Expression::Variable { name: "b".into() })
|
||||
}),
|
||||
args: vec![]
|
||||
})],
|
||||
);
|
||||
}
|
||||
|
||||
fn assert_ast(source: &str, expected: &[Statement]) {
|
||||
let mut lexer = Lexer::new(None);
|
||||
let tokens = lexer.tokenize(source).unwrap();
|
||||
|
Loading…
Reference in New Issue
Block a user