TestContainer
class TestContainer extends Container
Properties
protected | $parameterBag | from Container | |
protected | $services | from Container | |
protected | $privates | from Container | |
protected | $fileMap | from Container | |
protected | $methodMap | from Container | |
protected | $factories | from Container | |
protected | $aliases | from Container | |
protected | $loading | from Container | |
protected | $resolving | from Container | |
protected | $syntheticIds | from Container |
Methods
Compiles the container.
Returns true if the container is compiled.
Gets the service container parameter bag.
Gets a parameter.
Checks if a parameter exists.
Sets a parameter.
Sets a service.
Returns true if the given service is defined.
Gets a service.
Returns true if the given service has actually been initialized.
Resets shared services from the container.
Gets all service ids.
Gets service ids that existed at compile time.
Details
compile()
Compiles the container.
This method does two things:
- Parameter values are resolved;
- The parameter bag is frozen.
set(string $id, object $service)
Sets a service.
Setting a service to null resets the service: has() returns false and get() behaves in the same way as if the service was never created.
reset()
Resets shared services from the container.
The container is not intended to be used again after being reset in a normal workflow. This method is meant as a way to release references for ref-counting. A subsequent call to ContainerInterface::get will recreate a new instance of the shared service.