Behavioral\Command restructured

This commit is contained in:
Antonio Spinelli
2014-03-24 09:14:05 -03:00
parent e59d70a0ac
commit 3e515daa0f
5 changed files with 15 additions and 9 deletions

View File

@@ -1,6 +1,6 @@
<?php <?php
namespace DesignPatterns\Command; namespace DesignPatterns\Behavioral\Command;
/** /**
* class CommandInterface * class CommandInterface

View File

@@ -1,6 +1,6 @@
<?php <?php
namespace DesignPatterns\Command; namespace DesignPatterns\Behavioral\Command;
/** /**
* This concrete command calls "print" on the Receiver, but an external * This concrete command calls "print" on the Receiver, but an external

View File

@@ -1,6 +1,6 @@
<?php <?php
namespace DesignPatterns\Command; namespace DesignPatterns\Behavioral\Command;
/** /**
* Invoker is using the command given to it. * Invoker is using the command given to it.

View File

@@ -1,6 +1,6 @@
<?php <?php
namespace DesignPatterns\Command; namespace DesignPatterns\Behavioral\Command;
/** /**
* Receiver is specific service with its own contract and can be only concrete * Receiver is specific service with its own contract and can be only concrete

View File

@@ -1,10 +1,10 @@
<?php <?php
namespace DesignPatterns\Tests\Command; namespace DesignPatterns\Behavioral\Command\Tests;
use DesignPatterns\Command\Invoker; use DesignPatterns\Behavioral\Command\Invoker;
use DesignPatterns\Command\Receiver; use DesignPatterns\Behavioral\Command\Receiver;
use DesignPatterns\Command\HelloCommand; use DesignPatterns\Behavioral\Command\HelloCommand;
/** /**
* CommandTest has the role of the Client in the Command Pattern * CommandTest has the role of the Client in the Command Pattern
@@ -12,12 +12,18 @@ use DesignPatterns\Command\HelloCommand;
class CommandTest extends \PHPUnit_Framework_TestCase class CommandTest extends \PHPUnit_Framework_TestCase
{ {
/**
* @var Invoker
*/
protected $invoker; protected $invoker;
/**
* @var Receiver
*/
protected $receiver; protected $receiver;
protected function setUp() protected function setUp()
{ {
// this is the context of the application
$this->invoker = new Invoker(); $this->invoker = new Invoker();
$this->receiver = new Receiver(); $this->receiver = new Receiver();
} }