Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ExceptionTest::testConnectionExceptionSqLite() on macOS #4297

Merged
merged 1 commit into from
Sep 26, 2020

Conversation

morozov
Copy link
Member

@morozov morozov commented Sep 26, 2020

Q A
Type improvement
BC Break no

The test fails on macOS:

$ phpunit --filter testConnectionExceptionSqLite tests/Doctrine/Tests/DBAL/Functional/ExceptionTest.php
PHPUnit 9.3.2 by Sebastian Bergmann and contributors.

F                                                                                   1 / 1 (100%)

Time: 00:00.023, Memory: 10.00 MB

There was 1 failure:

1) Doctrine\Tests\DBAL\Functional\ExceptionTest::testConnectionExceptionSqLite
Failed asserting that exception of type "Doctrine\DBAL\Exception\ConnectionException" matches expected exception "Doctrine\DBAL\Exception\ReadOnlyException". Message was: "An exception occurred in driver: SQLSTATE[HY000] [14] unable to open database file" at
/Users/smorozov/Projects/dbal/lib/Doctrine/DBAL/Driver/PDO/Exception.php:18
/Users/smorozov/Projects/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:41
/Users/smorozov/Projects/dbal/lib/Doctrine/DBAL/Driver/PDOSqlite/Driver.php:42
/Users/smorozov/Projects/dbal/lib/Doctrine/DBAL/Connection.php:360
/Users/smorozov/Projects/dbal/lib/Doctrine/DBAL/Connection.php:1753
/Users/smorozov/Projects/dbal/lib/Doctrine/DBAL/Connection.php:1390
/Users/smorozov/Projects/dbal/tests/Doctrine/Tests/DBAL/Functional/ExceptionTest.php:342
.

FAILURES!
Tests: 1, Assertions: 1, Failures: 1.

According to the currently implemented logic, as non-Linux, macOS falls under the Windows category, therefore, the test changes the DB file mode to 0 which causes the error.

@morozov morozov merged commit f099856 into doctrine:2.11.x Sep 26, 2020
@morozov morozov deleted the exception-test-macos branch September 26, 2020 14:11
@morozov morozov self-assigned this Sep 26, 2020
@morozov morozov added this to the 2.11.1 milestone Sep 26, 2020
rgrellmann added a commit to Rossmann-IT/dbal that referenced this pull request Mar 7, 2021
Release [2.11.1](https://github.com/doctrine/dbal/milestone/80)

2.11.1
======

- Total issues resolved: **2**
- Total pull requests resolved: **8**
- Total contributors: **6**

Documentation
-------------

 - [4299: Link to contributing guide](doctrine#4299) thanks to @greg0ire

SQLite,Test Suite,pdo_sqlite
----------------------------

 - [4297: Fix ExceptionTest::testConnectionExceptionSqLite() on macOS](doctrine#4297) thanks to @morozov

 - [4296: Increase indent in definition lists](doctrine#4296) thanks to @greg0ire

Deprecation,Prepared Statements
-------------------------------

 - [4291: Deprecate Abstraction\Result](doctrine#4291) thanks to @morozov

BC Fix,Quoting
--------------

 - [4287: Restore PDOStatement::quote() for backward compatibility](doctrine#4287) thanks to @morozov and @Shahelm

BC Fix,Query
------------

 - [4286: Fix BC break: QueryBuilder::andWhere() etc. should ignore empty strings](doctrine#4286) thanks to @BenMorel and @infabo

Bug,Documentation,Prepared Statements
-------------------------------------

 - [4285: Fix phpdoc on deprecated functions](doctrine#4285) thanks to @qdequippe

Bug,PDO,Prepared Statements
---------------------------

 - [4173: Fix Third parameter not allowed for PDO::FETCH&doctrine#95;COLUMN](doctrine#4173) thanks to @BenMorel

# gpg: Signature made Sun Sep 27 06:35:40 2020
# gpg:                using DSA key 1BEDEE0A820BC30D858F9F0C2C3A645671828132
# gpg: Can't check signature: No public key
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants