[Phpmyadmin-devel] PHPUnit tests and backupGlobals

Hi all, At the test suit level, backupGlobals directive is set to false preventing PHPUnit from backing up and restoring globals for every test. I was wondering why this is set like that. -- Thanks and Regards, Madhura Jayaratne

Hi, On Wednesday, 29 May 2013 at 11:51 PM, Madhura Jayaratne wrote:
Hi all,
At the test suit level, backupGlobals directive is set to false preventing PHPUnit from backing up and restoring globals for every test. I was wondering why this is set like that.
-- Thanks and Regards,
Madhura Jayaratne
------------------------------------------------------------------------------ Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET Get 100% visibility into your production application - at no cost. Code-level diagnostics for performance bottlenecks with <2% overhead Download for free and get started troubleshooting in minutes. http://p.sf.net/sfu/appdyn_d2d_ap1
_______________________________________________ Phpmyadmin-devel mailing list Phpmyadmin-devel@lists.sourceforge.net (mailto:Phpmyadmin-devel@lists.sourceforge.net) https://lists.sourceforge.net/lists/listinfo/phpmyadmin-devel
Different tests have or need different global settings. So I think this is to prevent the global settings of different tests from interfering with each other. Thanks, Ayush

Hi, That is a PHPUnit annotation setting. refer to link [1] [2] Hope it is useful to you. thanks @backupGlobals The backup and restore operations for global variables can be completely disabled for all tests of a test case class like this
Hi,
On Wednesday, 29 May 2013 at 11:51 PM, Madhura Jayaratne wrote:
Hi all,
At the test suit level, backupGlobals directive is set to false preventing PHPUnit from backing up and restoring globals for every test. I was wondering why this is set like that.
-- Thanks and Regards,
Madhura Jayaratne
------------------------------------------------------------------------------ Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET Get 100% visibility into your production application - at no cost. Code-level diagnostics for performance bottlenecks with <2% overhead Download for free and get started troubleshooting in minutes. http://p.sf.net/sfu/appdyn_d2d_ap1
[1] http://phpunit.de/manual/3.6/en/appendixes.annotations.html [2] http://stackoverflow.com/questions/3979076/phpunit-configuration-phpunit-xml... Adam

On Thu, May 30, 2013 at 9:14 AM, Ayush Chaudhary <ayushchd@gmail.com> wrote:
Hi,
On Wednesday, 29 May 2013 at 11:51 PM, Madhura Jayaratne wrote:
Hi all,
At the test suit level, backupGlobals directive is set to false preventing PHPUnit from backing up and restoring globals for every test. I was wondering why this is set like that.
Different tests have or need different global settings. So I think this is to prevent the global settings of different tests from interfering with each other.
Thanks, Ayush
If I understand correctly, when backupGlobals is set to true, before each test globals are backed up and restored after test execution. So any changes done to globals by the test do not propagate to the next test. Ideally each test should setup variables required for it and should not depend on other tests to set up variable values.
-- Thanks and Regards, Madhura Jayaratne

Hi Dne Thu, 30 May 2013 17:36:20 +0530 Madhura Jayaratne <madhura.cj@gmail.com> napsal(a):
If I understand correctly, when backupGlobals is set to true, before each test globals are backed up and restored after test execution. So any changes done to globals by the test do not propagate to the next test. Ideally each test should setup variables required for it and should not depend on other tests to set up variable values.
I think this is reasonable to enable - there might be many hidden consequences with shared globals. -- Michal Čihař | http://cihar.com | http://phpmyadmin.net

On Thursday, 30 May 2013 at 5:36 PM, Madhura Jayaratne wrote:
On Thu, May 30, 2013 at 9:14 AM, Ayush Chaudhary <ayushchd@gmail.com (mailto:ayushchd@gmail.com)> wrote:
Hi,
On Wednesday, 29 May 2013 at 11:51 PM, Madhura Jayaratne wrote:
Hi all,
At the test suit level, backupGlobals directive is set to false preventing PHPUnit from backing up and restoring globals for every test. I was wondering why this is set like that.
Different tests have or need different global settings. So I think this is to prevent the global settings of different tests from interfering with each other.
Thanks, Ayush
If I understand correctly, when backupGlobals is set to true, before each test globals are backed up and restored after test execution. So any changes done to globals by the test do not propagate to the next test. Ideally each test should setup variables required for it and should not depend on other tests to set up variable values.
You're right. It should be enabled.
-- Thanks and Regards,
Madhura Jayaratne
------------------------------------------------------------------------------ Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET Get 100% visibility into your production application - at no cost. Code-level diagnostics for performance bottlenecks with <2% overhead Download for free and get started troubleshooting in minutes. http://p.sf.net/sfu/appdyn_d2d_ap1
_______________________________________________ Phpmyadmin-devel mailing list Phpmyadmin-devel@lists.sourceforge.net (mailto:Phpmyadmin-devel@lists.sourceforge.net) https://lists.sourceforge.net/lists/listinfo/phpmyadmin-devel

Hi Dne Wed, 29 May 2013 23:51:28 +0530 Madhura Jayaratne <madhura.cj@gmail.com> napsal(a):
At the test suit level, backupGlobals directive is set to false preventing PHPUnit from backing up and restoring globals for every test. I was wondering why this is set like that.
I've just enabled it and fixed most of the tests with that. -- Michal Čihař | http://cihar.com | http://blog.cihar.com

On Tue, Jun 11, 2013 at 6:02 PM, Michal Čihař <michal@cihar.com> wrote:
Hi
Dne Wed, 29 May 2013 23:51:28 +0530 Madhura Jayaratne <madhura.cj@gmail.com> napsal(a):
At the test suit level, backupGlobals directive is set to false preventing PHPUnit from backing up and restoring globals for every test. I was wondering why this is set like that.
I've just enabled it and fixed most of the tests with that.
Thanks. I've removed some manual GLOBAL restorings that were used inside tests [1]
[1] https://github.com/phpmyadmin/phpmyadmin/commit/0f4e573b1e0bcb743334e4818102... -- Thanks and Regards, Madhura Jayaratne
participants (4)
-
adam
-
Ayush Chaudhary
-
Madhura Jayaratne
-
Michal Čihař