/** * @covers WindowsAzure\Common\Configuration::getProperties */ public function testGetProperties() { $config = new Configuration(); $config->setProperty(TestResources::KEY1, TestResources::VALUE1); $config->setProperty(TestResources::KEY2, TestResources::VALUE2); $this->assertTrue(is_array($config->getProperties())); $this->assertEquals(2, count($config->getProperties())); }
/** * Validates that the given config setting exists in the $config and it's value * is doesn't satisfy empty(). * * @param string $setting The config setting name. * @param WindowsAzure\Common\Configuration $config The configuration object. * @param string $name The setting code name. * @param string $restType The REST type name. * * @return none */ private function _validateConfigSetting($setting, $config, $name, $restType) { $missingKeyMsg = sprintf(Resources::MISSING_CONFIG_SETTING_KEY_MSG, $name, $restType); $missingValueMsg = sprintf(Resources::MISSING_CONFIG_SETTING_VALUE_MSG, $name); $properties = $config->getProperties(); Validate::isTrue(array_key_exists($setting, $properties), $missingKeyMsg); $value = $config->getProperty($setting); $isNullEmpty = empty($value); Validate::isTrue(!$isNullEmpty, $missingValueMsg); }