It should be possible to write testing routines for the CAS module, much like the testing routines in the openid module in core.
I'm setting priority to minor since there are more pressing issues at the moment (like getting a D7 version shipped).
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | 1011848-D6-port-of-tests.patch | 6.81 KB | bfroehle |
Comments
Comment #1
bfroehle commentedTagging as "CAS Wishlist", so that we don't forgot our long-term plans.
Comment #2
bfroehle commentedThis is much harder than I anticipated since, since phpCAS expects the CAS server https. This prevents (easily) creating a mock CAS server using a test_cas.module which I originally had planned on doing.
Marking as postponed, blocking on https://issues.jasig.org/browse/PHPCAS-97
Comment #3
bfroehle commentedApparently it's not impossible:
(from [PHPCAS-97] Allow for http CAS servers
This might suggest the addition of a hook which allows the phpCAS object to be directly altered before authentication --- i.e. a hook_cas_phpcas_alter() or similar.
Comment #4
bfroehle commentedCreated a development branch: http://drupalcode.org/project/cas.git/shortlog/refs/heads/1011848-test-r...
Basic test routines for using the User API are already present. (The goal here would be to catch issues like #1087136: CAS User name does not save in D6, however the test routines are strictly for D7 at this point and I don't anticipate backporting them to D6.)
Comment #5
bfroehle commentedI've committed the current progress to 7.x-1.x, see http://drupalcode.org/project/cas.git/commit/d760e61
Please note some tests are failing, particularly in the "Login Redirection" test case. This means either the test is inappropriate or the code is not properly handling the test case.
Most of these failures relate to the handling of
''vsvariable_get('site_frontpage', 'node')as the default front page. CAS currently uses the latter option which redirects to 'node', but I think for the sake of pretty URLs it'd be better to redirect to''which would truly give you the front page. Both have the same page content.Another failures relate to logging in using the user login block which redirects you to the front page instead of keeping you at the page you started from.
Comment #6
bfroehle commentedI'm going to work on backporting the tests to 6.x-3.x now. I assume it should be relatively straightforward, but I've never worked with SimpleTest in D6 yet.
Comment #7
bfroehle commentedPorted to D6 and committed in http://drupalcode.org/project/cas.git/commit/0bad1c35
The differences to the original D7 commit are attached here.