This commit is contained in:
Antonio Spinelli
2014-04-16 17:59:03 -03:00
parent da35c96b90
commit fc3b6a1608
25 changed files with 65 additions and 64 deletions

View File

@@ -33,7 +33,7 @@ class AdapterTest extends \PHPUnit_Framework_TestCase
*
* @dataProvider getBook
*/
public function test_I_am_an_old_Client(PaperBookInterface $book)
public function testIAmAnOldClient(PaperBookInterface $book)
{
$book->open();
$book->turnPage();

View File

@@ -29,6 +29,8 @@ class CompositeTest extends \PHPUnit_Framework_TestCase
*/
public function testFormImplementsFormEelement()
{
$this->assertTrue(is_subclass_of('DesignPatterns\Structural\Composite\Form', 'DesignPatterns\Structural\Composite\FormElement'));
$className = 'DesignPatterns\Structural\Composite\Form';
$abstractName = 'DesignPatterns\Structural\Composite\FormElement';
$this->assertTrue(is_subclass_of($className, $abstractName));
}
}

View File

@@ -65,7 +65,12 @@ class DataMapperTest extends \PHPUnit_Framework_TestCase
*/
public function testRestoreOne(User $existing)
{
$rows = new \ArrayIterator(array(array('userid' => 1, 'username' => 'Odysseus', 'email' => 'Odysseus@ithaca.gr')));
$row = array(
'userid' => 1,
'username' => 'Odysseus',
'email' => 'Odysseus@ithaca.gr'
);
$rows = new \ArrayIterator(array($row));
$this->dbal->expects($this->once())
->method('find')
->with(1)

View File

@@ -30,7 +30,8 @@ class DecoratorTest extends \PHPUnit_Framework_TestCase
// Wrap service with a JSON decorator for renderers
$service = new Decorator\RenderInXml($this->service);
// Our Renderer will now output XML instead of an array
$this->assertXmlStringEqualsXmlString('<?xml version="1.0"?><foo>bar</foo>', $service->renderData());
$xml = '<?xml version="1.0"?><foo>bar</foo>';
$this->assertXmlStringEqualsXmlString($xml, $service->renderData());
}
/**
@@ -38,7 +39,9 @@ class DecoratorTest extends \PHPUnit_Framework_TestCase
*/
public function testDecoratorMustImplementsRenderer()
{
$this->assertTrue(is_subclass_of('DesignPatterns\Structural\Decorator\Decorator', 'DesignPatterns\Structural\Decorator\RendererInterface'));
$className = 'DesignPatterns\Structural\Decorator\Decorator';
$interfaceName = 'DesignPatterns\Structural\Decorator\RendererInterface';
$this->assertTrue(is_subclass_of($className, $interfaceName));
}
/**

View File

@@ -13,10 +13,11 @@ class ArrayConfig extends AbstractConfig implements Parameters
* Get parameter
*
* @param string|int $key
*
* @param null $default
* @return mixed
*/
public function get($key, $default = null) {
public function get($key, $default = null)
{
if (isset($this->storage[$key])) {
return $this->storage[$key];
}
@@ -27,7 +28,7 @@ class ArrayConfig extends AbstractConfig implements Parameters
* Set parameter
*
* @param string|int $key
* @param mixed $value
* @param mixed $value
*/
public function set($key, $value)
{

View File

@@ -5,13 +5,13 @@ namespace DesignPatterns\Structural\DependencyInjection;
/**
* Parameters interface
*/
interface Parameters
interface Parameters
{
/**
* Get parameter
*
* @param string|int $key
*
*
* @return mixed
*/
public function get($key);