1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2025-03-29 04:28:11 +01:00
phorge-arcanist/src/parser/xhpast/__tests__/data/php-access-on-instanciation.test
epriestley a689dee228 Update XHPAST "expect" test blocks to the new stable, human-readable format
Summary:
Depends on D21065. Ref T13492. Swap existing "expect" blocks from unstable, unreadable JSON to readable, stable trees.

(There are two "INVALID TYPE" outputs which this update effectively detects and which future changes correct.)

Test Plan: Ran "arc unit --everything", got a clean build.

Maniphest Tasks: T13492

Differential Revision: https://secure.phabricator.com/D21066
2020-04-07 14:32:48 -07:00

145 lines
2.1 KiB
Text

<?php
class a {
public $b;
public function c() { }
}
$d = (new a)->b;
$e = (new a)->c();
(new a)->b;
(new a)->c();
~~~~~~~~~~
pass
~~~~~~~~~~
* n_PROGRAM
* n_STATEMENT_LIST
* n_OPEN_TAG
> <?php
> "\n\n"
* n_STATEMENT
* n_CLASS_DECLARATION
* n_CLASS_ATTRIBUTES
> class
> " "
* n_CLASS_NAME
> a
* n_EMPTY
* n_EMPTY
* n_STATEMENT_LIST
> {
> "\n "
* n_STATEMENT
* n_CLASS_MEMBER_DECLARATION_LIST
* n_CLASS_MEMBER_MODIFIER_LIST
* n_STRING
> public
> " "
* n_CLASS_MEMBER_DECLARATION
* n_VARIABLE
> $b
* n_EMPTY
> ;
> "\n\n "
* n_STATEMENT
* n_METHOD_DECLARATION
* n_METHOD_MODIFIER_LIST
* n_STRING
> public
* n_EMPTY
* n_STRING
> c
* n_DECLARATION_PARAMETER_LIST
> (
> )
* n_EMPTY
* n_EMPTY
* n_STATEMENT_LIST
> {
> " "
> }
> "\n"
> }
> "\n\n"
* n_STATEMENT
* n_BINARY_EXPRESSION
* n_VARIABLE
> $d
> " "
* n_OPERATOR
> =
> " "
* n_OBJECT_PROPERTY_ACCESS
* n_NEW
> (
> new
> " "
* n_CLASS_NAME
> a
* n_EMPTY
> ->
* n_STRING
> b
> ;
> "\n\n"
* n_STATEMENT
* n_BINARY_EXPRESSION
* n_VARIABLE
> $e
> " "
* n_OPERATOR
> =
> " "
* n_METHOD_CALL
* n_OBJECT_PROPERTY_ACCESS
* n_NEW
> (
> new
> " "
* n_CLASS_NAME
> a
* n_EMPTY
> ->
* n_STRING
> c
* n_CALL_PARAMETER_LIST
> (
> )
> ;
> "\n\n"
* n_STATEMENT
* n_OBJECT_PROPERTY_ACCESS
* n_NEW
> (
> new
> " "
* n_CLASS_NAME
> a
* n_EMPTY
> ->
* n_STRING
> b
> ;
> "\n\n"
* n_STATEMENT
* n_METHOD_CALL
* n_OBJECT_PROPERTY_ACCESS
* n_NEW
> (
> new
> " "
* n_CLASS_NAME
> a
* n_EMPTY
> ->
* n_STRING
> c
* n_CALL_PARAMETER_LIST
> (
> )
> ;
> "\n"