/** * StubContainer constructor * * @param Container $parent */ function __construct(Container $parent = null) { parent::__construct($parent); // Add fake root $instance and children self::$instance = new \ArrayObject(); self::$children['foo'] = new \ArrayObject(); }