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

WIP Improvements to FeatureTestCaseTest #1904

Closed
wants to merge 11 commits into from

Conversation

jim-parry
Copy link
Contributor

  • added 'patch' to allowed HTTP verbs in RouteCollection
  • added resetRoutes() in RouteCollection, to support FeatureTestCase
  • added output capturing to FeatureTestCase::call
  • added more methods to tests/_support/Controllers/Popcorn, to generate all the different kinds of responses
  • added note to testing/features in user guide

Related to #1767, #1692 & possibly #1697

@jim-parry jim-parry changed the title Working on FeatureTestCaseTest WIP Working on FeatureTestCaseTest Apr 1, 2019
@lonnieezell
Copy link
Member

@jim-parry I got it working for me in this branch. Does that work for you also?

@jim-parry
Copy link
Contributor Author

testing

@jim-parry
Copy link
Contributor Author

That does fix things :) I have incorporated the changes into my original PR & pushed. Now I can finish the tests, thanks!

@jim-parry
Copy link
Contributor Author

Hmmm - the tests run locally fine as "./phpunit tests/system/Test/", but not as "./phpunit".
I don't see how that affects things, but will revisit in the morning :-/

@jim-parry
Copy link
Contributor Author

jim-parry commented Apr 3, 2019

travis-ci is breaking in SQLite3 stuff - not related to this PR as far as I can tell.
@lonnieezell what do you think - is there something else to fix, or is this good to merge?

@jim-parry jim-parry changed the title WIP Working on FeatureTestCaseTest Working on FeatureTestCaseTest Apr 3, 2019
@jim-parry jim-parry changed the title Working on FeatureTestCaseTest Improvements to FeatureTestCaseTest Apr 3, 2019
@@ -147,7 +147,7 @@ class CLI
*
* @var string
*/
protected static $lastWrite;
protected static $lastWrite = 'write';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What were you running into here? Lastwrite should be null before it's used so that an initial call to 'write' will add an empty line.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem is that the previous unit tests were not looking for that empty line, and hence failed on mmy system. Basically, the previous PR broke that unit test on my system.

@lonnieezell
Copy link
Member

These two might have been caused by these changes:

  1. CodeIgniter\CodeIgniterTest::testRunClosureRoute
    Test code or tested code did not (only) close its own output buffers
  2. CodeIgniter\CodeIgniterTest::testRun404OverrideByClosure
    Test code or tested code did not (only) close its own output buffers

No clue why the sqlite is failing now. Nothing in here should have touched that.

@jim-parry
Copy link
Contributor Author

I have been getting some strange unit testing results with CodeIgniterTest and MigrationRunnerTest for some weeks now. I think it might be time to reclone & reconstruct my local repo :-/
I'm going to leave this PR unmerged for now, and deal with it properly when time permits. I'll tag it for the next release instead.

@jim-parry jim-parry changed the title Improvements to FeatureTestCaseTest WIP Improvements to FeatureTestCaseTest Apr 4, 2019
@jim-parry jim-parry closed this May 1, 2019
@jim-parry jim-parry deleted the testing30 branch May 2, 2019 06:44
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

Successfully merging this pull request may close these issues.

2 participants