From 113f63a54f8f33afc75059c721fe955371279548 Mon Sep 17 00:00:00 2001 From: Antonio Spinelli Date: Tue, 15 Apr 2014 23:14:39 -0300 Subject: [PATCH] it was created the Structural namespace and append its patterns --- Structural/Adapter/{Test => }/AdapterTest.php | 10 +++++----- Structural/Adapter/Book.php | 2 +- Structural/Adapter/EBookAdapter.php | 2 +- Structural/Adapter/EBookInterface.php | 2 +- Structural/Adapter/Kindle.php | 2 +- Structural/Adapter/PaperBookInterface.php | 2 +- .../{Test/FormTest.php => CompositeTest.php} | 6 +++--- Structural/Composite/Form.php | 2 +- Structural/Composite/FormElement.php | 2 +- Structural/Composite/InputElement.php | 2 +- Structural/Composite/TextElement.php | 2 +- .../UserMapperTest.php => DataMapperTest.php} | 12 ++++++------ Structural/DataMapper/User.php | 2 +- Structural/DataMapper/UserMapper.php | 2 +- Structural/Decorator/Decorator.php | 2 +- .../Decorator/{Test => }/DecoratorTest.php | 12 ++++++------ Structural/Decorator/RenderInJson.php | 2 +- Structural/Decorator/RenderInXml.php | 2 +- Structural/Decorator/RendererInterface.php | 2 +- Structural/Decorator/Webservice.php | 2 +- .../DependencyInjection/AbstractConfig.php | 2 +- Structural/DependencyInjection/ArrayConfig.php | 2 +- Structural/DependencyInjection/Connection.php | 2 +- .../{Test => }/DependencyInjectionTest.php | 10 +++++----- Structural/DependencyInjection/Parameters.php | 2 +- .../DependencyInjection/{Test => }/config.php | 0 Structural/Facade/BiosInterface.php | 2 +- Structural/Facade/Facade.php | 2 +- Structural/Facade/{Test => }/FacadeTest.php | 8 ++++---- Structural/Facade/OsInterface.php | 2 +- .../{Test => }/FluentInterfaceTest.php | 6 +++--- Structural/FluentInterface/SQL.php | 4 ++-- Structural/Proxy/Record.php | 2 +- Structural/Proxy/RecordProxy.php | 2 +- Structural/Registry/Registry.php | 2 +- Structural/Registry/RegistryTest.php | 17 +++++++++++++++++ Structural/Registry/index.php | 9 --------- 37 files changed, 77 insertions(+), 69 deletions(-) rename Structural/Adapter/{Test => }/AdapterTest.php (77%) rename Structural/Composite/{Test/FormTest.php => CompositeTest.php} (77%) rename Structural/DataMapper/{Test/UserMapperTest.php => DataMapperTest.php} (87%) rename Structural/Decorator/{Test => }/DecoratorTest.php (72%) rename Structural/DependencyInjection/{Test => }/DependencyInjectionTest.php (61%) rename Structural/DependencyInjection/{Test => }/config.php (100%) rename Structural/Facade/{Test => }/FacadeTest.php (79%) rename Structural/FluentInterface/{Test => }/FluentInterfaceTest.php (76%) create mode 100644 Structural/Registry/RegistryTest.php delete mode 100644 Structural/Registry/index.php diff --git a/Structural/Adapter/Test/AdapterTest.php b/Structural/Adapter/AdapterTest.php similarity index 77% rename from Structural/Adapter/Test/AdapterTest.php rename to Structural/Adapter/AdapterTest.php index 370a6c3..55cc5e2 100644 --- a/Structural/Adapter/Test/AdapterTest.php +++ b/Structural/Adapter/AdapterTest.php @@ -1,11 +1,11 @@ assertTrue(is_subclass_of('DesignPatterns\Composite\Form', 'DesignPatterns\Composite\FormElement')); + $this->assertTrue(is_subclass_of('DesignPatterns\Structural\Composite\Form', 'DesignPatterns\Structural\Composite\FormElement')); } } diff --git a/Structural/Composite/Form.php b/Structural/Composite/Form.php index 66248c2..fbf3b50 100644 --- a/Structural/Composite/Form.php +++ b/Structural/Composite/Form.php @@ -1,6 +1,6 @@ dbal = $this->getMockBuilder('DesignPatterns\DataMapper\DBAL') + $this->dbal = $this->getMockBuilder('DesignPatterns\Structural\DataMapper\DBAL') ->disableAutoload() ->setMethods(array('insert', 'update', 'find', 'findAll')) ->getMock(); @@ -90,7 +90,7 @@ class UserMapperTest extends \PHPUnit_Framework_TestCase } /** - * @expectedException InvalidArgumentException + * @expectedException \InvalidArgumentException * @expectedExceptionMessage User #404 not found */ public function testNotFound() diff --git a/Structural/DataMapper/User.php b/Structural/DataMapper/User.php index 12f8779..78e60a8 100644 --- a/Structural/DataMapper/User.php +++ b/Structural/DataMapper/User.php @@ -1,6 +1,6 @@ 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); } } diff --git a/Structural/Decorator/RenderInJson.php b/Structural/Decorator/RenderInJson.php index 0edc7ea..ebcc577 100644 --- a/Structural/Decorator/RenderInJson.php +++ b/Structural/Decorator/RenderInJson.php @@ -1,6 +1,6 @@ getMockBuilder('DesignPatterns\Facade\BiosInterface') + $bios = $this->getMockBuilder('DesignPatterns\Structural\Facade\BiosInterface') ->setMethods(array('launch', 'execute', 'waitForKeyPress')) ->disableAutoload() ->getMock(); - $operatingSys = $this->getMockBuilder('DesignPatterns\Facade\OsInterface') + $operatingSys = $this->getMockBuilder('DesignPatterns\Structural\Facade\OsInterface') ->setMethods(array('getName')) ->disableAutoload() ->getMock(); diff --git a/Structural/Facade/OsInterface.php b/Structural/Facade/OsInterface.php index e81c7f1..3b09eb1 100644 --- a/Structural/Facade/OsInterface.php +++ b/Structural/Facade/OsInterface.php @@ -1,6 +1,6 @@ select(array('foo', 'bar')) ->from('foobar', 'f') ->where('f.bar = ?') diff --git a/Structural/FluentInterface/SQL.php b/Structural/FluentInterface/SQL.php index 6b7d82d..3afd300 100644 --- a/Structural/FluentInterface/SQL.php +++ b/Structural/FluentInterface/SQL.php @@ -1,11 +1,11 @@ assertInstanceOf('StdClass', $logger); + } +} diff --git a/Structural/Registry/index.php b/Structural/Registry/index.php deleted file mode 100644 index 2b0ecba..0000000 --- a/Structural/Registry/index.php +++ /dev/null @@ -1,9 +0,0 @@ -log('foo');