diff --git a/src/Router/Console/Catchall.php b/src/Router/Console/Catchall.php index b13797eea..77e7d943f 100644 --- a/src/Router/Console/Catchall.php +++ b/src/Router/Console/Catchall.php @@ -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'] : []); } /** diff --git a/test/Router/Console/CatchallTest.php b/test/Router/Console/CatchallTest.php new file mode 100644 index 000000000..3ca151fde --- /dev/null +++ b/test/Router/Console/CatchallTest.php @@ -0,0 +1,32 @@ + []]] + ]; + } + + /** + * @dataProvider provideFactoryOptions + */ + public function testFactory($options) + { + $this->assertInstanceOf(Catchall::class, Catchall::factory($options)); + } +}