forked from zendframework/zendframework
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'hotfix/ZF2-11/tool_framework_client_storage' of https:/…
…/github.com/sasezaki/zf2 into hotfix/zf2-11
- Loading branch information
Showing
7 changed files
with
164 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
/** | ||
* Zend Framework | ||
* | ||
* LICENSE | ||
* | ||
* This source file is subject to the new BSD license that is bundled | ||
* with this package in the file LICENSE.txt. | ||
* It is also available through the world-wide-web at this URL: | ||
* http://framework.zend.com/license/new-bsd | ||
* If you did not receive a copy of the license and are unable to | ||
* obtain it through the world-wide-web, please send an email | ||
* to [email protected] so we can send you a copy immediately. | ||
* | ||
* @category Zend | ||
* @package Zend_Tool | ||
* @subpackage Framework | ||
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) | ||
* @license http://framework.zend.com/license/new-bsd New BSD License | ||
*/ | ||
|
||
/** | ||
* @namespace | ||
*/ | ||
namespace Zend\Tool\Framework\Client\Storage; | ||
|
||
/** | ||
* @category Zend | ||
* @package Zend_Tool | ||
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) | ||
* @license http://framework.zend.com/license/new-bsd New BSD License | ||
*/ | ||
interface Exception | ||
{ | ||
} |
9 changes: 9 additions & 0 deletions
9
library/Zend/Tool/Framework/Client/Storage/Exception/UnexpectedValueException.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?php | ||
|
||
namespace Zend\Tool\Framework\Client\Storage\Exception; | ||
|
||
class UnexpectedValueException | ||
extends \UnexpectedValueException | ||
implements \Zend\Tool\Framework\Client\Storage\Exception | ||
{ | ||
} |
51 changes: 51 additions & 0 deletions
51
tests/Zend/Tool/Framework/Client/Storage/DirectoryTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?php | ||
/** | ||
* Zend Framework | ||
* | ||
* LICENSE | ||
* | ||
* This source file is subject to the new BSD license that is bundled | ||
* with this package in the file LICENSE.txt. | ||
* It is also available through the world-wide-web at this URL: | ||
* http://framework.zend.com/license/new-bsd | ||
* If you did not receive a copy of the license and are unable to | ||
* obtain it through the world-wide-web, please send an email | ||
* to [email protected] so we can send you a copy immediately. | ||
* | ||
* @category Zend | ||
* @package Zend_Tool | ||
* @subpackage UnitTests | ||
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) | ||
* @license http://framework.zend.com/license/new-bsd New BSD License | ||
*/ | ||
|
||
/** | ||
* @namespace | ||
*/ | ||
namespace ZendTest\Tool\Framework\Client; | ||
use Zend\Tool\Framework\Client\Storage\Directory, | ||
Zend\Tool\Framework\Client\Storage\Exception\UnexpectedValueException; | ||
|
||
/** | ||
* @category Zend | ||
* @package Zend_Tool | ||
* @subpackage UnitTests | ||
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) | ||
* @license http://framework.zend.com/license/new-bsd New BSD License | ||
* | ||
* @group Zend_Tool | ||
* @group Zend_Tool_Framework | ||
* @group Zend_Tool_Framework_Client | ||
* @group Zend_Tool_Framework_Client_Storage | ||
*/ | ||
class DirectoryTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
public function testNonExistsDirectory() | ||
{ | ||
try { | ||
$directory = new Directory(__DIR__.DIRECTORY_SEPARATOR.'nonexists'); | ||
$this->fail('RuntimeException was expected but not thrown'); | ||
} catch (UnexpectedValueException $ue) { | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
<?php | ||
/** | ||
* Zend Framework | ||
* | ||
* LICENSE | ||
* | ||
* This source file is subject to the new BSD license that is bundled | ||
* with this package in the file LICENSE.txt. | ||
* It is also available through the world-wide-web at this URL: | ||
* http://framework.zend.com/license/new-bsd | ||
* If you did not receive a copy of the license and are unable to | ||
* obtain it through the world-wide-web, please send an email | ||
* to [email protected] so we can send you a copy immediately. | ||
* | ||
* @category Zend | ||
* @package Zend_Tool | ||
* @subpackage UnitTests | ||
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) | ||
* @license http://framework.zend.com/license/new-bsd New BSD License | ||
*/ | ||
|
||
/** | ||
* @namespace | ||
*/ | ||
namespace ZendTest\Tool\Framework\Client; | ||
use Zend\Tool\Framework\Client\Storage; | ||
|
||
/** | ||
* @category Zend | ||
* @package Zend_Tool | ||
* @subpackage UnitTests | ||
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) | ||
* @license http://framework.zend.com/license/new-bsd New BSD License | ||
* | ||
* @group Zend_Tool | ||
* @group Zend_Tool_Framework | ||
* @group Zend_Tool_Framework_Client | ||
*/ | ||
class StorageTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
/** | ||
* @var Zend\Tool\Framework\Client\Storage | ||
*/ | ||
protected $storage = null; | ||
|
||
public function setup() | ||
{ | ||
$this->storage = new Storage(); | ||
} | ||
|
||
public function getStorageDirectory() | ||
{ | ||
return __DIR__.DIRECTORY_SEPARATOR.'_files'. DIRECTORY_SEPARATOR .'storagedirectory'; | ||
} | ||
|
||
public function testNoAdapterStorageIsNotEnabled() | ||
{ | ||
$this->assertFalse($this->storage->isEnabled()); | ||
} | ||
|
||
public function testPassingArrayToConstructor() | ||
{ | ||
$directory = new Storage\Directory($this->getStorageDirectory()); | ||
$storage = new Storage(array('adapter' => $directory)); | ||
$this->assertTrue($storage->isEnabled()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|