diff --git a/src/App.php b/src/App.php index 48bf889..5fa6b78 100644 --- a/src/App.php +++ b/src/App.php @@ -562,7 +562,7 @@ public static function debugger(string $instance = 'default') : Debugger */ protected static function setDebugger(string $instance) : Debugger { - $config = static::config()->get('debugger'); + $config = static::config()->get('debugger', $instance); $service = new Debugger(); if (isset($config['debugbar_view'])) { $service->setDebugbarView($config['debugbar_view']); @@ -605,7 +605,7 @@ public static function exceptionHandler(string $instance = 'default') : Exceptio */ protected static function setExceptionHandler(string $instance) : ExceptionHandler { - $config = static::config()->get('exceptionHandler'); + $config = static::config()->get('exceptionHandler', $instance); $environment = $config['environment'] ?? ExceptionHandler::PRODUCTION; $logger = null; if (isset($config['logger_instance'])) { diff --git a/tests/ModelTest.php b/tests/ModelTest.php index ccaba40..c006c7d 100644 --- a/tests/ModelTest.php +++ b/tests/ModelTest.php @@ -264,7 +264,7 @@ public function testCreateExceptionUnknownColumn() : void { $this->model->allowedFields[] = 'not-exists'; $this->expectException(\mysqli_sql_exception::class); - $this->expectExceptionMessage("Unknown column 'not-exists' in 'field list'"); + $this->expectExceptionMessage("Unknown column 'not-exists' in 'INSERT INTO'"); $this->model->create(['not-exists' => 'Value']); } @@ -355,7 +355,7 @@ public function testUpdateExceptionUnknownColumn() : void { $this->model->allowedFields[] = 'not-exists'; $this->expectException(\mysqli_sql_exception::class); - $this->expectExceptionMessage("Unknown column 'not-exists' in 'field list'"); + $this->expectExceptionMessage("Unknown column 'not-exists' in 'SET'"); $this->model->update(1, ['not-exists' => 'Value']); } @@ -373,7 +373,7 @@ public function testReplaceExceptionUnknownColumn() : void { $this->model->allowedFields[] = 'not-exists'; $this->expectException(\mysqli_sql_exception::class); - $this->expectExceptionMessage("Unknown column 'not-exists' in 'field list'"); + $this->expectExceptionMessage("Unknown column 'not-exists' in 'INSERT INTO'"); $this->model->replace(1, ['not-exists' => 'Value']); }