Repository navigation
[test] run FlashMessenger helper tests - #244
Open
falkenhawk wants to merge 2 commits into
Open
falkenhawk wants to merge 2 commits into
falkenhawk wants to merge 2 commits into
Conversation
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
All 7 tests in
FlashMessengerTestwere skipped.1) The whole class was skipped
setUp()skipped every test when headers were already sent, which is always the case when phpunit runs from the command line.The tests do not need to send headers:
tests/bootstrap.phprunsZend_Sessionin unit test mode, whereZend_Session::start()sends nothing.The check is removed, together with the check for the session save path.
2) Three tests were always skipped
These three already called
markTestSkipped()in ZF1. They failed because of the tests, not because of the helper:testLoadFlashMessengerdispatched without a URL, so the router sent it toIndexController, where the view renderer found no view script. It now dispatches/helper-flash-messengerwith the view renderer disabled, likeFrontTestdoes.testClearMessagesandtestDirectProxiesToAddMessagecheckedhasMessages()andcount()right afteraddMessage(). But these report the messages of the previous request, whileaddMessage()stores a message for the next one. The test controller expects exactly that:count() === 0andhasMessages() === falseafteraddMessage().testClearMessagesnow simulates the next request, liketestSimulateCrossRequestMessagePassingdoes, andtestDirectProxiesToAddMessagechecks the current messages.tearDown()now resets the static state of the helper, so messages do not leak between tests.The helper itself works as the tests expect, so it is unchanged.
Ported from a private repository, based on work by @marcing.