[BUGFIX] Fix functional tests for EXT:workspaces on PostgreSQL 31/51731/4
authorMorton Jonuschat <m.jonuschat@mojocode.de>
Fri, 17 Feb 2017 07:07:24 +0000 (23:07 -0800)
committerMarkus Klein <markus.klein@typo3.org>
Sun, 19 Feb 2017 23:10:58 +0000 (00:10 +0100)
commit2cac5a36758d5b89b81c7263d949a4a7eb0cdc5f
tree2498a97aa634ae76f4982136a56f7217c1613876
parent0e0b71899fb5eae67eb95efce5ec76b1a916157f
[BUGFIX] Fix functional tests for EXT:workspaces on PostgreSQL

Detect errors during execution of SQL statements using the
exceptions thrown by Doctrine DBAL instead of trying to use
Connection::errorCode().

The previous code doesn't work on MySQL if an actual error
occurs since an exception would be thrown earlier in the
process and the relevant code path would not be reached.

The happy path worked before because MySQL returns 0 as the
code when a statement executed successfully while PostgreSQL
returns '00000' which PHP does not consider to be empty.

Resolves: #79801
Releases: master
Change-Id: I508966b6731d256d1edff2267669d158a8d647bf
Reviewed-on: https://review.typo3.org/51731
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez <typo3@scripting-base.de>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRenderer.ts
typo3/sysext/version/Classes/Hook/DataHandlerHook.php