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.
To summarize the following, this PR changes the default behavior
of the
UrlBuilder
class. Before this change, the default behaviorused
http
by default. After this change, the default behavior useshttps
by default.When I began, I made a small change in the constructor definition and
ran the test. All passed (not intended, not expected). I removed the
change and began this PR by writing a failing test first. I re-ran the
test suite and the test,
testExamplePlainUsesHttpsByDefault
, failedas intended. I then made the appropriate change in the constructor
definition, re-ran the tests, all passed.
https by default, it failed
use
$useHttps = true
(instead of$useHttps = false
)testExamplePlainUsesHttpsByDefault
, anysubsequent changes to this behavior will be a "breaking change"
testExamplePlainUsesHttpsByDefault
was used toemulate the naming-style present in the test suite
testExamplePlainUsesHttpsByDefault
has beenwritten to emulate the structure of similar tests (e.g.
testExamplePlain
)isolation and requires a call to
createUrl
of individual builder-fields, e.g. there are no "getters" and the
builder-fields are private:
ensure more complete test coverage.
Ensure at least one test case fails before change:
Note that the expected value is
https
.Ensure all tests pass after change:
Both the expected and actual values concur.
This single test should be sufficient for our purposes, here and now. It
is the only point of entry (i.e. no "getters").
UrlHelper
does havea
getUrl
method, but that is not near this change (getUrl
is notcalled until
UrlBuilder.createUrl
returns).