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

Commit 178ee48

Browse files
committed
Fixes #24 : Fixes Fatal error in Catchall::factory
1 parent 05e8db5 commit 178ee48

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed

src/Router/Console/Catchall.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public function __construct(array $defaults = [])
8585
*/
8686
public static function factory($options = [])
8787
{
88-
return new static($options['defaults']);
88+
return new static(isset($options['defaults']) ? $options['defaults'] : []);
8989
}
9090

9191
/**

test/Router/Console/CatchallTest.php

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?php
2+
/**
3+
* Zend Framework (http://framework.zend.com/)
4+
*
5+
* @link http://github.com/zendframework/zf2 for the canonical source repository
6+
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
7+
* @license http://framework.zend.com/license/new-bsd New BSD License
8+
*/
9+
10+
namespace ZendTest\Mvc\Router\Console;
11+
12+
use PHPUnit_Framework_TestCase as TestCase;
13+
use Zend\Console\Request as ConsoleRequest;
14+
use Zend\Mvc\Router\Console\Catchall;
15+
16+
class CatchallTest extends TestCase
17+
{
18+
public function provideFactoryOptions()
19+
{
20+
return [
21+
[[]],
22+
[['defaults' => []]]
23+
];
24+
}
25+
26+
/**
27+
* @dataProvider provideFactoryOptions
28+
*/
29+
public function testFactory($options)
30+
{
31+
$this->assertInstanceOf(Catchall::class, Catchall::factory($options));
32+
}
33+
}

0 commit comments

Comments
 (0)