<?php
/**
* Test: NetteDIContainer magic properties.
*
* @author David Grudl
* @package NetteDI
* @subpackage UnitTests
*/
use NetteDIContainer;
require __DIR__ . '/../bootstrap.php';
class Service
{
}
$one = new Service;
$two = new Service;
$container = new Container;
$container->one = $one;
$container->addService('two', 'Service');
$container->three = function(){
return new Service;
};
assert::
same( $one,
$container->
one );
assert::
true( $container->
two instanceof Service
);
assert::
same( $container->
two,
$container->
getService('two') );
assert::
true( $container->
three instanceof Closure
);