WebTestCase is losing its _browser....

Discussion of testing theory and practice, including methodologies (such as TDD, BDD, DDD, Agile, XP) and software - anything to do with testing goes here. (Formerly "The Testing Side of Development")

Moderator: General Moderators

Post Reply
User avatar
nielsene
DevNet Resident
Posts: 1834
Joined: Fri Aug 16, 2002 8:57 am
Location: Watertown, MA

WebTestCase is losing its _browser....

Post 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?]
McGruff
DevNet Master
Posts: 2893
Joined: Thu Jan 30, 2003 8:26 pm
Location: Glasgow, Scotland

Post 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 ;)
User avatar
nielsene
DevNet Resident
Posts: 1834
Joined: Fri Aug 16, 2002 8:57 am
Location: Watertown, MA

Post 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.
User avatar
nielsene
DevNet Resident
Posts: 1834
Joined: Fri Aug 16, 2002 8:57 am
Location: Watertown, MA

Post 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.
Post Reply