-
-
Notifications
You must be signed in to change notification settings - Fork 188
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
109 additions
and
13 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
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
25 changes: 25 additions & 0 deletions
25
tests/language-feature-scripts/lazy-loading-ghost-allows-inexisting-magic-property-read.phpt
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,25 @@ | ||
--TEST-- | ||
Verifies that generated lazy loading ghost objects disallow reading non-existing properties via direct read | ||
--FILE-- | ||
<?php | ||
|
||
require_once __DIR__ . '/init.php'; | ||
|
||
class Kitchen | ||
{ | ||
private $sweets; | ||
|
||
public function & __get($name) | ||
{ | ||
return $name; | ||
} | ||
} | ||
|
||
$factory = new \ProxyManager\Factory\LazyLoadingGhostFactory($configuration); | ||
|
||
$proxy = $factory->createProxy('Kitchen', function () {}); | ||
|
||
echo $proxy->nonExisting; | ||
?> | ||
--EXPECTF-- | ||
nonExisting |
21 changes: 21 additions & 0 deletions
21
tests/language-feature-scripts/lazy-loading-ghost-allows-inexisting-property-write.phpt
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,21 @@ | ||
--TEST-- | ||
Verifies that generated lazy loading ghost objects disallow reading non-existing properties via direct read | ||
--FILE-- | ||
<?php | ||
|
||
require_once __DIR__ . '/init.php'; | ||
|
||
class Kitchen | ||
{ | ||
private $sweets; | ||
} | ||
|
||
$factory = new \ProxyManager\Factory\LazyLoadingGhostFactory($configuration); | ||
|
||
$proxy = $factory->createProxy('Kitchen', function () {}); | ||
|
||
$proxy->nonExisting = 'I do not exist'; | ||
echo $proxy->nonExisting; | ||
?> | ||
--EXPECTF-- | ||
I do not exist |
20 changes: 20 additions & 0 deletions
20
tests/language-feature-scripts/lazy-loading-ghost-denies-inexisting-property-read.phpt
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,20 @@ | ||
--TEST-- | ||
Verifies that generated lazy loading ghost objects disallow reading non-existing properties via direct read | ||
--FILE-- | ||
<?php | ||
|
||
require_once __DIR__ . '/init.php'; | ||
|
||
class Kitchen | ||
{ | ||
private $sweets; | ||
} | ||
|
||
$factory = new \ProxyManager\Factory\LazyLoadingGhostFactory($configuration); | ||
|
||
$proxy = $factory->createProxy('Kitchen', function () {}); | ||
|
||
$proxy->nonExisting; | ||
?> | ||
--EXPECTF-- | ||
Notice: Undefined property: Kitchen::$nonExisting in %s on line %d |