elliotchance / concise

✅ Concise is test framework for using plain English and minimal code, built on PHPUnit.
MIT License
45 stars 3 forks source link

Don't change the access level of setUp() and tearDown() #340

Closed willemstuursma closed 5 years ago

willemstuursma commented 7 years ago

PHPUnit has these as protected, as has most of our test suite. Switching our base testcase class would require changing all our (thousands of) protected setUp() and tearDown() methods to public.


This change is Reviewable

coveralls commented 7 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling 0bcc339e43cab1999192ea88c55d3d5262c1fc4b on willemstuursma:patch-1 into 445c82060871663b197ddf51a90a5add1c6efe68 on elliotchance:master.

willemstuursma commented 7 years ago

I'll take care of the test breakage.

coveralls commented 7 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling fb414412cd09fbbc73316851c7b7fa71c07dee66 on willemstuursma:patch-1 into 445c82060871663b197ddf51a90a5add1c6efe68 on elliotchance:master.

willemstuursma commented 7 years ago

@elliotchance sorry, I am not sure what this last Travis build is attempting to do?

elliotchance commented 7 years ago

Reviewed 1 of 1 files at r1, 1 of 1 files at r2. Review status: all files reviewed at latest revision, 1 unresolved discussion, some commit checks failed.


_tests/Concise/Core/TestCaseExternalTest.php, line 19 at r2 (raw file):_

    public function checkSomething()
    {
        $this->testCase->setUp();

I understand you have removed these because setUp() is no longer public but the code is here for a reason and cannot be removed. External frameworks and test case runners (for example: Pho) need to be able to call these methods explicitly or be provided a new way to do so.

This is also why the build is failing:

PHP Fatal error:  Uncaught exception 'BadMethodCallException' with message 'No such method Concise\Core\IndependentTestCase::setUp()' in /home/travis/build/elliotchance/concise/src/Concise/Core/TestCase.php:331

Creating new public methods that call the internal setUp() and tearDown() on the Concise\Core\TestCase would be an acceptable way around this.


Comments from Reviewable

elliotchance commented 5 years ago

Not needed anymore.