Skip to content

Conversation

@Nyholm
Copy link
Member

@Nyholm Nyholm commented Aug 28, 2017

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Related tickets
Documentation
License MIT

I did also add php 7.2

@fbourigault
Copy link
Contributor

To see if dependencies have an incoming release with PHP 7.2, it would make sense to use PHP 7.2 here:

- php: 7.1
env: DEPENDENCIES=dev

@fbourigault
Copy link
Contributor

Do you plan to solve failing tests in this PR?

@fbourigault
Copy link
Contributor

🎉 HttplugBundle is now successfully tested against PHP 7.2

  • I added the KERNEL_CLASS to phpunit.xml.dist because it will be deprecated in 3.4.
  • I removed a each function call which is deprecated since PHP 7.2.
  • Dev dependencies are now tested against PHP 7.2.
  • As each is deprecated, we need to use PHPUnit 6, so, I bumped older version of PHPUnit to the first one which contains the forward compatibility layer and did some changes to make tests working in every allowed PHPUnit version.
  • I also fixed a tiny styleci complain about missing blank line before break statement.
  • I disabled xdebug when code coverage is not enabled to speed up the build.

Copy link
Collaborator

@dbu dbu left a comment

Choose a reason for hiding this comment

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

great job! apart from the expectedException i am happy with this.

}

/**
* @expectedException \Exception
Copy link
Collaborator

Choose a reason for hiding this comment

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

i discussed once with sebastian bergman and he is saying he agrees that the annotation is less clean than calling setExpectedException. the reason is that if the exception is thrown too early, the test would wrongly be green. this is particularly true when we expect such a generic exception

Copy link
Contributor

Choose a reason for hiding this comment

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

So, it's better to have a if/else at the right position in the test?

Copy link
Collaborator

Choose a reason for hiding this comment

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

why if/else? afaik the $this->setExpectedException call is the best practice way. this makes sure the exception is only considered correct when thrown after that line in the code, and you have namespace resolution.

Copy link
Contributor

Choose a reason for hiding this comment

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

setExpectedException was removed in 6.0 and replaced by expectException. That's why I moved to annotation.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, We need the annotation for BC purpose...

Copy link
Contributor

Choose a reason for hiding this comment

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

We can keep this as-is and switch to expectException in next-major.

"symfony/dom-crawler": "^2.8 || ^3.0",
"polishsymfonycommunity/symfony-mocker-container": "^1.0",
"matthiasnoback/symfony-dependency-injection-test": "^1.0",
"matthiasnoback/symfony-dependency-injection-test": "^1.0 || ^2.0",
Copy link
Collaborator

Choose a reason for hiding this comment

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

do we need both versions to support the range of php versions we support?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, we can't install PHPUnit 6.0 because of a conflict on sebastian/exporter.

@Nyholm
Copy link
Member Author

Nyholm commented Sep 1, 2017

Thank you. I'm happy to merge this.

@Nyholm
Copy link
Member Author

Nyholm commented Sep 4, 2017

What do you think @dbu?

Copy link
Collaborator

@dbu dbu left a comment

Choose a reason for hiding this comment

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

assuming there is no forward compatibility method for expectException i'd say go for it. when such a thing is added, we can start using it. its the tests so we can change without risks

@fbourigault
Copy link
Contributor

Thank you all!

@fbourigault fbourigault merged commit de9ede9 into master Sep 4, 2017
@fbourigault fbourigault deleted the patch-global branch September 4, 2017 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants