Posted by chx on March 9, 2008 at 10:58pm
4 followers
| 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.
| Attachment | Size | Status | Test result | Operations |
|---|---|---|---|---|
| php5powah_tests.patch | 80.38 KB | Ignored: Check issue status. | None | None |
Comments
#1
There was a setbrowser call in user tests. That's trivial to reimplement.
#2
This needs be rerolled.
#3
Here it is. Much smaller... lots of whitespace changes not included.
#4
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
descfield used in theget_infohook. For consistency with core, that should be calleddescriptioninstead ofdesc.Edit: opened a separate issue at http://drupal.org/node/235013 . [chx]
#6
poll now passes thanks to a generic fix in
handleFormofSELECTelements.#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).
#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] == $optionwas changed to$edit[$name] == $option['value']which is better in code understanding too because the former contained an implicit string cast.#9
This version goes over all the tests with a number of failures yes but no PHP fatals.
#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.
#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.
#12
Meh, I could not go to sleep before poll was fixed -- curious that it broke 'cos it was poll test that was broken.
#13
Possibly change the message in the
handleFormfunction.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
patch fails on simpletest HEAD checkout
patching file tests/functional/node.testHunk #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
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.
#16
Well, user had a broken drupalGet and my code had no form action handling. Both are fixed, here.
#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.
#19
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
$handledneeded to be initialized, but it doesn't appear that$handledis used in the code anymore. Possibly just left over?Tests run fine without it:
588: if (!isset($post[$name])) {#20
I made the change above and committed.
#21
Automatically closed -- issue fixed for two weeks with no activity.