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

Fix test suite on travisci #292

Closed
wants to merge 1 commit into from
Closed

Conversation

l3l0
Copy link
Contributor

@l3l0 l3l0 commented Jul 4, 2014

Bascially this PR fixed build at the travisci.

Just be aware about few things:

  • I need to skip testWhitelistedDocumentTypesAreAllowed() test for some version of php cause of https://bugs.php.net/bug.php?id=67081 It seems that serializer rely on some invalid php behavior which was fixed in newer version of php (>= 5.5.13 and >= 5.4.29). I don't know how to fix this in code, if someone have idea feel free to comment and help me :)
  • Library support php 5.3 as we can see in travis.yml - so I need to fix code like $this usage in anonymous functions.

Give me know if this PR is acceptable, if yes I can squash commits.

@kubasimon
Copy link

good job, i tried to fix the test in my pull request 👍 #284

@schmittjoh
Copy link
Owner

We can remove support for PHP 5.3 if this helps cleaning up the tests, this should help avoid many of these changes. Would you mind doing this in your PR?

@l3l0
Copy link
Contributor Author

l3l0 commented Jul 6, 2014

@schmittjoh sure I can do it :)

custom stub.
Skipped whitelist test for php version which changed behavior.
Remove support for php 5.3
@l3l0
Copy link
Contributor Author

l3l0 commented Jul 7, 2014

@schmittjoh done :)

@@ -73,7 +73,6 @@ public function testPropertyIsCollectionOfObjectsWithAttributeAndValue()

/**
* @expectedException JMS\Serializer\Exception\InvalidArgumentException
* @expectedExceptionMessage The document type "<!DOCTYPE author [<!ENTITY foo SYSTEM "php://filter/read=convert.base64-encode/resource=XmlSerializationTest.php">]>" is not allowed. If it is safe, you may add it to the whitelist configuration.
Copy link
Owner

Choose a reason for hiding this comment

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

Could you elaborate this change, and the next one?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is related with https://bugs.php.net/bug.php?id=67081 seems that php change internalSubset property of DOM so this message is valid until 5.5.13 and 5.4.29 We can see that changes was merged into 5.5.13 and 5.4.29 in the php changelog http://php.net/ChangeLog-5.php

Copy link
Owner

Choose a reason for hiding this comment

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

If we switch to setExpectedException, it should still be possible to assert the error message depending on the PHP version, no? Something like

$expectedMessage = $this->getInvalidDocTypeMessage('....');
$this->setExpectedException('class', $expectedMessage);

As this is security related, I think we should do a bit more here than just verifying the exception type.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah I think that with setExpectedException it should be possible. I will try to update this PR at the end of this weekend.

@@ -32,7 +32,8 @@
"symfony/translation": "~2.0",
"symfony/validator": "~2.0",
"symfony/form": "~2.1",
"symfony/filesystem": "2.*"
"symfony/filesystem": "2.*",
"phpunit/phpunit": "4.1.*"
Copy link
Contributor

Choose a reason for hiding this comment

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

4.1.* is a bad idea. 4.1 is not the latest stable.

and you could simply continue to rely on the version installed on Travis IMO

Copy link
Owner

Choose a reason for hiding this comment

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

I think relying on a fixed version is generally a good thing to make things a bit more stable.

Copy link
Contributor

Choose a reason for hiding this comment

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

but it requires downloading 14 or 15 more packages for each build, making the composer installation slower while composer is still there.

And anyway, if you decide to add the dependency, it should be ~4.1, not 4.1.*, so that a composer update can select newer minor versions when they are released (which would be the case now that 4.2 is stable since a few weeks)

@stof
Copy link
Contributor

stof commented Aug 21, 2014

I suggest splitting it in 2 separate PRs:

  • one fixing the fatal error for the listener test, which could be merged quickly so that the testsuite can run again
  • a separate one to fix the handling of whitelisted document types as the current work does not fix it yet (it skips the tests rather than fixing the code to be compatible with newer PHP versions, which is wrong)

@joelwurtz
Copy link

As @stof suggest i create an new PR to only fix fatal errors on tests (5.3 also) in #369, i will create another PR for fixing whitelisted document, once #369 is merged.

@urakozz
Copy link
Contributor

urakozz commented Dec 25, 2014

Final part of this is located in #375. Tests are passing now! =)

@urakozz
Copy link
Contributor

urakozz commented Jan 6, 2015

@schmittjoh I think you can just close this PR now )

@schmittjoh
Copy link
Owner

Yes, thanks :)

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.

6 participants