This repository has been archived by the owner on Dec 11, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Refactoring of the TextTest class #1590
Merged
fzaninotto
merged 7 commits into
fzaninotto:master
from
stevegrunwell:fix/refactor-text-tests
Sep 18, 2019
Merged
Refactoring of the TextTest class #1590
fzaninotto
merged 7 commits into
fzaninotto:master
from
stevegrunwell:fix/refactor-text-tests
Sep 18, 2019
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…it up automatically using the @before annotation
…viders for TextTest::testTextMaxLength()
…ts within TextTest
@stevegrunwell im pretty happy with the change. Is it possible to rebase it with latest so we can do some final checks? |
…ity with newer versions of PHPUnit
@pimjansen A fresh copy has been pushed. I've also moved the |
@stevegrunwell builds are failing, please review |
…der versions of PHP
…alidArgumentException::class, which only works in PHP 5.5+
@pimjansen Apologies, type-hints and |
pimjansen
approved these changes
Sep 17, 2019
fzaninotto
approved these changes
Sep 18, 2019
Thanks! |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR applies some minor refactoring to the
TextTest
class, making it easier to understand what's happening:buildGenerator()
method, which creates a new instance of the text generator at the start of each test and saves it in the private$generator
property — this saves a few lines of setup for each test method.foreach
loop withintestTextMaxLength()
, use PHPUnit's data providers to explicitly run each scenario as a separate test.@expectException
, explicitly add a failure message to the test to describe why the exception should have occurred.