Unverified Commit 663fe259 authored by Sergei Morozov's avatar Sergei Morozov

Merge branch '2.11.x' into 3.0.x

parents e33c76a6 3c199249
...@@ -228,6 +228,10 @@ Please use other database client applications for import, e.g.: ...@@ -228,6 +228,10 @@ Please use other database client applications for import, e.g.:
# Upgrade to 2.11 # Upgrade to 2.11
## `Connection::getParams()` has been marked internal
Consumers of the Connection class should not rely on connection parameters stored in the connection object. If needed, they should be obtained from a different source, e.g. application configuration.
## Deprecated `Doctrine\DBAL\Driver::getDatabase()` ## Deprecated `Doctrine\DBAL\Driver::getDatabase()`
- The usage of `Doctrine\DBAL\Driver::getDatabase()` is deprecated. Please use `Doctrine\DBAL\Connection::getDatabase()` instead. - The usage of `Doctrine\DBAL\Driver::getDatabase()` is deprecated. Please use `Doctrine\DBAL\Connection::getDatabase()` instead.
......
...@@ -4,8 +4,73 @@ ...@@ -4,8 +4,73 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "81a912bd9d2a1715150a2d63fe40cef0", "content-hash": "ce60bfb3c7214de480c0b859a69fe820",
"packages": [ "packages": [
{
"name": "composer/package-versions-deprecated",
"version": "1.8.0",
"source": {
"type": "git",
"url": "https://github.com/composer/package-versions-deprecated.git",
"reference": "98df7f1b293c0550bd5b1ce6b60b59bdda23aa47"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/composer/package-versions-deprecated/zipball/98df7f1b293c0550bd5b1ce6b60b59bdda23aa47",
"reference": "98df7f1b293c0550bd5b1ce6b60b59bdda23aa47",
"shasum": ""
},
"require": {
"composer-plugin-api": "^1.1.0 || ^2.0",
"php": "^7"
},
"replace": {
"ocramius/package-versions": "1.2 - 1.8.99"
},
"require-dev": {
"composer/composer": "^1.9.3 || ^2.0@dev",
"ext-zip": "^1.13",
"phpunit/phpunit": "^6.5 || ^7"
},
"type": "composer-plugin",
"extra": {
"class": "PackageVersions\\Installer",
"branch-alias": {
"dev-master": "1.x-dev"
}
},
"autoload": {
"psr-4": {
"PackageVersions\\": "src/PackageVersions"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Marco Pivetta",
"email": "ocramius@gmail.com"
},
{
"name": "Jordi Boggiano",
"email": "j.boggiano@seld.be"
}
],
"description": "Composer plugin that provides efficient querying for installed package versions (no runtime IO)",
"funding": [
{
"url": "https://packagist.com",
"type": "custom"
},
{
"url": "https://tidelift.com/funding/github/packagist/composer/composer",
"type": "tidelift"
}
],
"time": "2020-04-23T11:49:37+00:00"
},
{ {
"name": "doctrine/cache", "name": "doctrine/cache",
"version": "v1.7.1", "version": "v1.7.1",
...@@ -153,56 +218,6 @@ ...@@ -153,56 +218,6 @@
"eventmanager" "eventmanager"
], ],
"time": "2018-06-11T11:59:03+00:00" "time": "2018-06-11T11:59:03+00:00"
},
{
"name": "ocramius/package-versions",
"version": "1.4.2",
"source": {
"type": "git",
"url": "https://github.com/Ocramius/PackageVersions.git",
"reference": "44af6f3a2e2e04f2af46bcb302ad9600cba41c7d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Ocramius/PackageVersions/zipball/44af6f3a2e2e04f2af46bcb302ad9600cba41c7d",
"reference": "44af6f3a2e2e04f2af46bcb302ad9600cba41c7d",
"shasum": ""
},
"require": {
"composer-plugin-api": "^1.0.0",
"php": "^7.1.0"
},
"require-dev": {
"composer/composer": "^1.6.3",
"doctrine/coding-standard": "^5.0.1",
"ext-zip": "*",
"infection/infection": "^0.7.1",
"phpunit/phpunit": "^7.5.17"
},
"type": "composer-plugin",
"extra": {
"class": "PackageVersions\\Installer",
"branch-alias": {
"dev-master": "2.0.x-dev"
}
},
"autoload": {
"psr-4": {
"PackageVersions\\": "src/PackageVersions"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Marco Pivetta",
"email": "ocramius@gmail.com"
}
],
"description": "Composer plugin that provides efficient querying for installed package versions (no runtime IO)",
"time": "2019-11-15T16:17:10+00:00"
} }
], ],
"packages-dev": [ "packages-dev": [
...@@ -584,20 +599,20 @@ ...@@ -584,20 +599,20 @@
}, },
{ {
"name": "doctrine/instantiator", "name": "doctrine/instantiator",
"version": "1.3.0", "version": "1.3.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/doctrine/instantiator.git", "url": "https://github.com/doctrine/instantiator.git",
"reference": "ae466f726242e637cebdd526a7d991b9433bacf1" "reference": "f350df0268e904597e3bd9c4685c53e0e333feea"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/doctrine/instantiator/zipball/ae466f726242e637cebdd526a7d991b9433bacf1", "url": "https://api.github.com/repos/doctrine/instantiator/zipball/f350df0268e904597e3bd9c4685c53e0e333feea",
"reference": "ae466f726242e637cebdd526a7d991b9433bacf1", "reference": "f350df0268e904597e3bd9c4685c53e0e333feea",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": "^7.1" "php": "^7.1 || ^8.0"
}, },
"require-dev": { "require-dev": {
"doctrine/coding-standard": "^6.0", "doctrine/coding-standard": "^6.0",
...@@ -636,7 +651,21 @@ ...@@ -636,7 +651,21 @@
"constructor", "constructor",
"instantiate" "instantiate"
], ],
"time": "2019-10-21T16:45:58+00:00" "funding": [
{
"url": "https://www.doctrine-project.org/sponsorship.html",
"type": "custom"
},
{
"url": "https://www.patreon.com/phpdoctrine",
"type": "patreon"
},
{
"url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator",
"type": "tidelift"
}
],
"time": "2020-05-29T17:27:14+00:00"
}, },
{ {
"name": "felixfbecker/advanced-json-rpc", "name": "felixfbecker/advanced-json-rpc",
...@@ -1489,16 +1518,16 @@ ...@@ -1489,16 +1518,16 @@
}, },
{ {
"name": "phpunit/php-file-iterator", "name": "phpunit/php-file-iterator",
"version": "3.0.1", "version": "3.0.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/php-file-iterator.git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git",
"reference": "4ac5b3e13df14829daa60a2eb4fdd2f2b7d33cf4" "reference": "eba15e538f2bb3fe018b7bbb47d2fe32d404bfd2"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/4ac5b3e13df14829daa60a2eb4fdd2f2b7d33cf4", "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/eba15e538f2bb3fe018b7bbb47d2fe32d404bfd2",
"reference": "4ac5b3e13df14829daa60a2eb4fdd2f2b7d33cf4", "reference": "eba15e538f2bb3fe018b7bbb47d2fe32d404bfd2",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
...@@ -1541,20 +1570,20 @@ ...@@ -1541,20 +1570,20 @@
"type": "github" "type": "github"
} }
], ],
"time": "2020-04-18T05:02:12+00:00" "time": "2020-06-15T12:54:35+00:00"
}, },
{ {
"name": "phpunit/php-invoker", "name": "phpunit/php-invoker",
"version": "3.0.0", "version": "3.0.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/php-invoker.git", "url": "https://github.com/sebastianbergmann/php-invoker.git",
"reference": "7579d5a1ba7f3ac11c80004d205877911315ae7a" "reference": "62f696ad0d140e0e513e69eaafdebb674d622b4c"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/7579d5a1ba7f3ac11c80004d205877911315ae7a", "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/62f696ad0d140e0e513e69eaafdebb674d622b4c",
"reference": "7579d5a1ba7f3ac11c80004d205877911315ae7a", "reference": "62f696ad0d140e0e513e69eaafdebb674d622b4c",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
...@@ -1594,25 +1623,34 @@ ...@@ -1594,25 +1623,34 @@
"keywords": [ "keywords": [
"process" "process"
], ],
"time": "2020-02-07T06:06:11+00:00" "funding": [
{
"url": "https://github.com/sebastianbergmann",
"type": "github"
}
],
"time": "2020-06-15T13:10:07+00:00"
}, },
{ {
"name": "phpunit/php-text-template", "name": "phpunit/php-text-template",
"version": "2.0.0", "version": "2.0.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/php-text-template.git", "url": "https://github.com/sebastianbergmann/php-text-template.git",
"reference": "526dc996cc0ebdfa428cd2dfccd79b7b53fee346" "reference": "0c69cbf965d5317ba33f24a352539f354a25db09"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/526dc996cc0ebdfa428cd2dfccd79b7b53fee346", "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/0c69cbf965d5317ba33f24a352539f354a25db09",
"reference": "526dc996cc0ebdfa428cd2dfccd79b7b53fee346", "reference": "0c69cbf965d5317ba33f24a352539f354a25db09",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": "^7.3" "php": "^7.3"
}, },
"require-dev": {
"phpunit/phpunit": "^9.0"
},
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
...@@ -1640,32 +1678,38 @@ ...@@ -1640,32 +1678,38 @@
"keywords": [ "keywords": [
"template" "template"
], ],
"time": "2020-02-01T07:43:44+00:00" "funding": [
{
"url": "https://github.com/sebastianbergmann",
"type": "github"
}
],
"time": "2020-06-15T12:52:43+00:00"
}, },
{ {
"name": "phpunit/php-timer", "name": "phpunit/php-timer",
"version": "3.1.4", "version": "5.0.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/php-timer.git", "url": "https://github.com/sebastianbergmann/php-timer.git",
"reference": "dc9368fae6ef2ffa57eba80a7410bcef81df6258" "reference": "b0d089de001ba60ffa3be36b23e1b8150d072238"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/dc9368fae6ef2ffa57eba80a7410bcef81df6258", "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/b0d089de001ba60ffa3be36b23e1b8150d072238",
"reference": "dc9368fae6ef2ffa57eba80a7410bcef81df6258", "reference": "b0d089de001ba60ffa3be36b23e1b8150d072238",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": "^7.3" "php": "^7.3"
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "^9.0" "phpunit/phpunit": "^9.2"
}, },
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "3.1-dev" "dev-master": "5.0-dev"
} }
}, },
"autoload": { "autoload": {
...@@ -1695,20 +1739,20 @@ ...@@ -1695,20 +1739,20 @@
"type": "github" "type": "github"
} }
], ],
"time": "2020-04-20T06:00:37+00:00" "time": "2020-06-07T12:05:53+00:00"
}, },
{ {
"name": "phpunit/php-token-stream", "name": "phpunit/php-token-stream",
"version": "4.0.1", "version": "4.0.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/php-token-stream.git", "url": "https://github.com/sebastianbergmann/php-token-stream.git",
"reference": "cdc0db5aed8fbfaf475fbd95bfd7bab83c7a779c" "reference": "e61c593e9734b47ef462340c24fca8d6a57da14e"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/cdc0db5aed8fbfaf475fbd95bfd7bab83c7a779c", "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/e61c593e9734b47ef462340c24fca8d6a57da14e",
"reference": "cdc0db5aed8fbfaf475fbd95bfd7bab83c7a779c", "reference": "e61c593e9734b47ef462340c24fca8d6a57da14e",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
...@@ -1750,20 +1794,20 @@ ...@@ -1750,20 +1794,20 @@
"type": "github" "type": "github"
} }
], ],
"time": "2020-05-06T09:56:31+00:00" "time": "2020-06-16T07:00:44+00:00"
}, },
{ {
"name": "phpunit/phpunit", "name": "phpunit/phpunit",
"version": "9.1.5", "version": "9.2.3",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git", "url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "1b570cd7edbe136055bf5f651857dc8af6b829d2" "reference": "c1b1d62095ef78427f112a7a1c1502d4607e3c00"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/1b570cd7edbe136055bf5f651857dc8af6b829d2", "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c1b1d62095ef78427f112a7a1c1502d4607e3c00",
"reference": "1b570cd7edbe136055bf5f651857dc8af6b829d2", "reference": "c1b1d62095ef78427f112a7a1c1502d4607e3c00",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
...@@ -1783,7 +1827,7 @@ ...@@ -1783,7 +1827,7 @@
"phpunit/php-file-iterator": "^3.0", "phpunit/php-file-iterator": "^3.0",
"phpunit/php-invoker": "^3.0", "phpunit/php-invoker": "^3.0",
"phpunit/php-text-template": "^2.0", "phpunit/php-text-template": "^2.0",
"phpunit/php-timer": "^3.1.4", "phpunit/php-timer": "^5.0",
"sebastian/code-unit": "^1.0.2", "sebastian/code-unit": "^1.0.2",
"sebastian/comparator": "^4.0", "sebastian/comparator": "^4.0",
"sebastian/diff": "^4.0", "sebastian/diff": "^4.0",
...@@ -1792,7 +1836,7 @@ ...@@ -1792,7 +1836,7 @@
"sebastian/global-state": "^4.0", "sebastian/global-state": "^4.0",
"sebastian/object-enumerator": "^4.0", "sebastian/object-enumerator": "^4.0",
"sebastian/resource-operations": "^3.0", "sebastian/resource-operations": "^3.0",
"sebastian/type": "^2.0", "sebastian/type": "^2.1",
"sebastian/version": "^3.0" "sebastian/version": "^3.0"
}, },
"require-dev": { "require-dev": {
...@@ -1809,7 +1853,7 @@ ...@@ -1809,7 +1853,7 @@
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "9.1-dev" "dev-master": "9.2-dev"
} }
}, },
"autoload": { "autoload": {
...@@ -1848,7 +1892,7 @@ ...@@ -1848,7 +1892,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2020-05-22T13:54:05+00:00" "time": "2020-06-15T10:51:34+00:00"
}, },
{ {
"name": "psalm/plugin-phpunit", "name": "psalm/plugin-phpunit",
...@@ -1950,16 +1994,16 @@ ...@@ -1950,16 +1994,16 @@
}, },
{ {
"name": "sebastian/code-unit", "name": "sebastian/code-unit",
"version": "1.0.2", "version": "1.0.3",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/code-unit.git", "url": "https://github.com/sebastianbergmann/code-unit.git",
"reference": "ac958085bc19fcd1d36425c781ef4cbb5b06e2a5" "reference": "d650ef9b1fece15ed4d6eaed6e6b469b7b81183a"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/ac958085bc19fcd1d36425c781ef4cbb5b06e2a5", "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/d650ef9b1fece15ed4d6eaed6e6b469b7b81183a",
"reference": "ac958085bc19fcd1d36425c781ef4cbb5b06e2a5", "reference": "d650ef9b1fece15ed4d6eaed6e6b469b7b81183a",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
...@@ -1998,20 +2042,20 @@ ...@@ -1998,20 +2042,20 @@
"type": "github" "type": "github"
} }
], ],
"time": "2020-04-30T05:58:10+00:00" "time": "2020-06-15T13:11:26+00:00"
}, },
{ {
"name": "sebastian/code-unit-reverse-lookup", "name": "sebastian/code-unit-reverse-lookup",
"version": "2.0.0", "version": "2.0.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git",
"reference": "5b5dbe0044085ac41df47e79d34911a15b96d82e" "reference": "c771130f0e8669104a4320b7101a81c2cc2963ef"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/5b5dbe0044085ac41df47e79d34911a15b96d82e", "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/c771130f0e8669104a4320b7101a81c2cc2963ef",
"reference": "5b5dbe0044085ac41df47e79d34911a15b96d82e", "reference": "c771130f0e8669104a4320b7101a81c2cc2963ef",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
...@@ -2043,20 +2087,26 @@ ...@@ -2043,20 +2087,26 @@
], ],
"description": "Looks up which function or method a line of code belongs to", "description": "Looks up which function or method a line of code belongs to",
"homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/",
"time": "2020-02-07T06:20:13+00:00" "funding": [
{
"url": "https://github.com/sebastianbergmann",
"type": "github"
}
],
"time": "2020-06-15T12:56:39+00:00"
}, },
{ {
"name": "sebastian/comparator", "name": "sebastian/comparator",
"version": "4.0.0", "version": "4.0.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/comparator.git", "url": "https://github.com/sebastianbergmann/comparator.git",
"reference": "85b3435da967696ed618ff745f32be3ff4a2b8e8" "reference": "266d85ef789da8c41f06af4093c43e9798af2784"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/85b3435da967696ed618ff745f32be3ff4a2b8e8", "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/266d85ef789da8c41f06af4093c43e9798af2784",
"reference": "85b3435da967696ed618ff745f32be3ff4a2b8e8", "reference": "266d85ef789da8c41f06af4093c43e9798af2784",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
...@@ -2107,7 +2157,13 @@ ...@@ -2107,7 +2157,13 @@
"compare", "compare",
"equality" "equality"
], ],
"time": "2020-02-07T06:08:51+00:00" "funding": [
{
"url": "https://github.com/sebastianbergmann",
"type": "github"
}
],
"time": "2020-06-15T15:04:48+00:00"
}, },
{ {
"name": "sebastian/diff", "name": "sebastian/diff",
...@@ -2173,16 +2229,16 @@ ...@@ -2173,16 +2229,16 @@
}, },
{ {
"name": "sebastian/environment", "name": "sebastian/environment",
"version": "5.1.0", "version": "5.1.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/environment.git", "url": "https://github.com/sebastianbergmann/environment.git",
"reference": "c753f04d68cd489b6973cf9b4e505e191af3b05c" "reference": "16eb0fa43e29c33d7f2117ed23072e26fc5ab34e"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/c753f04d68cd489b6973cf9b4e505e191af3b05c", "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/16eb0fa43e29c33d7f2117ed23072e26fc5ab34e",
"reference": "c753f04d68cd489b6973cf9b4e505e191af3b05c", "reference": "16eb0fa43e29c33d7f2117ed23072e26fc5ab34e",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
...@@ -2228,20 +2284,20 @@ ...@@ -2228,20 +2284,20 @@
"type": "github" "type": "github"
} }
], ],
"time": "2020-04-14T13:36:52+00:00" "time": "2020-06-15T13:00:01+00:00"
}, },
{ {
"name": "sebastian/exporter", "name": "sebastian/exporter",
"version": "4.0.0", "version": "4.0.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/exporter.git", "url": "https://github.com/sebastianbergmann/exporter.git",
"reference": "80c26562e964016538f832f305b2286e1ec29566" "reference": "d12fbca85da932d01d941b59e4b71a0d559db091"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/80c26562e964016538f832f305b2286e1ec29566", "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/d12fbca85da932d01d941b59e4b71a0d559db091",
"reference": "80c26562e964016538f832f305b2286e1ec29566", "reference": "d12fbca85da932d01d941b59e4b71a0d559db091",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
...@@ -2295,7 +2351,13 @@ ...@@ -2295,7 +2351,13 @@
"export", "export",
"exporter" "exporter"
], ],
"time": "2020-02-07T06:10:52+00:00" "funding": [
{
"url": "https://github.com/sebastianbergmann",
"type": "github"
}
],
"time": "2020-06-15T13:12:44+00:00"
}, },
{ {
"name": "sebastian/global-state", "name": "sebastian/global-state",
...@@ -2353,16 +2415,16 @@ ...@@ -2353,16 +2415,16 @@
}, },
{ {
"name": "sebastian/object-enumerator", "name": "sebastian/object-enumerator",
"version": "4.0.0", "version": "4.0.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/object-enumerator.git", "url": "https://github.com/sebastianbergmann/object-enumerator.git",
"reference": "e67516b175550abad905dc952f43285957ef4363" "reference": "15f319d67c49fc55ebcdbffb3377433125588455"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/e67516b175550abad905dc952f43285957ef4363", "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/15f319d67c49fc55ebcdbffb3377433125588455",
"reference": "e67516b175550abad905dc952f43285957ef4363", "reference": "15f319d67c49fc55ebcdbffb3377433125588455",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
...@@ -2396,20 +2458,26 @@ ...@@ -2396,20 +2458,26 @@
], ],
"description": "Traverses array structures and object graphs to enumerate all referenced objects", "description": "Traverses array structures and object graphs to enumerate all referenced objects",
"homepage": "https://github.com/sebastianbergmann/object-enumerator/", "homepage": "https://github.com/sebastianbergmann/object-enumerator/",
"time": "2020-02-07T06:12:23+00:00" "funding": [
{
"url": "https://github.com/sebastianbergmann",
"type": "github"
}
],
"time": "2020-06-15T13:15:25+00:00"
}, },
{ {
"name": "sebastian/object-reflector", "name": "sebastian/object-reflector",
"version": "2.0.0", "version": "2.0.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/object-reflector.git", "url": "https://github.com/sebastianbergmann/object-reflector.git",
"reference": "f4fd0835cabb0d4a6546d9fe291e5740037aa1e7" "reference": "14e04b3c25b821cc0702d4837803fe497680b062"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/f4fd0835cabb0d4a6546d9fe291e5740037aa1e7", "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/14e04b3c25b821cc0702d4837803fe497680b062",
"reference": "f4fd0835cabb0d4a6546d9fe291e5740037aa1e7", "reference": "14e04b3c25b821cc0702d4837803fe497680b062",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
...@@ -2441,20 +2509,26 @@ ...@@ -2441,20 +2509,26 @@
], ],
"description": "Allows reflection of object attributes, including inherited and non-public ones", "description": "Allows reflection of object attributes, including inherited and non-public ones",
"homepage": "https://github.com/sebastianbergmann/object-reflector/", "homepage": "https://github.com/sebastianbergmann/object-reflector/",
"time": "2020-02-07T06:19:40+00:00" "funding": [
{
"url": "https://github.com/sebastianbergmann",
"type": "github"
}
],
"time": "2020-06-15T13:08:02+00:00"
}, },
{ {
"name": "sebastian/recursion-context", "name": "sebastian/recursion-context",
"version": "4.0.0", "version": "4.0.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/recursion-context.git", "url": "https://github.com/sebastianbergmann/recursion-context.git",
"reference": "cdd86616411fc3062368b720b0425de10bd3d579" "reference": "a32789e5f0157c10cf216ce6c5136db12a12b847"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/cdd86616411fc3062368b720b0425de10bd3d579", "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/a32789e5f0157c10cf216ce6c5136db12a12b847",
"reference": "cdd86616411fc3062368b720b0425de10bd3d579", "reference": "a32789e5f0157c10cf216ce6c5136db12a12b847",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
...@@ -2494,20 +2568,26 @@ ...@@ -2494,20 +2568,26 @@
], ],
"description": "Provides functionality to recursively process PHP variables", "description": "Provides functionality to recursively process PHP variables",
"homepage": "http://www.github.com/sebastianbergmann/recursion-context", "homepage": "http://www.github.com/sebastianbergmann/recursion-context",
"time": "2020-02-07T06:18:20+00:00" "funding": [
{
"url": "https://github.com/sebastianbergmann",
"type": "github"
}
],
"time": "2020-06-15T13:06:44+00:00"
}, },
{ {
"name": "sebastian/resource-operations", "name": "sebastian/resource-operations",
"version": "3.0.0", "version": "3.0.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/resource-operations.git", "url": "https://github.com/sebastianbergmann/resource-operations.git",
"reference": "8c98bf0dfa1f9256d0468b9803a1e1df31b6fa98" "reference": "71421c1745788de4facae1b79af923650bd3ec15"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/8c98bf0dfa1f9256d0468b9803a1e1df31b6fa98", "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/71421c1745788de4facae1b79af923650bd3ec15",
"reference": "8c98bf0dfa1f9256d0468b9803a1e1df31b6fa98", "reference": "71421c1745788de4facae1b79af923650bd3ec15",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
...@@ -2539,32 +2619,38 @@ ...@@ -2539,32 +2619,38 @@
], ],
"description": "Provides a list of PHP built-in functions that operate on resources", "description": "Provides a list of PHP built-in functions that operate on resources",
"homepage": "https://www.github.com/sebastianbergmann/resource-operations", "homepage": "https://www.github.com/sebastianbergmann/resource-operations",
"time": "2020-02-07T06:13:02+00:00" "funding": [
{
"url": "https://github.com/sebastianbergmann",
"type": "github"
}
],
"time": "2020-06-15T13:17:14+00:00"
}, },
{ {
"name": "sebastian/type", "name": "sebastian/type",
"version": "2.0.0", "version": "2.1.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/type.git", "url": "https://github.com/sebastianbergmann/type.git",
"reference": "9e8f42f740afdea51f5f4e8cec2035580e797ee1" "reference": "bad49207c6f854e7a25cef0ea948ac8ebe3ef9d8"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/type/zipball/9e8f42f740afdea51f5f4e8cec2035580e797ee1", "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/bad49207c6f854e7a25cef0ea948ac8ebe3ef9d8",
"reference": "9e8f42f740afdea51f5f4e8cec2035580e797ee1", "reference": "bad49207c6f854e7a25cef0ea948ac8ebe3ef9d8",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": "^7.3" "php": "^7.3"
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "^9.0" "phpunit/phpunit": "^9.2"
}, },
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "2.0-dev" "dev-master": "2.1-dev"
} }
}, },
"autoload": { "autoload": {
...@@ -2585,7 +2671,13 @@ ...@@ -2585,7 +2671,13 @@
], ],
"description": "Collection of value objects that represent the types of the PHP type system", "description": "Collection of value objects that represent the types of the PHP type system",
"homepage": "https://github.com/sebastianbergmann/type", "homepage": "https://github.com/sebastianbergmann/type",
"time": "2020-02-07T06:13:43+00:00" "funding": [
{
"url": "https://github.com/sebastianbergmann",
"type": "github"
}
],
"time": "2020-06-01T12:21:09+00:00"
}, },
{ {
"name": "sebastian/version", "name": "sebastian/version",
......
...@@ -101,6 +101,11 @@ ...@@ -101,6 +101,11 @@
<exclude-pattern>src/Driver/SQLSrv/Result.php</exclude-pattern> <exclude-pattern>src/Driver/SQLSrv/Result.php</exclude-pattern>
</rule> </rule>
<!-- See https://github.com/slevomat/coding-standard/issues/1038 -->
<rule ref="SlevomatCodingStandard.Namespaces.UnusedUses">
<exclude-pattern>tests/Functional/Driver/IBMDB2/DB2StatementTest.php</exclude-pattern>
</rule>
<!-- see https://github.com/doctrine/dbal/issues/3377 --> <!-- see https://github.com/doctrine/dbal/issues/3377 -->
<rule ref="SlevomatCodingStandard.Operators.DisallowEqualOperators.DisallowedNotEqualOperator"> <rule ref="SlevomatCodingStandard.Operators.DisallowEqualOperators.DisallowedNotEqualOperator">
<exclude-pattern>src/Schema/Comparator.php</exclude-pattern> <exclude-pattern>src/Schema/Comparator.php</exclude-pattern>
......
...@@ -189,6 +189,8 @@ class Connection implements DriverConnection ...@@ -189,6 +189,8 @@ class Connection implements DriverConnection
/** /**
* Gets the parameters used during instantiation. * Gets the parameters used during instantiation.
* *
* @internal
*
* @return mixed[] * @return mixed[]
*/ */
public function getParams() public function getParams()
...@@ -987,7 +989,7 @@ class Connection implements DriverConnection ...@@ -987,7 +989,7 @@ class Connection implements DriverConnection
throw CacheException::noResultDriverConfigured(); throw CacheException::noResultDriverConfigured();
} }
$connectionParams = $this->getParams(); $connectionParams = $this->params;
unset($connectionParams['platform']); unset($connectionParams['platform']);
[$cacheKey, $realKey] = $qcp->generateCacheKeys($query, $params, $types, $connectionParams); [$cacheKey, $realKey] = $qcp->generateCacheKeys($query, $params, $types, $connectionParams);
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Driver\AbstractSQLServerDriver;
use Doctrine\DBAL\Driver\AbstractDriverException;
/**
* @internal
*
* @psalm-immutable
*/
final class PortWithoutHost extends AbstractDriverException
{
public static function new(): self
{
return new self('Connection port specified without the host');
}
}
...@@ -2,6 +2,9 @@ ...@@ -2,6 +2,9 @@
namespace Doctrine\DBAL\Driver\IBMDB2; namespace Doctrine\DBAL\Driver\IBMDB2;
use Doctrine\DBAL\Driver\IBMDB2\Exception\ConnectionError;
use Doctrine\DBAL\Driver\IBMDB2\Exception\ConnectionFailed;
use Doctrine\DBAL\Driver\IBMDB2\Exception\PrepareFailed;
use Doctrine\DBAL\Driver\Result as ResultInterface; use Doctrine\DBAL\Driver\Result as ResultInterface;
use Doctrine\DBAL\Driver\ServerInfoAwareConnection; use Doctrine\DBAL\Driver\ServerInfoAwareConnection;
use Doctrine\DBAL\Driver\Statement as DriverStatement; use Doctrine\DBAL\Driver\Statement as DriverStatement;
...@@ -11,7 +14,6 @@ use stdClass; ...@@ -11,7 +14,6 @@ use stdClass;
use function assert; use function assert;
use function db2_autocommit; use function db2_autocommit;
use function db2_commit; use function db2_commit;
use function db2_conn_errormsg;
use function db2_connect; use function db2_connect;
use function db2_escape_string; use function db2_escape_string;
use function db2_exec; use function db2_exec;
...@@ -21,7 +23,7 @@ use function db2_pconnect; ...@@ -21,7 +23,7 @@ use function db2_pconnect;
use function db2_prepare; use function db2_prepare;
use function db2_rollback; use function db2_rollback;
use function db2_server_info; use function db2_server_info;
use function db2_stmt_errormsg; use function error_get_last;
use function is_bool; use function is_bool;
use const DB2_AUTOCOMMIT_OFF; use const DB2_AUTOCOMMIT_OFF;
...@@ -51,7 +53,7 @@ class DB2Connection implements ServerInfoAwareConnection ...@@ -51,7 +53,7 @@ class DB2Connection implements ServerInfoAwareConnection
} }
if ($conn === false) { if ($conn === false) {
throw new DB2Exception(db2_conn_errormsg()); throw ConnectionFailed::new();
} }
$this->conn = $conn; $this->conn = $conn;
...@@ -79,8 +81,9 @@ class DB2Connection implements ServerInfoAwareConnection ...@@ -79,8 +81,9 @@ class DB2Connection implements ServerInfoAwareConnection
public function prepare(string $sql): DriverStatement public function prepare(string $sql): DriverStatement
{ {
$stmt = @db2_prepare($this->conn, $sql); $stmt = @db2_prepare($this->conn, $sql);
if ($stmt === false) { if ($stmt === false) {
throw new DB2Exception(db2_stmt_errormsg()); throw PrepareFailed::new(error_get_last()['message']);
} }
return new DB2Statement($stmt); return new DB2Statement($stmt);
...@@ -110,7 +113,7 @@ class DB2Connection implements ServerInfoAwareConnection ...@@ -110,7 +113,7 @@ class DB2Connection implements ServerInfoAwareConnection
$stmt = @db2_exec($this->conn, $statement); $stmt = @db2_exec($this->conn, $statement);
if ($stmt === false) { if ($stmt === false) {
throw new DB2Exception(db2_stmt_errormsg()); throw ConnectionError::new($this->conn);
} }
return db2_num_rows($stmt); return db2_num_rows($stmt);
...@@ -141,7 +144,7 @@ class DB2Connection implements ServerInfoAwareConnection ...@@ -141,7 +144,7 @@ class DB2Connection implements ServerInfoAwareConnection
public function commit() public function commit()
{ {
if (! db2_commit($this->conn)) { if (! db2_commit($this->conn)) {
throw new DB2Exception(db2_conn_errormsg($this->conn)); throw ConnectionError::new($this->conn);
} }
$result = db2_autocommit($this->conn, DB2_AUTOCOMMIT_ON); $result = db2_autocommit($this->conn, DB2_AUTOCOMMIT_ON);
...@@ -156,7 +159,7 @@ class DB2Connection implements ServerInfoAwareConnection ...@@ -156,7 +159,7 @@ class DB2Connection implements ServerInfoAwareConnection
public function rollBack() public function rollBack()
{ {
if (! db2_rollback($this->conn)) { if (! db2_rollback($this->conn)) {
throw new DB2Exception(db2_conn_errormsg($this->conn)); throw ConnectionError::new($this->conn);
} }
$result = db2_autocommit($this->conn, DB2_AUTOCOMMIT_ON); $result = db2_autocommit($this->conn, DB2_AUTOCOMMIT_ON);
......
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
namespace Doctrine\DBAL\Driver\IBMDB2; namespace Doctrine\DBAL\Driver\IBMDB2;
use Exception; use Doctrine\DBAL\Driver\AbstractDriverException;
/** /**
* @psalm-immutable * @psalm-immutable
*/ */
class DB2Exception extends Exception class DB2Exception extends AbstractDriverException
{ {
} }
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
namespace Doctrine\DBAL\Driver\IBMDB2; namespace Doctrine\DBAL\Driver\IBMDB2;
use Doctrine\DBAL\Driver\IBMDB2\Exception\StatementError;
use Doctrine\DBAL\Driver\Result as ResultInterface; use Doctrine\DBAL\Driver\Result as ResultInterface;
use Doctrine\DBAL\Driver\Statement; use Doctrine\DBAL\Driver\Statement;
use Doctrine\DBAL\ParameterType; use Doctrine\DBAL\ParameterType;
...@@ -9,7 +10,6 @@ use Doctrine\DBAL\ParameterType; ...@@ -9,7 +10,6 @@ use Doctrine\DBAL\ParameterType;
use function assert; use function assert;
use function db2_bind_param; use function db2_bind_param;
use function db2_execute; use function db2_execute;
use function db2_stmt_errormsg;
use function error_get_last; use function error_get_last;
use function fclose; use function fclose;
use function fwrite; use function fwrite;
...@@ -103,7 +103,7 @@ class DB2Statement implements Statement ...@@ -103,7 +103,7 @@ class DB2Statement implements Statement
$this->bindParam[$position] =& $variable; $this->bindParam[$position] =& $variable;
if (! db2_bind_param($this->stmt, $position, 'variable', $parameterType, $dataType)) { if (! db2_bind_param($this->stmt, $position, 'variable', $parameterType, $dataType)) {
throw new DB2Exception(db2_stmt_errormsg()); throw StatementError::new($this->stmt);
} }
} }
...@@ -141,7 +141,7 @@ class DB2Statement implements Statement ...@@ -141,7 +141,7 @@ class DB2Statement implements Statement
$this->lobs = []; $this->lobs = [];
if ($result === false) { if ($result === false) {
throw new DB2Exception(db2_stmt_errormsg()); throw StatementError::new($this->stmt);
} }
return new Result($this->stmt); return new Result($this->stmt);
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Driver\IBMDB2\Exception;
use Doctrine\DBAL\Driver\IBMDB2\DB2Exception;
use function db2_conn_error;
use function db2_conn_errormsg;
/**
* @psalm-immutable
*/
final class ConnectionError extends DB2Exception
{
/**
* @param resource $connection
*/
public static function new($connection): self
{
return new self(db2_conn_errormsg($connection), db2_conn_error($connection));
}
}
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Driver\IBMDB2\Exception;
use Doctrine\DBAL\Driver\IBMDB2\DB2Exception;
use function db2_conn_error;
use function db2_conn_errormsg;
/**
* @psalm-immutable
*/
final class ConnectionFailed extends DB2Exception
{
public static function new(): self
{
return new self(db2_conn_errormsg(), db2_conn_error());
}
}
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Driver\IBMDB2\Exception;
use Doctrine\DBAL\Driver\IBMDB2\DB2Exception;
/**
* @psalm-immutable
*/
final class PrepareFailed extends DB2Exception
{
public static function new(string $message): self
{
return new self($message);
}
}
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Driver\IBMDB2\Exception;
use Doctrine\DBAL\Driver\IBMDB2\DB2Exception;
use function db2_stmt_error;
use function db2_stmt_errormsg;
/**
* @psalm-immutable
*/
final class StatementError extends DB2Exception
{
/**
* @param resource $statement
*/
public static function new($statement): self
{
return new self(db2_stmt_errormsg($statement), db2_stmt_error($statement));
}
}
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
namespace Doctrine\DBAL\Driver\PDOSqlsrv; namespace Doctrine\DBAL\Driver\PDOSqlsrv;
use Doctrine\DBAL\Driver\AbstractSQLServerDriver; use Doctrine\DBAL\Driver\AbstractSQLServerDriver;
use Doctrine\DBAL\Driver\AbstractSQLServerDriver\PortWithoutHost;
use PDO; use PDO;
use function is_int; use function is_int;
...@@ -56,10 +57,12 @@ class Driver extends AbstractSQLServerDriver ...@@ -56,10 +57,12 @@ class Driver extends AbstractSQLServerDriver
if (isset($params['host'])) { if (isset($params['host'])) {
$dsn .= $params['host']; $dsn .= $params['host'];
}
if (isset($params['port'])) { if (isset($params['port'])) {
$dsn .= ',' . $params['port']; $dsn .= ',' . $params['port'];
}
} elseif (isset($params['port'])) {
throw PortWithoutHost::new();
} }
if (isset($params['dbname'])) { if (isset($params['dbname'])) {
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
namespace Doctrine\DBAL\Driver\SQLSrv; namespace Doctrine\DBAL\Driver\SQLSrv;
use Doctrine\DBAL\Driver\AbstractSQLServerDriver; use Doctrine\DBAL\Driver\AbstractSQLServerDriver;
use Doctrine\DBAL\Driver\AbstractSQLServerDriver\PortWithoutHost;
/** /**
* Driver for ext/sqlsrv. * Driver for ext/sqlsrv.
...@@ -14,13 +15,16 @@ class Driver extends AbstractSQLServerDriver ...@@ -14,13 +15,16 @@ class Driver extends AbstractSQLServerDriver
*/ */
public function connect(array $params) public function connect(array $params)
{ {
if (! isset($params['host'])) { $serverName = '';
throw new SQLSrvException("Missing 'host' in configuration for sqlsrv driver.");
} if (isset($params['host'])) {
$serverName = $params['host'];
$serverName = $params['host']; if (isset($params['port'])) {
if (isset($params['port'])) { $serverName .= ',' . $params['port'];
$serverName .= ', ' . $params['port']; }
} elseif (isset($params['port'])) {
throw PortWithoutHost::new();
} }
$driverOptions = $params['driver_options'] ?? []; $driverOptions = $params['driver_options'] ?? [];
......
...@@ -4,6 +4,7 @@ namespace Doctrine\DBAL\Id; ...@@ -4,6 +4,7 @@ namespace Doctrine\DBAL\Id;
use Doctrine\DBAL\Connection; use Doctrine\DBAL\Connection;
use Doctrine\DBAL\DBALException; use Doctrine\DBAL\DBALException;
use Doctrine\DBAL\Driver;
use Doctrine\DBAL\DriverManager; use Doctrine\DBAL\DriverManager;
use Doctrine\DBAL\LockMode; use Doctrine\DBAL\LockMode;
use Throwable; use Throwable;
...@@ -69,12 +70,16 @@ class TableGenerator ...@@ -69,12 +70,16 @@ class TableGenerator
*/ */
public function __construct(Connection $conn, $generatorTableName = 'sequences') public function __construct(Connection $conn, $generatorTableName = 'sequences')
{ {
$params = $conn->getParams(); if ($conn->getDriver() instanceof Driver\PDOSqlite\Driver) {
if ($params['driver'] === 'pdo_sqlite') {
throw new DBALException('Cannot use TableGenerator with SQLite.'); throw new DBALException('Cannot use TableGenerator with SQLite.');
} }
$this->conn = DriverManager::getConnection($params, $conn->getConfiguration(), $conn->getEventManager()); $this->conn = DriverManager::getConnection(
$conn->getParams(),
$conn->getConfiguration(),
$conn->getEventManager()
);
$this->generatorTableName = $generatorTableName; $this->generatorTableName = $generatorTableName;
} }
......
...@@ -3,20 +3,14 @@ ...@@ -3,20 +3,14 @@
namespace Doctrine\DBAL\Tests\Driver; namespace Doctrine\DBAL\Tests\Driver;
use Doctrine\DBAL\Connection; use Doctrine\DBAL\Connection;
use Doctrine\DBAL\Driver; use Doctrine\DBAL\Driver\AbstractSQLServerDriver\PortWithoutHost;
use Doctrine\DBAL\Driver\AbstractSQLServerDriver;
use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Platforms\SQLServer2012Platform; use Doctrine\DBAL\Platforms\SQLServer2012Platform;
use Doctrine\DBAL\Schema\AbstractSchemaManager; use Doctrine\DBAL\Schema\AbstractSchemaManager;
use Doctrine\DBAL\Schema\SQLServerSchemaManager; use Doctrine\DBAL\Schema\SQLServerSchemaManager;
class AbstractSQLServerDriverTest extends AbstractDriverTest abstract class AbstractSQLServerDriverTest extends AbstractDriverTest
{ {
protected function createDriver(): Driver
{
return $this->getMockForAbstractClass(AbstractSQLServerDriver::class);
}
protected function createPlatform(): AbstractPlatform protected function createPlatform(): AbstractPlatform
{ {
return new SQLServer2012Platform(); return new SQLServer2012Platform();
...@@ -36,4 +30,10 @@ class AbstractSQLServerDriverTest extends AbstractDriverTest ...@@ -36,4 +30,10 @@ class AbstractSQLServerDriverTest extends AbstractDriverTest
['12', SQLServer2012Platform::class], ['12', SQLServer2012Platform::class],
]; ];
} }
public function testPortWithoutHost(): void
{
$this->expectException(PortWithoutHost::class);
$this->driver->connect(['port' => 1433]);
}
} }
...@@ -5,6 +5,7 @@ namespace Doctrine\DBAL\Tests\Functional; ...@@ -5,6 +5,7 @@ namespace Doctrine\DBAL\Tests\Functional;
use DateTime; use DateTime;
use Doctrine\DBAL\Connection; use Doctrine\DBAL\Connection;
use Doctrine\DBAL\DBALException; use Doctrine\DBAL\DBALException;
use Doctrine\DBAL\Driver\IBMDB2\DB2Driver;
use Doctrine\DBAL\Driver\Mysqli\Driver as MySQLiDriver; use Doctrine\DBAL\Driver\Mysqli\Driver as MySQLiDriver;
use Doctrine\DBAL\Driver\SQLSrv\Driver as SQLSrvDriver; use Doctrine\DBAL\Driver\SQLSrv\Driver as SQLSrvDriver;
use Doctrine\DBAL\ParameterType; use Doctrine\DBAL\ParameterType;
...@@ -191,8 +192,9 @@ class DataAccessTest extends FunctionalTestCase ...@@ -191,8 +192,9 @@ class DataAccessTest extends FunctionalTestCase
/** /**
* @group DBAL-209 * @group DBAL-209
* @dataProvider fetchProvider
*/ */
public function testFetchAllWithMissingTypes(): void public function testFetchAllWithMissingTypes(callable $fetch): void
{ {
if ( if (
$this->connection->getDriver() instanceof MySQLiDriver || $this->connection->getDriver() instanceof MySQLiDriver ||
...@@ -201,13 +203,51 @@ class DataAccessTest extends FunctionalTestCase ...@@ -201,13 +203,51 @@ class DataAccessTest extends FunctionalTestCase
self::markTestSkipped('mysqli and sqlsrv actually supports this'); self::markTestSkipped('mysqli and sqlsrv actually supports this');
} }
if (
$this->connection->getDriver() instanceof DB2Driver
) {
$this->markTestSkipped(
'ibm_ibm2 may or may not report the error depending on the PHP version and the connection state'
);
}
$datetimeString = '2010-01-01 10:10:10'; $datetimeString = '2010-01-01 10:10:10';
$datetime = new DateTime($datetimeString); $datetime = new DateTime($datetimeString);
$sql = 'SELECT test_int, test_datetime FROM fetch_table WHERE test_int = ? AND test_datetime = ?'; $sql = 'SELECT test_int, test_datetime FROM fetch_table WHERE test_int = ? AND test_datetime = ?';
$this->expectException(DBALException::class); $this->expectException(DBALException::class);
$this->connection->fetchAllAssociative($sql, [1, $datetime]); $fetch($this->connection, $sql, [1, $datetime]);
}
/**
* @return iterable<string,array{0:callable}>
*/
public static function fetchProvider(): iterable
{
yield 'fetch-all-associative' => [
static function (Connection $connection, string $query, array $params): void {
$connection->fetchAllAssociative($query, $params);
},
];
yield 'fetch-numeric' => [
static function (Connection $connection, string $query, array $params): void {
$connection->fetchNumeric($query, $params);
},
];
yield 'fetch-associative' => [
static function (Connection $connection, string $query, array $params): void {
$connection->fetchAssociative($query, $params);
},
];
yield 'fetch-one' => [
static function (Connection $connection, string $query, array $params): void {
$connection->fetchOne($query, $params);
},
];
} }
public function testFetchNoResult(): void public function testFetchNoResult(): void
...@@ -250,24 +290,6 @@ class DataAccessTest extends FunctionalTestCase ...@@ -250,24 +290,6 @@ class DataAccessTest extends FunctionalTestCase
self::assertStringStartsWith($datetimeString, $row['test_datetime']); self::assertStringStartsWith($datetimeString, $row['test_datetime']);
} }
public function testFetchAssocWithMissingTypes(): void
{
if (
$this->connection->getDriver() instanceof MySQLiDriver ||
$this->connection->getDriver() instanceof SQLSrvDriver
) {
self::markTestSkipped('mysqli and sqlsrv actually supports this');
}
$datetimeString = '2010-01-01 10:10:10';
$datetime = new DateTime($datetimeString);
$sql = 'SELECT test_int, test_datetime FROM fetch_table WHERE test_int = ? AND test_datetime = ?';
$this->expectException(DBALException::class);
$this->connection->fetchAssociative($sql, [1, $datetime]);
}
public function testFetchArray(): void public function testFetchArray(): void
{ {
$sql = 'SELECT test_int, test_string FROM fetch_table WHERE test_int = ? AND test_string = ?'; $sql = 'SELECT test_int, test_string FROM fetch_table WHERE test_int = ? AND test_string = ?';
...@@ -297,25 +319,7 @@ class DataAccessTest extends FunctionalTestCase ...@@ -297,25 +319,7 @@ class DataAccessTest extends FunctionalTestCase
self::assertStringStartsWith($datetimeString, $row[1]); self::assertStringStartsWith($datetimeString, $row[1]);
} }
public function testFetchArrayWithMissingTypes(): void public function testFetchColumn(): void
{
if (
$this->connection->getDriver() instanceof MySQLiDriver ||
$this->connection->getDriver() instanceof SQLSrvDriver
) {
self::markTestSkipped('mysqli and sqlsrv actually supports this');
}
$datetimeString = '2010-01-01 10:10:10';
$datetime = new DateTime($datetimeString);
$sql = 'SELECT test_int, test_datetime FROM fetch_table WHERE test_int = ? AND test_datetime = ?';
$this->expectException(DBALException::class);
$this->connection->fetchNumeric($sql, [1, $datetime]);
}
public function testFetchOne(): void
{ {
$sql = 'SELECT test_int FROM fetch_table WHERE test_int = ? AND test_string = ?'; $sql = 'SELECT test_int FROM fetch_table WHERE test_int = ? AND test_string = ?';
$testInt = $this->connection->fetchOne($sql, [1, 'foo']); $testInt = $this->connection->fetchOne($sql, [1, 'foo']);
...@@ -345,24 +349,6 @@ class DataAccessTest extends FunctionalTestCase ...@@ -345,24 +349,6 @@ class DataAccessTest extends FunctionalTestCase
self::assertStringStartsWith($datetimeString, $column); self::assertStringStartsWith($datetimeString, $column);
} }
public function testFetchOneWithMissingTypes(): void
{
if (
$this->connection->getDriver() instanceof MySQLiDriver ||
$this->connection->getDriver() instanceof SQLSrvDriver
) {
self::markTestSkipped('mysqli and sqlsrv actually supports this');
}
$datetimeString = '2010-01-01 10:10:10';
$datetime = new DateTime($datetimeString);
$sql = 'SELECT test_int, test_datetime FROM fetch_table WHERE test_int = ? AND test_datetime = ?';
$this->expectException(DBALException::class);
$this->connection->fetchOne($sql, [1, $datetime]);
}
/** /**
* @group DDC-697 * @group DDC-697
*/ */
......
<?php
namespace Doctrine\DBAL\Tests\Functional\Driver\IBMDB2;
use Doctrine\DBAL\Driver\IBMDB2\DB2Connection;
use Doctrine\DBAL\Driver\IBMDB2\DB2Driver;
use Doctrine\DBAL\Driver\IBMDB2\Exception\ConnectionFailed;
use Doctrine\DBAL\Driver\IBMDB2\Exception\PrepareFailed;
use Doctrine\DBAL\Tests\FunctionalTestCase;
use ReflectionProperty;
use function db2_close;
use function extension_loaded;
class ConnectionTest extends FunctionalTestCase
{
protected function setUp(): void
{
if (! extension_loaded('ibm_db2')) {
$this->markTestSkipped('ibm_db2 is not installed.');
}
parent::setUp();
if ($this->connection->getDriver() instanceof DB2Driver) {
return;
}
$this->markTestSkipped('ibm_db2 only test.');
}
protected function tearDown(): void
{
$this->resetSharedConn();
}
public function testConnectionFailure(): void
{
$this->expectException(ConnectionFailed::class);
new DB2Connection('garbage', false, '', '');
}
public function testPrepareFailure(): void
{
$driverConnection = $this->connection->getWrappedConnection();
$re = new ReflectionProperty($driverConnection, 'conn');
$re->setAccessible(true);
$conn = $re->getValue($driverConnection);
db2_close($conn);
$this->expectException(PrepareFailed::class);
$driverConnection->prepare('SELECT 1');
}
}
...@@ -5,10 +5,15 @@ declare(strict_types=1); ...@@ -5,10 +5,15 @@ declare(strict_types=1);
namespace Doctrine\DBAL\Tests\Functional\Driver\IBMDB2; namespace Doctrine\DBAL\Tests\Functional\Driver\IBMDB2;
use Doctrine\DBAL\Driver\IBMDB2\DB2Driver; use Doctrine\DBAL\Driver\IBMDB2\DB2Driver;
use Doctrine\DBAL\Driver\IBMDB2\Exception\StatementError;
use Doctrine\DBAL\Tests\FunctionalTestCase; use Doctrine\DBAL\Tests\FunctionalTestCase;
use function extension_loaded; use function extension_loaded;
use const E_ALL;
use const E_NOTICE;
use const E_WARNING;
class DB2StatementTest extends FunctionalTestCase class DB2StatementTest extends FunctionalTestCase
{ {
protected function setUp(): void protected function setUp(): void
...@@ -28,12 +33,14 @@ class DB2StatementTest extends FunctionalTestCase ...@@ -28,12 +33,14 @@ class DB2StatementTest extends FunctionalTestCase
public function testExecutionErrorsAreNotSuppressed(): void public function testExecutionErrorsAreNotSuppressed(): void
{ {
$stmt = $this->connection->prepare('SELECT * FROM SYSIBM.SYSDUMMY1 WHERE \'foo\' = ?'); $driverConnection = $this->connection->getWrappedConnection();
$stmt = $driverConnection->prepare('SELECT * FROM SYSIBM.SYSDUMMY1 WHERE \'foo\' = ?');
// unwrap the statement to prevent the wrapper from handling the PHPUnit-originated exception // prevent the PHPUnit error handler from handling the errors that db2_execute() may trigger
$wrappedStmt = $stmt->getWrappedStatement(); $this->iniSet('error_reporting', (string) (E_ALL & ~E_WARNING & ~E_NOTICE));
$this->expectNotice(); $this->expectException(StatementError::class);
$wrappedStmt->execute([[]]); $stmt->execute([[]]);
} }
} }
...@@ -378,27 +378,19 @@ class SchemaTest extends TestCase ...@@ -378,27 +378,19 @@ class SchemaTest extends TestCase
->method('acceptSchema') ->method('acceptSchema')
->with($schema); ->with($schema);
$visitor->expects(self::at(1)) $visitor->expects(self::exactly(2))
->method('acceptTable')
->with($schema->getTable('baz'));
$visitor->expects(self::at(2))
->method('acceptTable') ->method('acceptTable')
->with($schema->getTable('bla.bloo')); ->withConsecutive(
[$schema->getTable('baz')],
[$schema->getTable('bla.bloo')]
);
$visitor->expects(self::exactly(2)) $visitor->expects(self::exactly(2))
->method('acceptTable');
$visitor->expects(self::at(3))
->method('acceptSequence')
->with($schema->getSequence('moo'));
$visitor->expects(self::at(4))
->method('acceptSequence') ->method('acceptSequence')
->with($schema->getSequence('war')); ->withConsecutive(
[$schema->getSequence('moo')],
$visitor->expects(self::exactly(2)) [$schema->getSequence('war')]
->method('acceptSequence'); );
self::assertNull($schema->visit($visitor)); self::assertNull($schema->visit($visitor));
} }
...@@ -436,10 +428,7 @@ class SchemaTest extends TestCase ...@@ -436,10 +428,7 @@ class SchemaTest extends TestCase
->method('acceptNamespace') ->method('acceptNamespace')
->with('bla'); ->with('bla');
$visitor->expects(self::exactly(3)) $visitor->expects($this->at(4))
->method('acceptNamespace');
$visitor->expects(self::at(4))
->method('acceptTable') ->method('acceptTable')
->with($schema->getTable('baz')); ->with($schema->getTable('baz'));
...@@ -447,10 +436,7 @@ class SchemaTest extends TestCase ...@@ -447,10 +436,7 @@ class SchemaTest extends TestCase
->method('acceptTable') ->method('acceptTable')
->with($schema->getTable('bla.bloo')); ->with($schema->getTable('bla.bloo'));
$visitor->expects(self::exactly(2)) $visitor->expects($this->at(6))
->method('acceptTable');
$visitor->expects(self::at(6))
->method('acceptSequence') ->method('acceptSequence')
->with($schema->getSequence('moo')); ->with($schema->getSequence('moo'));
...@@ -458,9 +444,6 @@ class SchemaTest extends TestCase ...@@ -458,9 +444,6 @@ class SchemaTest extends TestCase
->method('acceptSequence') ->method('acceptSequence')
->with($schema->getSequence('war')); ->with($schema->getSequence('war'));
$visitor->expects(self::exactly(2))
->method('acceptSequence');
self::assertNull($schema->visit($visitor)); self::assertNull($schema->visit($visitor));
} }
} }
...@@ -29,15 +29,11 @@ class DropSchemaSqlCollectorTest extends TestCase ...@@ -29,15 +29,11 @@ class DropSchemaSqlCollectorTest extends TestCase
$collector = new DropSchemaSqlCollector($platform); $collector = new DropSchemaSqlCollector($platform);
$platform->expects(self::exactly(2)) $platform->expects(self::exactly(2))
->method('getDropForeignKeySQL');
$platform->expects(self::at(0))
->method('getDropForeignKeySQL')
->with($keyConstraintOne, $tableOne);
$platform->expects(self::at(1))
->method('getDropForeignKeySQL') ->method('getDropForeignKeySQL')
->with($keyConstraintTwo, $tableTwo); ->withConsecutive(
[$keyConstraintOne, $tableOne],
[$keyConstraintTwo, $tableTwo]
);
$collector->acceptForeignKey($tableOne, $keyConstraintOne); $collector->acceptForeignKey($tableOne, $keyConstraintOne);
$collector->acceptForeignKey($tableTwo, $keyConstraintTwo); $collector->acceptForeignKey($tableTwo, $keyConstraintTwo);
......
...@@ -25,10 +25,6 @@ class RunSqlCommandTest extends TestCase ...@@ -25,10 +25,6 @@ class RunSqlCommandTest extends TestCase
protected function setUp(): void protected function setUp(): void
{ {
$this->connectionMock = $this->createMock(Connection::class); $this->connectionMock = $this->createMock(Connection::class);
$this->connectionMock->method('fetchAllAssociative')
->willReturn([[1]]);
$this->connectionMock->method('executeUpdate')
->willReturn(42);
$application = new Application(); $application = new Application();
$application->add(new RunSqlCommand(new SingleConnectionProvider($this->connectionMock))); $application->add(new RunSqlCommand(new SingleConnectionProvider($this->connectionMock)));
...@@ -94,21 +90,25 @@ class RunSqlCommandTest extends TestCase ...@@ -94,21 +90,25 @@ class RunSqlCommandTest extends TestCase
private function expectConnectionExecuteUpdate(): void private function expectConnectionExecuteUpdate(): void
{ {
$this->connectionMock $this->connectionMock
->expects(self::exactly(1)) ->expects(self::once())
->method('executeUpdate'); ->method('executeUpdate')
->willReturn(42);
$this->connectionMock $this->connectionMock
->expects(self::exactly(0)) ->expects(self::never())
->method('fetchAllAssociative'); ->method('fetchAllAssociative');
} }
private function expectConnectionFetchAllAssociative(): void private function expectConnectionFetchAllAssociative(): void
{ {
$this->connectionMock $this->connectionMock
->expects(self::exactly(0)) ->expects(self::once())
->method('executeUpdate'); ->method('fetchAllAssociative')
->willReturn([[1]]);
$this->connectionMock $this->connectionMock
->expects(self::exactly(1)) ->expects(self::never())
->method('fetchAllAssociative'); ->method('executeUpdate');
} }
public function testStatementsWithFetchResultPrintsResult(): void public function testStatementsWithFetchResultPrintsResult(): void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment