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

Risky tests in master #910

Closed
Majkl578 opened this issue Apr 26, 2018 · 7 comments
Closed

Risky tests in master #910

Majkl578 opened this issue Apr 26, 2018 · 7 comments
Milestone

Comments

@Majkl578
Copy link
Contributor

There are currently 9 risky tests that don't assert anything:

There were 9 risky tests:

1) JMS\Serializer\Tests\Handler\ArrayCollectionHandlerTest::testSerializeArray
This test did not perform any assertions

2) JMS\Serializer\Tests\Handler\ArrayCollectionHandlerTest::testSerializeArraySkipByExclusionStrategy
This test did not perform any assertions

3) JMS\Serializer\Tests\Handler\DateHandlerTest::testSerializeDate with data set #0 (array('Y-m-d'))
This test did not perform any assertions

4) JMS\Serializer\Tests\Handler\DateHandlerTest::testSerializeDate with data set #1 (array('Y-m-d', '', 'Y-m-d|'))
This test did not perform any assertions

5) JMS\Serializer\Tests\Handler\DateHandlerTest::testSerializeDate with data set #2 (array('Y-m-d', '', 'Y'))
This test did not perform any assertions

6) JMS\Serializer\Tests\Serializer\GraphNavigatorTest::testNavigatorChangeTypeOnSerialization
This test did not perform any assertions

7) JMS\Serializer\Tests\Serializer\JsonSerializationTest::testFormErrorsWithNonFormComponents
This test did not perform any assertions

8) JMS\Serializer\Tests\Serializer\XmlSerializationTest::testWhitelistedDocumentTypesAreAllowed
This test did not perform any assertions

9) JMS\Serializer\Tests\Serializer\XmlSerializationTest::testFormErrorsWithNonFormComponents
This test did not perform any assertions
@goetas goetas added bug and removed bug labels Apr 26, 2018
@goetas goetas added this to the v2.0 milestone Apr 26, 2018
@goetas
Copy link
Collaborator

goetas commented Apr 26, 2018

True... test should be improved

@goetas
Copy link
Collaborator

goetas commented Apr 26, 2018

most of the risky tests are because they are testing that exceptions are not thrown or that mock objects receive the right paramer... ideas here?

@Majkl578
Copy link
Contributor Author

sebastianbergmann/phpunit#2484

You can use @doesNotPerformAssertions, but it would be better to rework the test to actually test some behavior.

@goetas goetas mentioned this issue Apr 26, 2018
@goetas
Copy link
Collaborator

goetas commented Apr 26, 2018

Do not know what is better... @doesNotPerformAssertions or #918 🤔

@Majkl578
Copy link
Contributor Author

I'd say @doesNotPerformAssertions. Asserting that true is true is nonsense. :D

@goetas
Copy link
Collaborator

goetas commented Apr 26, 2018

fixed in #918

@simPod
Copy link
Contributor

simPod commented Jun 5, 2019

It doesn't count towards coverage tho

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

No branches or pull requests

3 participants