Пример #1
0
 /**
  * Creates new object based on the builder type in the $config.
  *
  * @param WindowsAzure\Common\Configuration             $config  The config
  * object.
  * @param WindowsAzure\Common\Internal\IServicesBuilder $builder The builder
  * object.
  * 
  * @return WindowsAzure\Blob\BlobRestProxy
  */
 public static function create($config, $builder = null)
 {
     Validate::isTrue($config instanceof Configuration, Resources::INVALID_CONFIG_MSG);
     if (!is_null($builder)) {
         Validate::isTrue($builder instanceof IServiceBuilder, Resources::INVALID_BUILDER_MSG);
     }
     return $config->create(Resources::BLOB_TYPE_NAME, $builder);
 }
 /**
  * @covers WindowsAzure\Common\Configuration::create
  * @covers WindowsAzure\Common\Configuration::_useStorageEmulatorConfig
  */
 public function testCreate()
 {
     $config = new Configuration();
     $config->setProperty(QueueSettings::ACCOUNT_KEY, TestResources::KEY1);
     $config->setProperty(QueueSettings::ACCOUNT_NAME, TestResources::ACCOUNT_NAME);
     $config->setProperty(QueueSettings::URI, 'http://' . TestResources::ACCOUNT_NAME . TestResources::QUEUE_URI);
     $queueRestProxy = $config->create(Resources::QUEUE_TYPE_NAME);
     $this->assertInstanceOf('WindowsAzure\\Queue\\Internal\\IQueue', $queueRestProxy);
 }