Skip to content
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
4 changes: 0 additions & 4 deletions kahlan-config.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
<?php

use Laminas\ServiceManager\AbstractPluginManager;
use Kahlan\Filter\Filters;
use Kahlan\Reporter\Coverage;
use Kahlan\Reporter\Coverage\Driver\Xdebug;

// autoload hack
class_alias(AbstractPluginManager::class, Zend\ServiceManager\AbstractPluginManager::class);

Filters::apply($this, 'coverage', function($next): void {
if (! extension_loaded('xdebug')) {
return;
Expand Down
22 changes: 21 additions & 1 deletion spec/ModuleSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,21 @@
$driver = Double::instance(['extends' => Driver::class, 'methods' => '__construct']);
allow($driver)->toReceive('getName')->andReturn('pdo_mysql');

allow($connection)->toReceive('getParams')->andReturn([]);
$pdoMysqlInitCommandAttr = defined(Mysql::class . '::ATTR_INIT_COMMAND')
? Mysql::ATTR_INIT_COMMAND
: PDO::MYSQL_ATTR_INIT_COMMAND;

allow($connection)->toReceive('getParams')->andReturn([
'user' => 'mysqluser',
'password' => 'mysqlpassword',
'dbname' => 'mysqldbname',
'host' => 'mysqlhost',
'port' => '3306',
'driverOptions' => [
$pdoMysqlInitCommandAttr => "SET NAMES 'UTF8'",
],
'driverClass' => Driver::class,
]);
allow($connection)->toReceive('getUsername')->andReturn('root');
allow($connection)->toReceive('getPassword')->andReturn('');
allow($connection)->toReceive('getDriver')->andReturn($driver);
Expand Down Expand Up @@ -165,9 +179,15 @@
: PDO::MYSQL_ATTR_INIT_COMMAND;

allow($connection)->toReceive('getParams')->andReturn([
'user' => 'mysqluser',
'password' => 'mysqlpassword',
'dbname' => 'mysqldbname',
'host' => 'mysqlhost',
'port' => '3306',
'driverOptions' => [
$pdoMysqlInitCommandAttr => "SET NAMES 'UTF8'",
],
'driverClass' => Driver::class,
]);
allow($connection)->toReceive('getUsername')->andReturn('root');
allow($connection)->toReceive('getPassword')->andReturn('');
Expand Down
1 change: 0 additions & 1 deletion src/Handler/Writer/Mail.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ public function shutdown(): void
try {
$this->transport->send($this->mail);
} catch (Exception $exception) {
/** @var string $message */
$message = $exception->getMessage();
/** @var int $code */
$code = $exception->getCode();
Expand Down
Loading