From 960916446fe9779685e6b280d917bf1cf0accd81 Mon Sep 17 00:00:00 2001 From: Benjamin Eberlei Date: Wed, 6 Mar 2013 23:32:51 +0100 Subject: [PATCH] Fix Bug in creation of BlobStrategy --- Deployment/Assets/BlobStrategy.php | 4 ++-- Tests/ContainerTest.php | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/Deployment/Assets/BlobStrategy.php b/Deployment/Assets/BlobStrategy.php index b03e3ac..92aaba6 100644 --- a/Deployment/Assets/BlobStrategy.php +++ b/Deployment/Assets/BlobStrategy.php @@ -32,11 +32,11 @@ class BlobStrategy extends AssetStrategy */ private $client; - public function __construct($container, BlobRestProxy $client) + public function __construct($container) { parent::__construct($container); - $this->client = $client; + $this->client = $container->get('windows_azure_distribution.assets.blob.storage'); } public function deploy($documentRoot, $buildNumber) diff --git a/Tests/ContainerTest.php b/Tests/ContainerTest.php index 1a2b258..a6b1c70 100644 --- a/Tests/ContainerTest.php +++ b/Tests/ContainerTest.php @@ -69,6 +69,22 @@ public function testServices() $this->assertInstanceOf('WindowsAzure\Blob\BlobRestProxy', $container->get('windows_azure.blob.test')); } + public function testAssets() + { + $config = array( + 'services' => array( + 'blob' => array( + 'test' => 'UseDevelopmentStorage=true', + ), + ), + 'assets' => array('type' => 'blob', 'connection_name' => 'test') + ); + + $container = $this->createContainer($config); + + $this->assertInstanceOf('WindowsAzure\DistributionBundle\Deployment\Assets\BlobStrategy', $container->get('windows_azure_distribution.assets')); + } + public function testSessionStorage() { $config = array(