Skip to content

Commit

Permalink
Add tests for PHP-extras
Browse files Browse the repository at this point in the history
  • Loading branch information
Golmote committed Aug 30, 2015
1 parent 8e5eabf commit 781fdad
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 0 deletions.
37 changes: 37 additions & 0 deletions tests/languages/php!+php-extras/global_feature.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
$GLOBALS
$_SERVER
$_GET
$_POST
$_FILES
$_REQUEST
$_SESSION
$_ENV
$_COOKIE
$php_errormsg
$HTTP_RAW_POST_DATA
$http_response_header
$argc
$argv

----------------------------------------------------

[
["global", "$GLOBALS"],
["global", "$_SERVER"],
["global", "$_GET"],
["global", "$_POST"],
["global", "$_FILES"],
["global", "$_REQUEST"],
["global", "$_SESSION"],
["global", "$_ENV"],
["global", "$_COOKIE"],
["global", "$php_errormsg"],
["global", "$HTTP_RAW_POST_DATA"],
["global", "$http_response_header"],
["global", "$argc"],
["global", "$argv"]
]

----------------------------------------------------

Checks for superglobals.
27 changes: 27 additions & 0 deletions tests/languages/php!+php-extras/scope_feature.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
static::foo()
self::bar()
parent::baz()

----------------------------------------------------

[
["scope", [
["keyword", "static"],
["punctuation", "::"]
]],
["function", "foo"], ["punctuation", "("], ["punctuation", ")"],
["scope", [
["keyword", "self"],
["punctuation", "::"]
]],
["function", "bar"], ["punctuation", "("], ["punctuation", ")"],
["scope", [
["keyword", "parent"],
["punctuation", "::"]
]],
["function", "baz"], ["punctuation", "("], ["punctuation", ")"]
]

----------------------------------------------------

Checks for scopes.
11 changes: 11 additions & 0 deletions tests/languages/php!+php-extras/this_feature.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
$this

----------------------------------------------------

[
["this", "$this"]
]

----------------------------------------------------

Checks for $this.

0 comments on commit 781fdad

Please sign in to comment.