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

[test] Call parent tearDown more consistently #14552

Merged
merged 1 commit into from
Jun 16, 2019

Conversation

eileenmcnaughton
Copy link
Contributor

Overview

Fix consistency on test teardown

Before

Less consistency on calling parent function

After

More consistency

Technical Details

Primarliy consistentcy - also supports checking nullArray is cleared per

#14550

Comments

@civibot
Copy link

civibot bot commented Jun 15, 2019

(Standard links)

@civibot civibot bot added the master label Jun 15, 2019
@seamuslee001
Copy link
Contributor

@eileenmcnaughton

PHP Deprecated:  Non-static method CiviUnitTestCase::tearDown() should not be called statically in /home/jenkins/bknix-dfl/build/core-14552-3808w/sites/all/modules/civicrm/tests/phpunit/api/v3/ContributionPageTest.php on line 1657
PHP Stack trace:
PHP   1. {main}() /home/jenkins/bknix-dfl/civicrm-buildkit/extern/phpunit6/phpunit6.phar:0
PHP   2. PHPUnit\TextUI\Command::main() /home/jenkins/bknix-dfl/civicrm-buildkit/extern/phpunit6/phpunit6.phar:570
PHP   3. PHPUnit\TextUI\Command->run() phar:///home/jenkins/bknix-dfl/civicrm-buildkit/extern/phpunit6/phpunit6.phar/phpunit/TextUI/Command.php:148
PHP   4. PHPUnit\TextUI\TestRunner->doRun() phar:///home/jenkins/bknix-dfl/civicrm-buildkit/extern/phpunit6/phpunit6.phar/phpunit/TextUI/Command.php:195
PHP   5. PHPUnit\Framework\TestSuite->run() phar:///home/jenkins/bknix-dfl/civicrm-buildkit/extern/phpunit6/phpunit6.phar/phpunit/TextUI/TestRunner.php:545
PHP   6. PHPUnit\Framework\TestSuite->run() phar:///home/jenkins/bknix-dfl/civicrm-buildkit/extern/phpunit6/phpunit6.phar/phpunit/Framework/TestSuite.php:755
PHP   7. api_v3_ContributionPageTest::tearDownAfterClass() phar:///home/jenkins/bknix-dfl/civicrm-buildkit/extern/phpunit6/phpunit6.phar/phpunit/Framework/TestSuite.php:760
PHP Fatal error:  Uncaught Error: Using $this when not in object context in /home/jenkins/bknix-dfl/build/core-14552-3808w/sites/all/modules/civicrm/tests/phpunit/CiviTest/CiviUnitTestCase.php:458
Stack trace:
#0 /home/jenkins/bknix-dfl/build/core-14552-3808w/sites/all/modules/civicrm/tests/phpunit/api/v3/ContributionPageTest.php(1657): CiviUnitTestCase::tearDown()
#1 phar:///home/jenkins/bknix-dfl/civicrm-buildkit/extern/phpunit6/phpunit6.phar/phpunit/Framework/TestSuite.php(760): api_v3_ContributionPageTest::tearDownAfterClass()
#2 phar:///home/jenkins/bknix-dfl/civicrm-buildkit/extern/phpunit6/phpunit6.phar/phpunit/Framework/TestSuite.php(755): PHPUnit\Framework\TestSuite->run(Object(PHPUnit\Framework\TestResult))
#3 phar:///home/jenkins/bknix-dfl/civicrm-buildkit/extern/phpunit6/phpunit6.phar/phpunit/TextUI/TestRunner.php(545): PHPUnit\Framework\TestSuite->run(Object(PHPUnit\Framework\TestResult))
#4 phar:///home/jenkins/bknix-dfl/civicrm-buildkit/extern/phpunit6/phpunit6.phar/phpunit/TextUI/Command.php(195): PHPUnit\TextU in /home/jenkins/bknix-dfl/build/core-14552-3808w/sites/all/modules/civicrm/tests/phpunit/CiviTest/CiviUnitTestCase.php on line 458

@seamuslee001
Copy link
Contributor

@eileenmcnaughton test failures relate i think

@@ -1650,6 +1654,7 @@ public static function tearDownAfterClass() {
);
$unitTest = new CiviUnitTestCase();
$unitTest->quickCleanup($tablesToTruncate);
parent::tearDown();
Copy link
Contributor

Choose a reason for hiding this comment

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

@eileenmcnaughton this needs to be

Suggested change
parent::tearDown();
$unitTest->teardown();

Primarliy consistentcy - also supports checking nullArray is cleared per

civicrm#14550
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants