diff --git a/composer.json b/composer.json index 9d8138c..cd10fe9 100644 --- a/composer.json +++ b/composer.json @@ -26,5 +26,15 @@ "Dframe\\Database\\": "src/" } }, - "require": {} -} \ No newline at end of file + "autoload-dev": { + "psr-4": { + "Dframe\\Database\\tests\\": "tests/" + } + }, + "require": { + "php": ">=5.6" + }, + "require-dev": { + "phpunit/phpunit": "^5.7 || ^6.5" + } +} diff --git a/tests/Bootstrap.php b/tests/Bootstrap.php index b3efd23..81d5294 100644 --- a/tests/Bootstrap.php +++ b/tests/Bootstrap.php @@ -5,6 +5,3 @@ # Application configuration define('APP_DIR', dirname(__FILE__) . '/app/'); - -$autoloader = include dirname(__FILE__) . '/../vendor/autoload.php';; -$autoloader->addPsr4('Dframe\Database\tests\\', __DIR__); \ No newline at end of file diff --git a/tests/ConnectionTest.php b/tests/ConnectionTest.php index 5a67ca0..9d938bd 100644 --- a/tests/ConnectionTest.php +++ b/tests/ConnectionTest.php @@ -1,14 +1,11 @@ getConnection()->pdoQuery(); - } catch (Exception $e) { - $this->assertEquals($e->getMessage(), 'SQLSTATE[42000]: Syntax error or access violation: 1065 Query was empty'); - } + $this->expectException(\Exception::class); + $this->expectExceptionMessage('SQLSTATE[42000]: Syntax error or access violation: 1065 Query was empty'); + $test = $this->getConnection()->pdoQuery(); } } diff --git a/tests/QueryTest.php b/tests/QueryTest.php index 8f7fb08..7f537f5 100644 --- a/tests/QueryTest.php +++ b/tests/QueryTest.php @@ -1,13 +1,13 @@