getDefinitions(); $parameters = $package->getParameters(); $this->definitions = $definitions + $parameters + [ ContainerInterface::class => $this, 'michel.project_dir' => __DIR__, 'session.save_path' => 'var/session', ]; } public function get(string $id) { if (!$this->has($id)) { throw new RuntimeException('Unknown definition: ' . $id); } if (isset($this->values[$id])) { return $this->values[$id]; } $value = $this->definitions[$id]; if (is_callable($value)) { $value = $value($this); } $this->values[$id] = $value; return $value; } public function has(string $id): bool { return isset($this->definitions[$id]); } }; $sessionStorage = $container->get(SessionStorageInterface::class); $this->assertInstanceOf(NativeSessionStorage::class, $sessionStorage); $sessionStorage->put('username', 'myName'); $this->assertTrue($sessionStorage->has('username')); $this->assertTrue(!empty(glob( __DIR__ . '/var/session/*'))); } }