Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I wrote some basic functional tests for the module.
For more in-depth testing, it would be good to have two sites, one provider and one "client" site.
Comment | File | Size | Author |
---|---|---|---|
openid_provider_test.patch | 3.58 KB | Aron Novak |
Comments
Comment #1
anarcat CreditAttribution: anarcat commentedIsn't this more unit than functional tests?
What coverage are we aiming at now?
Comment #2
Aron NovakSorry, i wrote nonsense, these are unit tests, not functional tests, of course :)
Coverage, well, i tried to test as many places as possible, some functions cannot be really tested because of the lack of the client part.
Comment #3
anarcat CreditAttribution: anarcat commentedWell, that was what i was wondering: can we test the client part? There are things like http://openidenabled.com/resources/openid-test/diagnose-server/ that can do that...
Comment #4
Aron NovakWell, i think this is a problematic question. This means that you
1) could not test without network connection (however it's not common, but possible, servers behind strict firewall)
2) tests will fail if network fail - you have to find out where is the problem
Comment #5
anarcat CreditAttribution: anarcat commentedWell, tests could be local: we could use the openid.module to do tests against the openid_provider.module. It would be hard because you have to reproduce the behaviour of the web browser but it's possible.
I don't think this idea should block this patch however, which looks nice to me (but I haven't tested it).
Comment #6
anarcat CreditAttribution: anarcat commentedI have committed the patch, but it needs some more love. First there's already a test that fails, maybe because of recent changes to the code:
Second, there are a bunch of warnings like this:
... every time a test is setup.
Comment #7
anarcat CreditAttribution: anarcat commentedNote that I have submitted a few tests upstream to Drupal core's functions. See #1419768: import tests from openid_provider module for followup.
I guess the next step here would be to test logins...
Comment #8
anarcat CreditAttribution: anarcat commentedlet's close this for now, unit tests exist, they need to be expanded, but we can work on that later, it's not a blocker for anything, and people wishing to scratch an itch will do so.
Actually, i have opened #1843514: unit test login procedures for this.