getConfig() */ public function testGetConfig() { $containerConfig = new ContainerConfig(Config::get('container_path')); $config = $containerConfig->getConfig('default', 'gadgets.features'); $this->assertArrayHasKey('core.io', $config); $this->assertArrayHasKey('views', $config); $this->assertArrayHasKey('rpc', $config); $this->assertArrayHasKey('skins', $config); $this->assertArrayHasKey('opensocial', $config); $this->assertArrayHasKey('path', $config['opensocial']); } /** * Tests ContainerConfig::removeComments() */ public function testRemoveComments() { $jsFile = <<removeComments($jsFile); $jsonObj = json_decode($uncommented, true); $this->assertNotEquals($uncommented, $jsonObj); $this->assertEquals(array("default"), $jsonObj["gadgets.container"]); $this->assertEquals(null, $jsonObj["gadgets.parent"]); $this->assertEquals("-a.example.com:8080", $jsonObj["gadgets.uri.iframe.lockedDomainSuffix"]); $this->assertEquals("/gadgets/ifr", $jsonObj["gadgets.iframeBaseUri"]); $this->assertEquals("//%host%/gadgets/oauthcallback", $jsonObj["gadgets.uri.oauth.callbackTemplate"]); } }