Skip to content

Moved TEST_COMMAND to global section #203

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

Merged
merged 7 commits into from
Sep 4, 2017
Merged

Moved TEST_COMMAND to global section #203

merged 7 commits into from
Sep 4, 2017

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.

@@ -63,14 +64,15 @@ public function testProfilingWithCachePlugin()
$this->assertEquals('example.com', $stack->getRequestHost());
}

/**
* @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.

@@ -49,7 +50,7 @@
"symfony/browser-kit": "^2.8 || ^3.0",
"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.

3 participants