ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
ILIAS\Component\Dependencies\Mocks Namespace Reference

Data Structures

class  AbstractLightMockBuilder
 
class  EvalLightMockBuilder
 
class  GeneratedMockRegistry
 Bookkeeping about the mock classes that have been generated into the running process. More...
 
interface  MockBuilder
 
class  PHPUnitMockBuilder
 

Functions

 __mockSetReturnValue (string $method, mixed $value)
 
 __mockSetCallback (string $method, callable $callback)
 
 __mockInvoke (string $method, array $args)
 

Variables

trait MockObjectBehavior
 
array $__mock_configured_callbacks = []
 

Function Documentation

◆ __mockInvoke()

ILIAS\Component\Dependencies\Mocks\__mockInvoke ( string  $method,
array  $args 
)
protected
Parameters
list<mixed>$args

Definition at line 46 of file MockObjectBehavior.php.

46 : mixed
47 {
48 if (isset($this->__mock_configured_callbacks[$method])) {
49 return ($this->__mock_configured_callbacks[$method])(...$args);
50 }
51
52 if (array_key_exists($method, $this->__mock_configured_returns)) {
53 return $this->__mock_configured_returns[$method];
54 }
55
56 return GeneratedMockRegistry::defaultValueFor($this, $method);
57 }

References ILIAS\Component\Dependencies\Mocks\GeneratedMockRegistry\defaultValueFor().

+ Here is the call graph for this function:

◆ __mockSetCallback()

ILIAS\Component\Dependencies\Mocks\__mockSetCallback ( string  $method,
callable  $callback 
)

Definition at line 37 of file MockObjectBehavior.php.

37 : static
38 {
39 $this->__mock_configured_callbacks[$method] = $callback(...);
40 return $this;
41 }

◆ __mockSetReturnValue()

ILIAS\Component\Dependencies\Mocks\__mockSetReturnValue ( string  $method,
mixed  $value 
)

Definition at line 31 of file MockObjectBehavior.php.

31 : static
32 {
33 $this->__mock_configured_returns[$method] = $value;
34 return $this;
35 }

Variable Documentation

◆ $__mock_configured_callbacks

array ILIAS::Component::Dependencies::Mocks\$__mock_configured_callbacks = []
private

Definition at line 29 of file MockObjectBehavior.php.

◆ MockObjectBehavior

trait ILIAS::Component::Dependencies::Mocks\MockObjectBehavior
Initial value:
{
private array $__mock_configured_returns = []

Definition at line 23 of file MockObjectBehavior.php.

Referenced by ILIAS\Component\Dependencies\Mocks\AbstractLightMockBuilder\generate().