Download & Extend

Replace SimpleTest browser with our own

Project:SimpleTest
Version:6.x-1.x-dev
Component:Code
Category:task
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

This patch uses the curl, dom and simplexml extensions. I have compatibility.php, dumper.php, exceptions.php, invoker.php, reporter.php simpletest.php, unit_tester.php, xml.php, default_reporter.php, errors.php, expectation.php, reflection_php5.php, scorer.php, test_case.php and VERSION in my simpletest dir and it works. A some of the code now comes from UnitTestCase instead of reimplementing. The Drupal interface did not change -- if you used $this->_browser , well, that's not good.

AttachmentSizeStatusTest resultOperations
php5powah_tests.patch80.38 KBIgnored: Check issue status.NoneNone

Comments

#1

There was a setbrowser call in user tests. That's trivial to reimplement.

AttachmentSizeStatusTest resultOperations
php5powah_tests.patch81.35 KBIgnored: Check issue status.NoneNone

#2

This needs be rerolled.

#3

Here it is. Much smaller... lots of whitespace changes not included.

AttachmentSizeStatusTest resultOperations
php5powah_tests.patch61.55 KBIgnored: Check issue status.NoneNone

#4

Status:needs review» needs work

ok, so from chx, the easiest way to setup to test this is to move the Soureforge version to somewhere else and just copy the files listed at the top to simpletest/simpletest

After fixing the .info file (note error in patch 7.x->6.x) A quick check on 7.x (HEAD) is functional; however, problems with the poll module tests (the only ones I ran):

51 passes, 16 fails and 0 exceptions.

even after adding $this->elements = FALSE; to curlExec in drupal_test_case.php as suggested by chx

#5

Not sure where I can provide feedback on the changes necessary to get simpletest, or a deriviate thereof, in core. One of the small things that annoy me is the desc field used in the get_info hook. For consistency with core, that should be called description instead of desc.

Edit: opened a separate issue at http://drupal.org/node/235013 . [chx]

#6

Status:needs work» needs review

poll now passes thanks to a generic fix in handleForm of SELECT elements.

AttachmentSizeStatusTest resultOperations
php5powah_tests.patch63.04 KBIgnored: Check issue status.NoneNone

#7

Now it handles forms without a selected option. Added a TODO "handle multiple selected in a multiple SELECT" -- I will deal with that later (much later. very low priority).

AttachmentSizeStatusTest resultOperations
php5powah_tests.patch63.2 KBIgnored: Check issue status.NoneNone

#8

Now it handles when the value and the displayed label of an option to be changed are different. This one was easy... Edit: $edit[$name] == $option was changed to $edit[$name] == $option['value'] which is better in code understanding too because the former contained an implicit string cast.

AttachmentSizeStatusTest resultOperations
php5powah_tests.patch63.21 KBIgnored: Check issue status.NoneNone

#9

This version goes over all the tests with a number of failures yes but no PHP fatals.

AttachmentSizeStatusTest resultOperations
php5powah_tests.patch75.7 KBIgnored: Check issue status.NoneNone

#10

This one improves on checkbox and radio handling so filter tests pass. there are a few failures still, with node tests, working on that, too. checkbox could be more elegant.

AttachmentSizeStatusTest resultOperations
php5powah_tests.patch75.88 KBIgnored: Check issue status.NoneNone

#11

Lots of fixes. filter, node, comments, block pass... locale has 1 failure, poll and book has more... but still, we are a lot better. biggest change change is that multiple forms on one page are now actually working thanks to adding a few dots to the handleForm xpath.

AttachmentSizeStatusTest resultOperations
php5powah_tests.patch81.77 KBIgnored: Check issue status.NoneNone

#12

Meh, I could not go to sleep before poll was fixed -- curious that it broke 'cos it was poll test that was broken.

AttachmentSizeStatusTest resultOperations
php5powah_tests.patch82.24 KBIgnored: Check issue status.NoneNone

#13

Possibly change the message in the handleForm function.

You tried to change a !type select to !edit and that's not allowed.

to
You tried to change a !type to !edit and that's not allowed.

Example:
You tried to change a textarea to somevalue and that's not allowed.

Obviously nothing big.

Other small thing: the patch change the info file core to 6.x. Technically this will all be committed to HEAD (7.x).

Other than that it is looking nice.

From the looks of the patch it appears you are fixing general things as well. Just trying to keep it straight for record.

#14

Status:needs review» needs work

patch fails on simpletest HEAD checkout

patching file tests/functional/node.test
Hunk #1 FAILED at 7.
Hunk #3 FAILED at 116.
Hunk #5 FAILED at 263.
3 out of 8 hunks FAILED -- saving rejects to file tests/functional/node.test.rej
patching file tests/functional/poll.test
Hunk #2 FAILED at 40.
Hunk #3 succeeded at 65 with fuzz 2.
1 out of 3 hunks FAILED -- saving rejects to file tests/functional/poll.test.rej

#15

Status:needs work» needs review

This one has most tests pass due to much better form handling. Profile has a few failures but... is a form a field? I do not think so. Poll tests, quite interestingly tends to break utterly if not run alone -- this has nothing to do with my changes, I would like to think 'cos even the theming of bars fail... when run alone, they pass. User registration also has failures I am studying those but I wanted to have this out.

AttachmentSizeStatusTest resultOperations
php5powah_tests.patch96.97 KBIgnored: Check issue status.NoneNone

#16

Well, user had a broken drupalGet and my code had no form action handling. Both are fixed, here.

AttachmentSizeStatusTest resultOperations
php5powah_tests.patch97.16 KBIgnored: Check issue status.NoneNone

#17

Note that though contact has two fails that is a core bug and not my code here.

#18

And now, translations pass as we now deal with the case when form actions contain queries. And, thanks to code reuse this makes clickLink works in the same case.

AttachmentSizeStatusTest resultOperations
php5powah_tests.patch103.66 KBIgnored: Check issue status.NoneNone

#19

Status:needs review» needs work

When I run any tests that uses a form (which should be all of them) it generates the following exception many times.

Unexpected PHP error [Undefined variable: handled] severity [E_NOTICE] in [/home/jimmy/software/php/simpletest/drupal_test_case.php line 588]

Code:
588: if (!isset($post[$name]) && !$handled) {

I'm going to guess that $handled needed to be initialized, but it doesn't appear that $handled is used in the code anymore. Possibly just left over?

Tests run fine without it:

588: if (!isset($post[$name])) {

#20

Status:needs work» fixed

I made the change above and committed.

#21

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

nobody click here