public function testRewriteInvalidPropertyAsGetter()
 {
     /** @var \Pharborist\Objects\ObjectPropertyNode $expr */
     $expr = Parser::parseExpression('$node->baz');
     $rewritten = $this->plugin->rewriteAsGetter($expr, 'baz');
     $this->assertNull($rewritten);
 }
 public function testRewriteArbitraryKeyAsGetter()
 {
     $expr = Parser::parseExpression('$form_state["foo"]["baz"]');
     $rewritten = $this->plugin->rewriteAsGetter($expr, 'foo');
     $this->assertInstanceOf('\\Pharborist\\Objects\\ObjectMethodCallNode', $rewritten);
     $this->assertEquals('$form_state->get(["foo", "baz"])', $rewritten->getText());
 }