forked from GNUsocial/gnu-social
[COMPOSER] Add new php-ffmpeg package
This commit is contained in:
152
vendor/nikic/php-parser/test/code/parser/stmt/namespace/alias.test
vendored
Normal file
152
vendor/nikic/php-parser/test/code/parser/stmt/namespace/alias.test
vendored
Normal file
@@ -0,0 +1,152 @@
|
||||
Aliases (use)
|
||||
-----
|
||||
<?php
|
||||
|
||||
use A\B;
|
||||
use C\D as E;
|
||||
use F\G as H, J;
|
||||
|
||||
// evil alias notation - Do Not Use!
|
||||
use \A;
|
||||
use \A as B;
|
||||
|
||||
// function and constant aliases
|
||||
use function foo\bar;
|
||||
use function foo\bar as baz;
|
||||
use const foo\BAR;
|
||||
use const foo\BAR as BAZ;
|
||||
-----
|
||||
array(
|
||||
0: Stmt_Use(
|
||||
type: 1
|
||||
uses: array(
|
||||
0: Stmt_UseUse(
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: A
|
||||
1: B
|
||||
)
|
||||
)
|
||||
alias: B
|
||||
)
|
||||
)
|
||||
)
|
||||
1: Stmt_Use(
|
||||
type: 1
|
||||
uses: array(
|
||||
0: Stmt_UseUse(
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: C
|
||||
1: D
|
||||
)
|
||||
)
|
||||
alias: E
|
||||
)
|
||||
)
|
||||
)
|
||||
2: Stmt_Use(
|
||||
type: 1
|
||||
uses: array(
|
||||
0: Stmt_UseUse(
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: F
|
||||
1: G
|
||||
)
|
||||
)
|
||||
alias: H
|
||||
)
|
||||
1: Stmt_UseUse(
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: J
|
||||
)
|
||||
)
|
||||
alias: J
|
||||
)
|
||||
)
|
||||
)
|
||||
3: Stmt_Use(
|
||||
type: 1
|
||||
uses: array(
|
||||
0: Stmt_UseUse(
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: A
|
||||
)
|
||||
)
|
||||
alias: A
|
||||
)
|
||||
)
|
||||
)
|
||||
4: Stmt_Use(
|
||||
type: 1
|
||||
uses: array(
|
||||
0: Stmt_UseUse(
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: A
|
||||
)
|
||||
)
|
||||
alias: B
|
||||
)
|
||||
)
|
||||
)
|
||||
5: Stmt_Use(
|
||||
type: 2
|
||||
uses: array(
|
||||
0: Stmt_UseUse(
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: foo
|
||||
1: bar
|
||||
)
|
||||
)
|
||||
alias: bar
|
||||
)
|
||||
)
|
||||
)
|
||||
6: Stmt_Use(
|
||||
type: 2
|
||||
uses: array(
|
||||
0: Stmt_UseUse(
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: foo
|
||||
1: bar
|
||||
)
|
||||
)
|
||||
alias: baz
|
||||
)
|
||||
)
|
||||
)
|
||||
7: Stmt_Use(
|
||||
type: 3
|
||||
uses: array(
|
||||
0: Stmt_UseUse(
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: foo
|
||||
1: BAR
|
||||
)
|
||||
)
|
||||
alias: BAR
|
||||
)
|
||||
)
|
||||
)
|
||||
8: Stmt_Use(
|
||||
type: 3
|
||||
uses: array(
|
||||
0: Stmt_UseUse(
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: foo
|
||||
1: BAR
|
||||
)
|
||||
)
|
||||
alias: BAZ
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
42
vendor/nikic/php-parser/test/code/parser/stmt/namespace/braced.test
vendored
Normal file
42
vendor/nikic/php-parser/test/code/parser/stmt/namespace/braced.test
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
Braced namespaces
|
||||
-----
|
||||
<?php
|
||||
|
||||
namespace Foo\Bar {
|
||||
foo;
|
||||
}
|
||||
namespace {
|
||||
bar;
|
||||
}
|
||||
-----
|
||||
array(
|
||||
0: Stmt_Namespace(
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: Foo
|
||||
1: Bar
|
||||
)
|
||||
)
|
||||
stmts: array(
|
||||
0: Expr_ConstFetch(
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: foo
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
1: Stmt_Namespace(
|
||||
name: null
|
||||
stmts: array(
|
||||
0: Expr_ConstFetch(
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: bar
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
29
vendor/nikic/php-parser/test/code/parser/stmt/namespace/invalidName.test
vendored
Normal file
29
vendor/nikic/php-parser/test/code/parser/stmt/namespace/invalidName.test
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
Invalid namespace names
|
||||
-----
|
||||
<?php namespace self;
|
||||
-----
|
||||
Cannot use 'self' as namespace name from 1:17 to 1:20
|
||||
-----
|
||||
<?php namespace PARENT;
|
||||
-----
|
||||
Cannot use 'PARENT' as namespace name from 1:17 to 1:22
|
||||
-----
|
||||
<?php namespace static;
|
||||
-----
|
||||
Syntax error, unexpected T_STATIC, expecting T_STRING or T_NS_SEPARATOR or '{' from 1:17 to 1:22
|
||||
array(
|
||||
)
|
||||
-----
|
||||
<?php use A as self;
|
||||
-----
|
||||
Cannot use A as self because 'self' is a special class name on line 1
|
||||
-----
|
||||
<?php use B as PARENT;
|
||||
-----
|
||||
Cannot use B as PARENT because 'PARENT' is a special class name on line 1
|
||||
-----
|
||||
<?php use C as static;
|
||||
-----
|
||||
Syntax error, unexpected T_STATIC, expecting T_STRING from 1:16 to 1:21
|
||||
array(
|
||||
)
|
13
vendor/nikic/php-parser/test/code/parser/stmt/namespace/mix.test
vendored
Normal file
13
vendor/nikic/php-parser/test/code/parser/stmt/namespace/mix.test
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
Namespace types cannot be mixed
|
||||
-----
|
||||
<?php
|
||||
namespace A;
|
||||
namespace B {}
|
||||
-----
|
||||
Cannot mix bracketed namespace declarations with unbracketed namespace declarations on line 3
|
||||
-----
|
||||
<?php
|
||||
namespace A {}
|
||||
namespace B;
|
||||
-----
|
||||
Cannot mix bracketed namespace declarations with unbracketed namespace declarations on line 3
|
42
vendor/nikic/php-parser/test/code/parser/stmt/namespace/name.test
vendored
Normal file
42
vendor/nikic/php-parser/test/code/parser/stmt/namespace/name.test
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
Different name types
|
||||
-----
|
||||
<?php
|
||||
|
||||
A;
|
||||
A\B;
|
||||
\A\B;
|
||||
namespace\A\B;
|
||||
-----
|
||||
array(
|
||||
0: Expr_ConstFetch(
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: A
|
||||
)
|
||||
)
|
||||
)
|
||||
1: Expr_ConstFetch(
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: A
|
||||
1: B
|
||||
)
|
||||
)
|
||||
)
|
||||
2: Expr_ConstFetch(
|
||||
name: Name_FullyQualified(
|
||||
parts: array(
|
||||
0: A
|
||||
1: B
|
||||
)
|
||||
)
|
||||
)
|
||||
3: Expr_ConstFetch(
|
||||
name: Name_Relative(
|
||||
parts: array(
|
||||
0: A
|
||||
1: B
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
10
vendor/nikic/php-parser/test/code/parser/stmt/namespace/nested.test
vendored
Normal file
10
vendor/nikic/php-parser/test/code/parser/stmt/namespace/nested.test
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
Nested namespaces are not allowed
|
||||
-----
|
||||
<?php
|
||||
namespace A {
|
||||
namespace B {
|
||||
|
||||
}
|
||||
}
|
||||
-----
|
||||
Namespace declarations cannot be nested from 3:5 to 5:5
|
45
vendor/nikic/php-parser/test/code/parser/stmt/namespace/notBraced.test
vendored
Normal file
45
vendor/nikic/php-parser/test/code/parser/stmt/namespace/notBraced.test
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
Semicolon style namespaces
|
||||
-----
|
||||
<?php
|
||||
|
||||
namespace Foo\Bar;
|
||||
foo;
|
||||
|
||||
namespace Bar;
|
||||
bar;
|
||||
-----
|
||||
array(
|
||||
0: Stmt_Namespace(
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: Foo
|
||||
1: Bar
|
||||
)
|
||||
)
|
||||
stmts: array(
|
||||
0: Expr_ConstFetch(
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: foo
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
1: Stmt_Namespace(
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: Bar
|
||||
)
|
||||
)
|
||||
stmts: array(
|
||||
0: Expr_ConstFetch(
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: bar
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
37
vendor/nikic/php-parser/test/code/parser/stmt/namespace/outsideStmt.test
vendored
Normal file
37
vendor/nikic/php-parser/test/code/parser/stmt/namespace/outsideStmt.test
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
Some statements may occur outside of namespaces
|
||||
-----
|
||||
<?php
|
||||
declare(A='B');
|
||||
namespace B {
|
||||
|
||||
}
|
||||
__halt_compiler()
|
||||
?>
|
||||
Hi!
|
||||
-----
|
||||
array(
|
||||
0: Stmt_Declare(
|
||||
declares: array(
|
||||
0: Stmt_DeclareDeclare(
|
||||
key: A
|
||||
value: Scalar_String(
|
||||
value: B
|
||||
)
|
||||
)
|
||||
)
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
1: Stmt_Namespace(
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: B
|
||||
)
|
||||
)
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
2: Stmt_HaltCompiler(
|
||||
remaining: Hi!
|
||||
)
|
||||
)
|
20
vendor/nikic/php-parser/test/code/parser/stmt/namespace/outsideStmtInvalid.test
vendored
Normal file
20
vendor/nikic/php-parser/test/code/parser/stmt/namespace/outsideStmtInvalid.test
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
There (mostly) can't be statements outside of namespaces
|
||||
-----
|
||||
<?php
|
||||
echo 1;
|
||||
namespace A;
|
||||
-----
|
||||
Namespace declaration statement has to be the very first statement in the script on line 3
|
||||
-----
|
||||
<?php
|
||||
namespace A {}
|
||||
echo 1;
|
||||
-----
|
||||
No code may exist outside of namespace {} on line 3
|
||||
-----
|
||||
<?php
|
||||
namespace A {}
|
||||
declare(ticks=1);
|
||||
namespace B {}
|
||||
-----
|
||||
No code may exist outside of namespace {} on line 3
|
Reference in New Issue
Block a user