"bar"])); $config = new Config($tmp); $this->assertSame("bar", $config->get("foo")); } public function testThrowsOnMissingFile() { $this->expectException(RuntimeException::class); new Config("/nonexistent/file.json"); } public function testThrowsOnInvalidJson() { $tmp = tempnam(sys_get_temp_dir(), 'cfg_'); file_put_contents($tmp, "{invalid json"); $this->expectException(RuntimeException::class); new Config($tmp); } }