From 120f0946e06a69fb13e81365067e99e338e8559e Mon Sep 17 00:00:00 2001 From: David Grudl Date: Wed, 4 Nov 2015 14:36:38 +0100 Subject: [PATCH] tests: improved ini quering --- tests/databases.sample.ini | 20 ++++++++++---------- tests/dibi/DibiFluent.fetch.limit.phpt | 2 +- tests/dibi/DibiResult.meta.phpt | 6 +----- tests/dibi/DibiRow.phpt | 2 +- tests/dibi/PdoMssql.limits.phpt | 6 +----- tests/dibi/Postgre.like.phpt | 6 +----- tests/dibi/meta.phpt | 13 ++++++------- 7 files changed, 21 insertions(+), 34 deletions(-) diff --git a/tests/databases.sample.ini b/tests/databases.sample.ini index f95d2bce..28b493a9 100644 --- a/tests/databases.sample.ini +++ b/tests/databases.sample.ini @@ -1,14 +1,14 @@ -[sqlite3] ; default +[sqlite] ; default driver = sqlite3 database = :memory: system = sqlite -[sqlite2] +[sqlite 2] driver = sqlite database = :memory: system = sqlite -[sqlite-pdo] +[sqlite pdo] driver = pdo dsn = "sqlite::memory:" system = sqlite @@ -21,7 +21,7 @@ password = charset = utf8 system = mysql -[mysqli] +[mysql improved] driver = mysqli host = 127.0.0.1 username = root @@ -29,7 +29,7 @@ password = charset = utf8 system = mysql -[mysql-pdo] +[mysql pdo] driver = pdo dsn = "mysql:host=127.0.0.1" username = root @@ -43,7 +43,7 @@ username = postgres password = system = postgre -[postgre-pdo] +[postgre pdo] driver = pdo dsn = "pgsql:host=127.0.0.1;dbname=dibi_test" username = postgres @@ -55,7 +55,7 @@ driver = odbc dsn = "Driver={Microsoft Access Driver (*.mdb)};Dbq=data/odbc.mdb" system = odbc -[odbc-pdo] +[odbc pdo] driver = pdo dsn = "odbc:Driver={Microsoft Access Driver (*.mdb)};Dbq=data/odbc.mdb" username = @@ -69,14 +69,14 @@ username = dibi password = system = sqlsrv -[mssql2005] +[sqlsrv] driver = mssql2005 host = (local) username = dibi password = system = sqlsrv -[sqlsrv-pdo] +[sqlsrv pdo] driver = pdo dsn = "sqlsrv:Server=127.0.0.1" username = dibi @@ -89,7 +89,7 @@ username = dibi password = system = oracle -[oracle-pdo] +[oracle pdo] driver = pdo dsn = "oci:dbname=dibi" username = dibi diff --git a/tests/dibi/DibiFluent.fetch.limit.phpt b/tests/dibi/DibiFluent.fetch.limit.phpt index a1fe1bcb..7ee7a352 100644 --- a/tests/dibi/DibiFluent.fetch.limit.phpt +++ b/tests/dibi/DibiFluent.fetch.limit.phpt @@ -1,7 +1,7 @@ loadFile(__DIR__ . "/data/$config[system].sql"); diff --git a/tests/dibi/DibiRow.phpt b/tests/dibi/DibiRow.phpt index 365e4450..8eb80fe6 100644 --- a/tests/dibi/DibiRow.phpt +++ b/tests/dibi/DibiRow.phpt @@ -1,7 +1,7 @@ getDriver()->getResource()->getAttribute(PDO::ATTR_SERVER_VERSION); diff --git a/tests/dibi/Postgre.like.phpt b/tests/dibi/Postgre.like.phpt index 26775cf3..5a271561 100644 --- a/tests/dibi/Postgre.like.phpt +++ b/tests/dibi/Postgre.like.phpt @@ -1,17 +1,13 @@ query("SELECT 'AAxBB' LIKE %~like~", 'A_B')->fetchSingle()); diff --git a/tests/dibi/meta.phpt b/tests/dibi/meta.phpt index ae5bab1e..e0a86ed6 100644 --- a/tests/dibi/meta.phpt +++ b/tests/dibi/meta.phpt @@ -1,22 +1,21 @@ loadFile(__DIR__ . "/data/$config[system].sql"); - -$meta = $conn->getDatabaseInfo(); +try { + $meta = $conn->getDatabaseInfo(); +} catch (DibiNotSupportedException $e) { + Tester\Environment::skip($e->getMessage()); +} Assert::same(3, count($meta->getTables()));