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

EZP-31542: Added PHP 7.4 support (eZ Platform 2.5) #3017

Merged
merged 17 commits into from
Apr 24, 2020

Conversation

adamwojs
Copy link
Member

@adamwojs adamwojs commented Apr 9, 2020

Question Answer
JIRA issue EZP-31542
Bug/Improvement yes
New feature no
Target version 7.x
BC breaks no
Tests pass yes
Doc needed no

TODO:

  • Implement feature / fix a bug.
  • Implement tests.
  • Fix new code according to Coding Standards ($ composer fix-cs).
  • Ask for Code Review.

adamwojs added 15 commits April 9, 2020 20:47
…n \eZ\Publish\Core\FieldType\Tests\Url\UrlStorageTest::testStoreFieldDataWithEmptyUrl
…in \eZ\Publish\Core\Persistence\Legacy\Tests\Content\ContentHandlerTest::{testPublishFirstVersion,testPublish}
…n \eZ\Publish\Core\FieldType\Relation\Type::fromHash
…n \eZ\Publish\Core\FieldType\{BinaryFile,DateAndTime,MapLocation}\SearchField
…n \eZ\Publish\Core\Persistence\Legacy\Content\FieldValue\Converter\{Author,DateAndTime,Date,Time}Converter
…n \eZ\Publish\API\Repository\Tests\FieldType\SearchBaseIntegrationTest::sortProvider
…null" in \eZ\Publish\Core\Persistence\Legacy\Content\FieldValue\Converter\{Author,DateAndTime,Date,Time}Converter
…tSetUserPreferenceThrowsInvalidArgumentExceptionOnInvalidValue
…" when invoked at least once." in eZ\Publish\Core\Repository\Tests\Service\Mock\UserPreferenceTest::testSetUserPreferenceThrowsInvalidArgumentException
…n \eZ\Publish\Core\FieldType\Image\SearchField::getIndexData
…n \eZ\Publish\Core\FieldType\Media\SearchField::getIndexData
…n \eZ\Bundle\EzPublishCoreBundle\Tests\Assetic\AssetFactoryTest
@adamwojs adamwojs self-assigned this Apr 9, 2020
@adamwojs adamwojs mentioned this pull request Apr 9, 2020
@adamwojs adamwojs changed the title EZP-31542: Added PHP 7.4 support EZP-31542: Added PHP 7.4 support (eZ Platform 2.5) Apr 9, 2020
…er.php

Co-Authored-By: Andrew Longosz <alongosz@users.noreply.github.com>
.travis.yml Outdated
Comment on lines 56 to 69
# 7.4
- php: 7.4
env: TEST_CONFIG="phpunit.xml"
- php: 7.4
env: PHP_IMAGE=ezsystems/php:7.4-v1 PHP_IMAGE_DEV=ezsystems/php:7.4-v1-dev REST_TEST_CONFIG="phpunit-functional-rest.xml" SYMFONY_ENV=behat SYMFONY_DEBUG=1 SF_CMD="ez:behat:create-language 'pol-PL' 'Polish (polski)'"
- php: 7.4
env: PHP_IMAGE=ezsystems/php:7.4-v1 PHP_IMAGE_DEV=ezsystems/php:7.4-v1-dev BEHAT_OPTS="--profile=rest --tags=~@broken --suite=fullJson" SYMFONY_ENV=behat SYMFONY_DEBUG=1
- php: 7.4
env: SOLR_VERSION="6.4.2" TEST_CONFIG="phpunit-integration-legacy-solr.xml" CUSTOM_CACHE_POOL="singleredis" CORES_SETUP="shared" SOLR_CONFIG="vendor/ezsystems/ezplatform-solr-search-engine/lib/Resources/config/solr/schema.xml vendor/ezsystems/ezplatform-solr-search-engine/lib/Resources/config/solr/custom-fields-types.xml vendor/ezsystems/ezplatform-solr-search-engine/lib/Resources/config/solr/language-fieldtypes.xml" JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64/jre/"
- php: 7.4
env: TEST_CONFIG="phpunit-integration-legacy.xml" DB="postgresql" DATABASE="pgsql://postgres@localhost/testdb"
- php: 7.4
env: TEST_CONFIG="phpunit-integration-legacy.xml" DB="mysql" DATABASE="mysql://root@localhost/testdb"

Copy link
Contributor

@andrerom andrerom Apr 17, 2020

Choose a reason for hiding this comment

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

Lets reduce number of tests here, it will take a long time to wait for them all to pass. We don't necerly need to test everything (3 flavours of integration test runs) on 7.4 once we have now gotten past to make sure all tests pass.

Suggested change
# 7.4
- php: 7.4
env: TEST_CONFIG="phpunit.xml"
- php: 7.4
env: PHP_IMAGE=ezsystems/php:7.4-v1 PHP_IMAGE_DEV=ezsystems/php:7.4-v1-dev REST_TEST_CONFIG="phpunit-functional-rest.xml" SYMFONY_ENV=behat SYMFONY_DEBUG=1 SF_CMD="ez:behat:create-language 'pol-PL' 'Polish (polski)'"
- php: 7.4
env: PHP_IMAGE=ezsystems/php:7.4-v1 PHP_IMAGE_DEV=ezsystems/php:7.4-v1-dev BEHAT_OPTS="--profile=rest --tags=~@broken --suite=fullJson" SYMFONY_ENV=behat SYMFONY_DEBUG=1
- php: 7.4
env: SOLR_VERSION="6.4.2" TEST_CONFIG="phpunit-integration-legacy-solr.xml" CUSTOM_CACHE_POOL="singleredis" CORES_SETUP="shared" SOLR_CONFIG="vendor/ezsystems/ezplatform-solr-search-engine/lib/Resources/config/solr/schema.xml vendor/ezsystems/ezplatform-solr-search-engine/lib/Resources/config/solr/custom-fields-types.xml vendor/ezsystems/ezplatform-solr-search-engine/lib/Resources/config/solr/language-fieldtypes.xml" JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64/jre/"
- php: 7.4
env: TEST_CONFIG="phpunit-integration-legacy.xml" DB="postgresql" DATABASE="pgsql://postgres@localhost/testdb"
- php: 7.4
env: TEST_CONFIG="phpunit-integration-legacy.xml" DB="mysql" DATABASE="mysql://root@localhost/testdb"
# 7.4
- php: 7.4
env: TEST_CONFIG="phpunit.xml"
- php: 7.4
env: PHP_IMAGE=ezsystems/php:7.4-v1 PHP_IMAGE_DEV=ezsystems/php:7.4-v1-dev REST_TEST_CONFIG="phpunit-functional-rest.xml" SYMFONY_ENV=behat SYMFONY_DEBUG=1 SF_CMD="ez:behat:create-language 'pol-PL' 'Polish (polski)'"
- php: 7.4
env: PHP_IMAGE=ezsystems/php:7.4-v1 PHP_IMAGE_DEV=ezsystems/php:7.4-v1-dev BEHAT_OPTS="--profile=rest --tags=~@broken --suite=fullJson" SYMFONY_ENV=behat SYMFONY_DEBUG=1
- php: 7.4
env: SOLR_VERSION="7.7.2" TEST_CONFIG="phpunit-integration-legacy-solr.xml" CORES_SETUP="shared" SOLR_CONFIG="vendor/ezsystems/ezplatform-solr-search-engine/lib/Resources/config/solr/schema.xml vendor/ezsystems/ezplatform-solr-search-engine/lib/Resources/config/solr/custom-fields-types.xml vendor/ezsystems/ezplatform-solr-search-engine/lib/Resources/config/solr/language-fieldtypes.xml" JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64/jre/"
- php: 7.4
env: TEST_CONFIG="phpunit-integration-legacy.xml" DB="mysql" DATABASE="mysql://root@localhost/testdb" CUSTOM_CACHE_POOL="singleredis"

Note! I'm suggesting we test Solr 7 here on PHP 7.4. probably need adaptions in integration test script to pull in solr bundle 2.x when solr 7 is asked for.

 # 7.1
     - php: 7.1
       env: TEST_CONFIG="phpunit.xml"
     - php: 7.1
       env: PHP_IMAGE=ezsystems/php:7.1-v1 PHP_IMAGE_DEV=ezsystems/php:7.1-v1-dev REST_TEST_CONFIG="phpunit-functional-rest.xml" SYMFONY_ENV=behat SYMFONY_DEBUG=1 SF_CMD="ez:behat:create-language 'pol-PL' 'Polish (polski)'"
     - php: 7.1
       env: PHP_IMAGE=ezsystems/php:7.1-v1 PHP_IMAGE_DEV=ezsystems/php:7.1-v1-dev BEHAT_OPTS="--profile=rest --tags=~@broken --suite=fullJson" SYMFONY_ENV=behat SYMFONY_DEBUG=1
     - php: 7.1
-       env: SOLR_VERSION="6.4.2" TEST_CONFIG="phpunit-integration-legacy-solr.xml" CUSTOM_CACHE_POOL="singleredis" CORES_SETUP="shared" SOLR_CONFIG="vendor/ezsystems/ezplatform-solr-search-engine/lib/Resources/config/solr/schema.xml vendor/ezsystems/ezplatform-solr-search-engine/lib/Resources/config/solr/custom-fields-types.xml vendor/ezsystems/ezplatform-solr-search-engine/lib/Resources/config/solr/language-fieldtypes.xml" JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64/jre/"
+       env: SOLR_VERSION="6.6.5" TEST_CONFIG="phpunit-integration-legacy-solr.xml" CUSTOM_CACHE_POOL="singleredis" CORES_SETUP="shared" SOLR_CONFIG="vendor/ezsystems/ezplatform-solr-search-engine/lib/Resources/config/solr/schema.xml vendor/ezsystems/ezplatform-solr-search-engine/lib/Resources/config/solr/custom-fields-types.xml vendor/ezsystems/ezplatform-solr-search-engine/lib/Resources/config/solr/language-fieldtypes.xml" JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64/jre/"
     - php: 7.1
       env: TEST_CONFIG="phpunit-integration-legacy.xml" DB="postgresql" DATABASE="pgsql://postgres@localhost/testdb"
-     - php: 7.1
-       env: TEST_CONFIG="phpunit-integration-legacy.xml" DB="mysql" DATABASE="mysql://root@localhost/testdb"

Could also consider to split the functional testing across 7.1 and 7.4 as opposed to run both on both php versions.

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure, number of jobs will be reduced before merge. Right now I needed them to make sure that everything works 😉

@@ -222,7 +222,14 @@ protected function getSortInfo(BaseValue $value)
*/
public function fromHash($hash)
{
return new Value($hash['destinationContentId']);
if ($hash !== null) {
$destinationContentId = $hash['destinationContentId'];
Copy link

Choose a reason for hiding this comment

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

maybe this should also use ?? null to get the destinationContentId?

@adamwojs adamwojs merged commit 85a355c into ezsystems:7.5 Apr 24, 2020
@adamwojs adamwojs deleted the php74_support branch April 24, 2020 11:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

6 participants