-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
324 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--TEST-- | ||
namespace detection 01 | ||
--EXTENSIONS-- | ||
vyrtue | ||
--ENV-- | ||
PHP_VYRTUE_DEBUG_DUMP_NAMESPACE=1 | ||
PHP_VYRTUE_DEBUG_DUMP_USE=1 | ||
--SKIPIF-- | ||
<?php if (!VyrtueExt\DEBUG) die("Skipped: vyrtue not debug build"); ?> | ||
--FILE-- | ||
<?php | ||
namespace FooBar; | ||
use function Foo\bar; | ||
use function Foo\bat as booyah; | ||
--EXPECT-- | ||
VYRTUE_NAMESPACE: ENTER: FooBar | ||
VYRTUE_USE: Foo\bar => bar | ||
VYRTUE_USE: Foo\bat => booyah | ||
VYRTUE_NAMESPACE: LEFT: FooBar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
--TEST-- | ||
namespace detection 02 | ||
--EXTENSIONS-- | ||
vyrtue | ||
--ENV-- | ||
PHP_VYRTUE_DEBUG_DUMP_NAMESPACE=1 | ||
PHP_VYRTUE_DEBUG_DUMP_USE=1 | ||
--SKIPIF-- | ||
<?php if (!VyrtueExt\DEBUG) die("Skipped: vyrtue not debug build"); ?> | ||
--FILE-- | ||
<?php | ||
// from https://www.php.net/manual/en/language.namespaces.importing.php | ||
namespace foo; | ||
use My\Full\Classname as Another; | ||
|
||
// this is the same as use My\Full\NSname as NSname | ||
use My\Full\NSname; | ||
|
||
// importing a global class | ||
use ArrayObject; | ||
|
||
// importing a function | ||
use function My\Full\functionName; | ||
|
||
// aliasing a function | ||
use function My\Full\functionName as func; | ||
|
||
// importing a constant | ||
use const My\Full\CONSTANT; | ||
--EXPECT-- | ||
VYRTUE_NAMESPACE: ENTER: foo | ||
VYRTUE_USE: My\Full\Classname => Another | ||
VYRTUE_USE: My\Full\NSname => NSname | ||
VYRTUE_USE: ArrayObject => ArrayObject | ||
VYRTUE_USE: My\Full\functionName => functionName | ||
VYRTUE_USE: My\Full\functionName => func | ||
VYRTUE_USE: My\Full\CONSTANT => CONSTANT | ||
VYRTUE_NAMESPACE: LEFT: foo |
Oops, something went wrong.