Skip to content

Commit

Permalink
Fixes zendframework#24 : Fixes Fatal error in Catchall::factory
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik committed Mar 7, 2016
1 parent 05e8db5 commit 178ee48
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Router/Console/Catchall.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public function __construct(array $defaults = [])
*/
public static function factory($options = [])
{
return new static($options['defaults']);
return new static(isset($options['defaults']) ? $options['defaults'] : []);
}

/**
Expand Down
33 changes: 33 additions & 0 deletions test/Router/Console/CatchallTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

namespace ZendTest\Mvc\Router\Console;

use PHPUnit_Framework_TestCase as TestCase;
use Zend\Console\Request as ConsoleRequest;
use Zend\Mvc\Router\Console\Catchall;

class CatchallTest extends TestCase
{
public function provideFactoryOptions()
{
return [
[[]],
[['defaults' => []]]
];
}

/**
* @dataProvider provideFactoryOptions
*/
public function testFactory($options)
{
$this->assertInstanceOf(Catchall::class, Catchall::factory($options));
}
}

0 comments on commit 178ee48

Please sign in to comment.