[ SYSTEM ]: Linux wordpress 6.1.0-44-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.164-1 (2026-03-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 ]
📄 BasicTest.php
5,916 B
SET
[ EDIT ]
|
[ 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: CallTest.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 CallTest extends DiceTest { public function testCall() { $rule = []; $rule['call'][] = array('callMe', array()); $dice = $this->dice->addRule('TestCall', $rule); $object = $dice->create('TestCall'); $this->assertTrue($object->isCalled); } public function testCallWithParameters() { $rule = []; $rule['call'][] = array('callMe', array('one', 'two')); $dice = $this->dice->addRule('TestCall2', $rule); $object = $dice->create('TestCall2'); $this->assertEquals('one', $object->foo); $this->assertEquals('two', $object->bar); } public function testCallWithInstance() { $rule = []; $rule['call'][] = array('callMe', array([\Dice\Dice::INSTANCE => 'A'])); $dice = $this->dice->addRule('TestCall3', $rule); $object = $dice->create('TestCall3'); $this->assertInstanceOf('a', $object->a); } public function testCallAutoWireInstance() { $rule = []; $rule['call'][] = array('callMe', []); $dice = $this->dice->addRule('TestCall3', $rule); $object = $dice->create('TestCall3'); $this->assertInstanceOf('a', $object->a); } public function testCallReturnValue() { $rule = []; $returnValue = null; $rule['call'][] = array('callMe', [], function($return) use (&$returnValue) { $returnValue = $return; }); $dice = $this->dice->addRule('TestCall3', $rule); $object = $dice->create('TestCall3'); $this->assertInstanceOf('a', $object->a); $this->assertEquals('callMe called', $returnValue); } public function testCallChain() { $rules = [ 'TestCallImmutable' => [ 'call' => [ ['call1', ['foo'], \Dice\Dice::CHAIN_CALL], ['call2', ['bar'], \Dice\Dice::CHAIN_CALL] ] ] ]; $dice = $this->dice->addRules($rules); $object = $dice->create('TestCallImmutable'); $this->assertEquals('foo', $object->a); $this->assertEquals('bar', $object->b); } public function testCallShareVariadic() { // Shared params should not be passed to variadic call $rules = [ 'TestCallVariadic' => [ 'call' => [ ['callMe', ['test1']] ] ] ]; $dice = $this->dice->addRules($rules); $object = $dice->create('TestCallVariadic', [], [new F()]); $this->assertEquals(['test1'], $object->data); } }