it was created the Structural namespace and append its patterns

This commit is contained in:
Antonio Spinelli
2014-04-15 23:14:39 -03:00
parent 7bf6593e3f
commit 113f63a54f
37 changed files with 77 additions and 69 deletions

View File

@@ -1,6 +1,6 @@
<?php
namespace DesignPatterns\Decorator;
namespace DesignPatterns\Structural\Decorator;
/**
* the Decorator MUST implement the RendererInterface contract, this is the key-feature

View File

@@ -1,8 +1,8 @@
<?php
namespace DesignPatterns\Tests\Decorator;
namespace DesignPatterns\Structural\Decorator;
use DesignPatterns\Decorator;
use DesignPatterns\Structural\Decorator;
/**
* DecoratorTest tests the decorator pattern
@@ -38,7 +38,7 @@ class DecoratorTest extends \PHPUnit_Framework_TestCase
*/
public function testDecoratorMustImplementsRenderer()
{
$this->assertTrue(is_subclass_of('DesignPatterns\Decorator\Decorator', 'DesignPatterns\Decorator\RendererInterface'));
$this->assertTrue(is_subclass_of('DesignPatterns\Structural\Decorator\Decorator', 'DesignPatterns\Structural\Decorator\RendererInterface'));
}
/**
@@ -48,7 +48,7 @@ class DecoratorTest extends \PHPUnit_Framework_TestCase
*/
public function testDecoratorTypeHinted()
{
$this->getMockForAbstractClass('DesignPatterns\Decorator\Decorator', array(new \stdClass()));
$this->getMockForAbstractClass('DesignPatterns\Structural\Decorator\Decorator', array(new \stdClass()));
}
/**
@@ -56,8 +56,8 @@ class DecoratorTest extends \PHPUnit_Framework_TestCase
*/
public function testDecoratorOnlyAcceptRenderer()
{
$mock = $this->getMock('DesignPatterns\Decorator\RendererInterface');
$dec = $this->getMockForAbstractClass('DesignPatterns\Decorator\Decorator', array($mock));
$mock = $this->getMock('DesignPatterns\Structural\Decorator\RendererInterface');
$dec = $this->getMockForAbstractClass('DesignPatterns\Structural\Decorator\Decorator', array($mock));
$this->assertNotNull($dec);
}
}

View File

@@ -1,6 +1,6 @@
<?php
namespace DesignPatterns\Decorator;
namespace DesignPatterns\Structural\Decorator;
/**
* Class RenderInJson

View File

@@ -1,6 +1,6 @@
<?php
namespace DesignPatterns\Decorator;
namespace DesignPatterns\Structural\Decorator;
/**
* Class RenderInXml

View File

@@ -1,6 +1,6 @@
<?php
namespace DesignPatterns\Decorator;
namespace DesignPatterns\Structural\Decorator;
/**
* Class RendererInterface

View File

@@ -1,6 +1,6 @@
<?php
namespace DesignPatterns\Decorator;
namespace DesignPatterns\Structural\Decorator;
/**
* Class Webservice