Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Fixes #24 : Fixes Fatal error in Catchall::factory #93

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
32 changes: 32 additions & 0 deletions test/Router/Console/CatchallTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2016 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\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));
}
}