Commit 1fa0951
Aaron Gustavo Nieves
Fix moveBack() to move the history pointer instead of appending
`moveBack()` replayed the previous request through `_loadPage()`, which
called `clientRequest()` with the default `$changeHistory = true`. That
appended a new entry to the BrowserKit history and discarded the forward
entries, so going back behaved like a fresh navigation rather than a real
Back button: the history pointer ended up on the last page again and a
second `moveBack()` no longer walked further back.
Thread a `$changeHistory` flag through `_loadPage()` (default `true`, so it
is backward compatible) and pass `false` from `moveBack()`. The replayed
request no longer mutates the history, matching Symfony's native
`AbstractBrowser::back()` semantics.
This also makes the framework history assertions
(`assertBrowserHistoryIsNotOnLastPage()`) observable through the public
`moveBack()` step.1 parent 8af7f84 commit 1fa0951
3 files changed
Lines changed: 20 additions & 4 deletions
File tree
- src/Codeception/Lib
- tests
- data/app
- unit/Codeception/Module
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
280 | 280 | | |
281 | 281 | | |
282 | 282 | | |
283 | | - | |
| 283 | + | |
| 284 | + | |
284 | 285 | | |
285 | | - | |
| 286 | + | |
286 | 287 | | |
287 | 288 | | |
288 | 289 | | |
| |||
2000 | 2001 | | |
2001 | 2002 | | |
2002 | 2003 | | |
| 2004 | + | |
| 2005 | + | |
| 2006 | + | |
2003 | 2007 | | |
2004 | 2008 | | |
2005 | 2009 | | |
2006 | 2010 | | |
2007 | 2011 | | |
2008 | 2012 | | |
2009 | | - | |
| 2013 | + | |
| 2014 | + | |
2010 | 2015 | | |
2011 | 2016 | | |
2012 | 2017 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
71 | 82 | | |
72 | 83 | | |
73 | 84 | | |
| |||
0 commit comments