Skip to content
This repository has been archived by the owner on Jan 31, 2020. It is now read-only.

Commit

Permalink
Merge branch 'master' of git://git.zendframework.com/zf
Browse files Browse the repository at this point in the history
  • Loading branch information
Shahar Evron committed Jul 25, 2010
5 parents 954b983 + 17fca5b + 3e4bdb7 + a1ec0e4 + 73e93c4 commit 08d604f
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 355 deletions.
18 changes: 11 additions & 7 deletions src/Cloud.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,14 @@
* @namespace
*/
namespace Zend\Tag;
use Zend\Config;

use Zend\Config,
Zend\Loader\PrefixPathMapper,
Zend\Loader\ShortNameLocater,
Zend\Loader\PluginLoader;

/**
* @uses \Zend\Loader\PluginLoader\PluginLoader
* @uses \Zend\Loader\PluginLoader
* @uses \Zend\Tag\Cloud\Exception
* @uses \Zend\Tag\Item
* @uses \Zend\Tag\ItemList
Expand Down Expand Up @@ -62,7 +66,7 @@ class Cloud
/**
* Plugin loader for decorators
*
* @var \Zend\Loader\PluginLoader\PluginLoader
* @var \Zend\Loader\ShortNameLocater
*/
protected $_pluginLoader = null;

Expand Down Expand Up @@ -306,10 +310,10 @@ public function getTagDecorator()
/**
* Set plugin loaders for use with decorators
*
* @param \Zend\Loader\PluginLoader\PluginLoaderInterface $loader
* @param \Zend\Loader\ShortNameLocater $loader
* @return \Zend\Tag\Cloud
*/
public function setPluginLoader(\Zend\Loader\PluginLoader\PluginLoaderInterface $loader)
public function setPluginLoader(ShortNameLocater $loader)
{
$this->_pluginLoader = $loader;
return $this;
Expand All @@ -318,14 +322,14 @@ public function setPluginLoader(\Zend\Loader\PluginLoader\PluginLoaderInterface
/**
* Get the plugin loader for decorators
*
* @return \Zend\Loader\PluginLoader\PluginLoader
* @return \Zend\Loader\ShortNameLocater
*/
public function getPluginLoader()
{
if ($this->_pluginLoader === null) {
$prefix = 'Zend\Tag\Cloud\Decorator\\';
$pathPrefix = 'Zend/Tag/Cloud/Decorator/';
$this->_pluginLoader = new \Zend\Loader\PluginLoader\PluginLoader(array($prefix => $pathPrefix));
$this->_pluginLoader = new PluginLoader(array($prefix => $pathPrefix));
}

return $this->_pluginLoader;
Expand Down
10 changes: 5 additions & 5 deletions test/Cloud/CloudTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public function testSetPrefixPathViaOptions()
$cloud = $this->_getCloud(array(
'prefixPath' => array(
'prefix' => 'ZendTest\Tag\Cloud\TestAsset',
'path' => dirname(__FILE__) . '/TestAsset'
'path' => __DIR__ . '/TestAsset'
),
'cloudDecorator' => array(
'decorator' => 'CloudDummy1',
Expand All @@ -135,7 +135,7 @@ public function testSetPrefixPathsViaOptions()
'prefixPath' => array(
array(
'prefix' => 'ZendTest\Tag\Cloud\TestAsset',
'path' => dirname(__FILE__) . '/TestAsset'
'path' => __DIR__ . '/TestAsset'
)
),
'cloudDecorator' => array(
Expand Down Expand Up @@ -165,7 +165,7 @@ public function testSetPrefixPathsSkip()

public function testSetPluginLoader()
{
$loader = new PluginLoader\PluginLoader(array('foo_' => 'bar/'));
$loader = new PluginLoader(array('foo_' => 'bar/'));
$cloud = $this->_getCloud(array(), null);
$cloud->setPluginLoader($loader);
$paths = $cloud->getPluginLoader()->getPaths();
Expand All @@ -175,7 +175,7 @@ public function testSetPluginLoader()

public function testSetPluginLoaderViaOptions()
{
$loader = new PluginLoader\PluginLoader(array('foo_' => 'bar/'));
$loader = new PluginLoader(array('foo_' => 'bar/'));
$cloud = $this->_getCloud(array('pluginLoader' => $loader), null);
$paths = $cloud->getPluginLoader()->getPaths();

Expand Down Expand Up @@ -324,7 +324,7 @@ protected function _getCloud($options = null, $setPluginLoader = true)
$cloud = new Tag\Cloud($options);

if ($setPluginLoader) {
$cloud->getPluginLoader()->addPrefixPath('ZendTest\Tag\Cloud\TestAsset', dirname(__FILE__) . '/TestAsset');
$cloud->getPluginLoader()->addPrefixPath('ZendTest\Tag\Cloud\TestAsset', __DIR__ . '/TestAsset');
}

return $cloud;
Expand Down
22 changes: 1 addition & 21 deletions test/Cloud/Decorator/HTMLCloudTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,8 @@
* @namespace
*/
namespace ZendTest\Tag\Cloud\Decorator;
use Zend\Tag\Cloud\Decorator;

if (!defined('PHPUnit_MAIN_METHOD')) {
define('PHPUnit_MAIN_METHOD', 'Zend_Tag_Cloud_Decorator_HTMLCloudTest::main');
}

/**
* Test helper
*/

use Zend\Tag\Cloud\Decorator;

/**
* @category Zend
Expand All @@ -46,12 +38,6 @@
*/
class HTMLCloudTest extends \PHPUnit_Framework_TestCase
{
public static function main()
{
$suite = new \PHPUnit_Framework_TestSuite(__CLASS__);
$result = \PHPUnit_TextUI_TestRunner::run($suite);
}

public function testDefaultOutput()
{
$decorator = new Decorator\HTMLCloud();
Expand Down Expand Up @@ -104,9 +90,3 @@ public function testSkipOptions()
}
}

if (PHPUnit_MAIN_METHOD == 'Zend_Tag_Cloud_Decorator_HTMLCloudTest::main') {
\Zend_Tag_Cloud_Decorator_HTMLCloudTest::main();
}
/**
*
*/
112 changes: 0 additions & 112 deletions test/Cloud/Decorator/HtmlCloudTest.php

This file was deleted.

Loading

0 comments on commit 08d604f

Please sign in to comment.