Page 1 of 1

WebTestCase is losing its _browser....

Posted: Sun Aug 07, 2005 8:57 pm
by nielsene
I currently have a class hierachy of
WebTestCase (from SimpleTest) <--- DatabaseWebTestCase (adds on sandboxeing) <--- WebAuthTestCase (builds in the required application autnetication).

The DatabaseWebTestCase is my new component. Everything worked with WebAuthTestCase before. Now I'm getting errors on line 704 of web_tester -- apparently WebTestCase's _browser is no longer being initialized.

I am chaining constructors and setUp/tearDown's, I have no member variables masking the underlying ones. Any idess as to what could interfere with _browser in web_tester?

[EDIT:
OK I'm extremely confused now, I've been staring through the WebTestCase code. I can't figure out how it ever worked before. Neither the constructor nor the setUp initialize the _browser member variables. None of the mthods that use it do an lazy initialization. I see that I can explciictly call setBrowser($this->createBrowser()), but I never had to before.... What's missing?]

Posted: Mon Aug 08, 2005 1:11 am
by McGruff
Not sure what the problem could be. I've hacked together the odd custom assertion but I'm not too familiar with the code.

You could always try stepping through the code with die(__FILE__ . ' | ' . __LINE__) or something similar. Once you're testing you don't have to do that too often ;)

Posted: Mon Aug 08, 2005 4:15 pm
by nielsene
Ugh its getting worse....

SimpleTestCase is now losing its _runner....

I just downloaded a new copy of simpletest and the problem is still here. I've emailed the simpletest list, but I know Marcus is travelling this week....

I just ran the test suites (unit and all) for simpletest and they all passed.

Posted: Mon Aug 08, 2005 9:03 pm
by nielsene
Looks like its due to my testing the tests.

Both WebTestCase and UnitTestCase do some of their setup in their invoke method. So just chaining constructors and setUp won't get the underlying testcase into a valud state to test.