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

Fixed test failures on PHP 7.4 #3642

Merged

Conversation

morozov
Copy link
Member

@morozov morozov commented Aug 3, 2019

The failures are caused by the changes in PHP according to PHP RFC: E_WARNING for invalid container read array-access.

Q A
Type improvement
BC Break no
Fixed issues build #567162538

@@ -47,6 +47,10 @@ public function testSelectGlobal() : void
{
$conn = $this->createConnectionMock();
$conn->expects($this->once())->method('connect')->with($this->equalTo(0));
$conn->method('getParams')
->willReturn([
'shardChoser' => $this->createMock(ShardChoser::class),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This illustrates one more advantage of using classes for data structures instead of associative arrays. Unlike the array element, a method return value would be automatically mocked.

@morozov morozov requested a review from Ocramius August 3, 2019 16:53
@morozov

This comment has been minimized.

The failures are caused by the changes in PHP according to https://wiki.php.net/rfc/notice-for-non-valid-array-container.
@morozov morozov force-pushed the notice-for-non-valid-array-container branch from 1f6e416 to 860b90b Compare August 3, 2019 19:54
@@ -34,7 +34,9 @@ class Table extends AbstractAsset
protected $_fkConstraints = [];

/** @var mixed[] */
protected $_options = [];
protected $_options = [
'create_options' => [],
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I already said, associative arrays of associative arrays are barely manageable.

@morozov
Copy link
Member Author

morozov commented Aug 3, 2019

The rest of the failures are caused by some unknown issue with authentication against MySQL 8 (irrelevant to this PR).

@Ocramius Ocramius self-assigned this Aug 3, 2019
@Ocramius Ocramius added the Bug label Aug 3, 2019
@Ocramius Ocramius added this to the 2.10.0 milestone Aug 3, 2019
@Ocramius Ocramius merged commit 292d819 into doctrine:master Aug 3, 2019
@morozov morozov deleted the notice-for-non-valid-array-container branch August 3, 2019 21:30
morozov added a commit that referenced this pull request Oct 26, 2019
@morozov morozov modified the milestones: 2.10.0, 2.9.3 Oct 26, 2019
rgrellmann added a commit to Rossmann-IT/dbal that referenced this pull request Apr 22, 2020
Release v2.9.3

[![Build Status](https://travis-ci.org/doctrine/dbal.svg?branch=v2.9.3)](https://travis-ci.org/doctrine/dbal)

This release fixes regressions introduced in previous releases and other bugs.

- Total issues resolved: **5**
- Total pull requests resolved: **14**
- Total contributors: **9**

**Regressions**

 - [3686: Fixed query result caching when `FetchMode::COLUMN` is used](doctrine#3686) thanks to @morozov and @Junker

 - [3456: Compare type class when comparing columns.](doctrine#3456) thanks to @garret-gunter and @cs278

**Other bugs**

 - [3679: fix begin trasaction after reconnect](doctrine#3679) thanks to @kalinin-k-a

 - [3547: Default column expressions do not work on SQL Server](doctrine#3547) thanks to @morozov

 - [3420: Index length can be a `string`: ensure that it is an integer when read by the `MySqlSchemaManager`](doctrine#3420) thanks to @leofeyer

**CI improvements and maintenance**

 - [3702: Updated SQL Server extensions to fix build failures on PHP 7.4](doctrine#3702) thanks to @morozov

 - [3662: Marked connection exception test incomplete on MySQL 8](doctrine#3662) thanks to @morozov

 - [3622: Switched from ibmcom/db2express-c to ibmcom/db2](doctrine#3622) thanks to @morozov

 - [3465: Replaced MySQL 5.7 installed from a PPA with an official Docker image](doctrine#3465) thanks to @morozov

 - [3454: CI: Test against PHP 7.4snapshot instead of nightly (8.0)](doctrine#3454) thanks to @Majkl578

 - [3452: Fixed AppVeyor build configuration and the issue on SQL Server](doctrine#3452) thanks to @morozov and @Majkl578

 - [3447: Replaced custom docker image for PostgreSQL with the official one](doctrine#3447) thanks to @morozov

 - [3407: CI: Test against MySQL 8.0 on Travis](doctrine#3407) thanks to @morozov

**PHP 7.4 support**

 - [3642: Fixed test failures on PHP 7.4](doctrine#3642) thanks to @morozov

# gpg: Signature made Sat Nov  2 23:20:42 2019
# gpg:                using RSA key 374EADAF543AE995
# gpg: Can't check signature: public key not found
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants