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

Add support for php7 and get all tests running #53

Merged
merged 8 commits into from
Aug 18, 2016
Merged

Conversation

andrerom
Copy link
Contributor

@andrerom andrerom commented Apr 14, 2016

Might fail on a few things. passing

Note: PHP7 might never be fully supported with legacy, this just makes sure it can be used for dev use, and is a first step towards getting legacy running on php7.

@andrerom andrerom changed the title Update travis to test on php7 also Update travis to test on php7 Apr 14, 2016
@andrerom andrerom changed the title Update travis to test on php7 Run tests on php7 Apr 14, 2016
@@ -59,7 +59,7 @@ public function load(array $configs, ContainerBuilder $container)
$processor = new ConfigurationProcessor($container, 'ezpublish_legacy');
$processor->mapConfig(
$config,
function (array &$scopeSettings, $currentScope, ContextualizerInterface $contextualizer) {
function (array $scopeSettings, $currentScope, ContextualizerInterface $contextualizer) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this something that could break on PHP 5.x?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Don't see how, the variable is not modified inside the closure.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yep, just wanted to confirm.

Copy link
Contributor

Choose a reason for hiding this comment

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

No, it won't break.

Might fail on a few things.
Not needed in this case as it is not modified, and value given.
@andrerom andrerom force-pushed the test-on-php7 branch 2 times, most recently from 0d95f40 to 087efc7 Compare August 15, 2016 11:22
@andrerom andrerom changed the title Run tests on php7 Add support for php7 and get all tests running Aug 15, 2016
@andrerom
Copy link
Contributor Author

review ping @emodric @lolautruche

@@ -47,6 +47,10 @@ public function onBuildKernelWebHandler(PreBuildKernelWebHandlerEvent $event)
$request = $event->getRequest();
$uriPart = array();

// @todo Remove when, if ever, legacy does not use deprecated constructor names
// triggers initial autoload of eZSiteAccess and sileces deprecation warning
@eZSiteAccess::TYPE_DEFAULT;
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't get this...
As for the comment, you just need to silent E_DEPRECATED errors in php.ini

Copy link
Contributor Author

@andrerom andrerom Aug 15, 2016

Choose a reason for hiding this comment

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

We can, but for symfony 3.0 support we actually want to have deprecation errors make test fail on other things. Hence the selective silencing just when loading legacy classes, as we kind of want to know about anything else.

Copy link
Contributor

@lolautruche lolautruche Aug 15, 2016

Choose a reason for hiding this comment

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

but for symfony 3.0 support we actually want to have deprecation errors make test fail on other things

E_DEPRECATED !== E_USER_DEPRECATED

😉

Copy link
Contributor Author

Choose a reason for hiding this comment

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

true, ok I'll see if I get that running then.

Copy link
Contributor Author

@andrerom andrerom Aug 15, 2016

Choose a reason for hiding this comment

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

fixed, but by just switching error level for this test only, want to get other deprecation errors if there are any. constructor is perhaps the only we shouldn't do anything about for BC.

@andrerom andrerom force-pushed the test-on-php7 branch 2 times, most recently from 90d6969 to e7b7cd1 Compare August 15, 2016 13:00
"matthiasnoback/symfony-dependency-injection-test": "^1.0",
"phpunit/phpunit": "~4.7",
"mikey179/vfsStream": "~1.1.0",
"mockery/mockery": "^0.9@dev"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why @dev ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

Okay, but isn't ^0.9 enough?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it can be, but then we won't pull in those fixes as it will use the tag.

Copy link
Collaborator

Choose a reason for hiding this comment

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

It will pull 0.9.5, that's not enough?

Copy link
Contributor Author

@andrerom andrerom Aug 18, 2016

Choose a reason for hiding this comment

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

does not sound like you checked the link, but removed it

Copy link
Collaborator

Choose a reason for hiding this comment

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

does not sound like you checked the link, but removed it

I did, but the link shows diff between 0.9 and 0.9.5 versions. ^0.9 will pull in 0.9.5, so I'm not sure what the issue is :)

@emodric
Copy link
Collaborator

emodric commented Aug 18, 2016

Aside from inline comment, +1.

@@ -42,12 +42,12 @@ public function purgeAll()
$this->gatewayCachePurger->purgeAll();
}

public function purgeForContent($contentId)
public function purgeForContent($contentId, $locationIds = array())
Copy link
Collaborator

Choose a reason for hiding this comment

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

Isn't this a breaking change? If so, we should require eZ Kernel >=6.3.2|>=6.4.2 (when 6.4.2 is released) in composer.json, right?

Copy link
Contributor Author

@andrerom andrerom Aug 18, 2016

Choose a reason for hiding this comment

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

yes, but adding optional argument won't break the contract. In retrospective it was the kernel that broke the contract here.

So besides the fact that kernel should not have done this change, I think this fix is ok as is, it will work on older kernels also.

Copy link
Collaborator

Choose a reason for hiding this comment

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

So besides the fact that kernel should not have done this change, I think this fix is ok as is, it will work on older kernels also.

Agreed.

@andrerom
Copy link
Contributor Author

andrerom commented Aug 18, 2016

looks ok to you as well now @lolautruche ?

EDIT: Hmm, failing now, might be because of the d0a0c33 change edi asked me to do.

@lolautruche
Copy link
Contributor

+1

Weird that it doesn't fail with PHP 5.4

@andrerom
Copy link
Contributor Author

Found it, we allow SensioDistributionBundle 5.0 now for work towards Sf 3.0 support, it supports PHP 5.5+, and it does not contain Configurator as needed by LegacyBridge.

Added it to composer.json as it is a clear requirement.

Thanks for reviews, merging :)

@andrerom andrerom merged commit 2a36616 into master Aug 18, 2016
@andrerom andrerom deleted the test-on-php7 branch August 18, 2016 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants