[ SYSTEM ]: Linux wordpress 6.1.0-41-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.158-1 (2025-11-09) x86_64
[ SERVER ]: Apache/2.4.66 (Debian) | PHP: 8.2.30
[ USER ]: www-data | IP: 172.19.30.54
GEFORCE FILE MANAGER
/
var
/
www
/
html
/
wordpress
/
wp-content
/
plugins
/
presto-player
/
vendor
/
level-2
/
dice
/
tests
/
UPLOAD:
NAME
SIZE
QUICK PERMS
ACTIONS
📁 TestData
SET
[ DEL ]
📄 CallTest.php
2,584 B
SET
[ EDIT ]
|
[ DEL ]
📄 ChainTest.php
2,558 B
SET
[ EDIT ]
|
[ DEL ]
📄 ConstructParamsTest.php
3,932 B
SET
[ EDIT ]
|
[ DEL ]
📄 CreateArgsTest.php
2,858 B
SET
[ EDIT ]
|
[ DEL ]
📄 DiceTest.php
1,224 B
SET
[ EDIT ]
|
[ DEL ]
📄 NamedInstancesTest.php
3,624 B
SET
[ EDIT ]
|
[ DEL ]
📄 NamespaceTest.php
2,039 B
SET
[ EDIT ]
|
[ DEL ]
📄 ShareInstancesTest.php
3,755 B
SET
[ EDIT ]
|
[ DEL ]
📄 SubstitutionsTest.php
2,966 B
SET
[ EDIT ]
|
[ DEL ]
📄 bootstrap.php
344 B
SET
[ EDIT ]
|
[ DEL ]
DELETE SELECTED
[ CLOSE ]
EDIT: NamespaceTest.php
<?php /* @description Dice - A minimal Dependency Injection Container for PHP * * @author Tom Butler tom@r.je * * @copyright 2012-2018 Tom Butler <tom@r.je> | https:// r.je/dice.html * * @license http:// www.opensource.org/licenses/bsd-license.php BSD License * * @version 3.0 */ class NamespaceTest extends DiceTest { public function testNamespaceBasic() { $a = $this->dice->create('Foo\\A'); $this->assertInstanceOf('Foo\\A', $a); } public function testNamespaceWithSlash() { $a = $this->dice->create('\\Foo\\A'); $this->assertInstanceOf('\\Foo\\A', $a); } public function testNamespaceWithSlashrule() { $rule = []; $rule['substitutions']['Foo\\A'] = [\Dice\Dice::INSTANCE => 'Foo\\ExtendedA']; $dice = $this->dice->addRule('\\Foo\\B', $rule); $b = $dice->create('\\Foo\\B'); $this->assertInstanceOf('Foo\\ExtendedA', $b->a); } public function testNamespaceWithSlashruleInstance() { $rule = []; $rule['substitutions']['Foo\\A'] = [\Dice\Dice::INSTANCE => 'Foo\\ExtendedA']; $dice = $this->dice->addRule('\\Foo\\B', $rule); $b = $dice->create('\\Foo\\B'); $this->assertInstanceOf('Foo\\ExtendedA', $b->a); } public function testNamespaceTypeHint() { $rule = []; $rule['shared'] = true; $dice = $this->dice->addRule('Bar\\A', $rule); $c = $dice->create('Foo\\C'); $this->assertInstanceOf('Bar\\A', $c->a); $c2 = $dice->create('Foo\\C'); $this->assertNotSame($c, $c2); //Check the rule has been correctly recognised for type hinted classes in a different namespace PrestoPlayer\$this->assertSame($c2->a, $c->a); } public function testNamespaceInjection() { $b = $this->dice->create('Foo\\B'); $this->assertInstanceOf('Foo\\B', $b); $this->assertInstanceOf('Foo\\A', $b->a); } public function testNamespaceRuleSubstitution() { $rule = []; $rule['substitutions']['Foo\\A'] = [\Dice\Dice::INSTANCE => 'Foo\\ExtendedA']; $dice = $this->dice->addRule('Foo\\B', $rule); $b = $dice->create('Foo\\B'); $this->assertInstanceOf('Foo\\ExtendedA', $b->a); } }