mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-07-30 19:50:12 +02:00
cs fix
This commit is contained in:
@@ -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();
|
||||
|
@@ -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));
|
||||
}
|
||||
}
|
||||
|
@@ -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)
|
||||
|
@@ -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));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -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)
|
||||
{
|
||||
|
@@ -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);
|
||||
|
Reference in New Issue
Block a user