Project:OpenID Provider
Version:6.x-1.x-dev
Component:Code
Category:task
Priority:normal
Assigned:Aron Novak
Status:needs work

Issue Summary

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.

AttachmentSize
openid_provider_test.patch3.58 KB

Comments

#1

Title:Functional testing» Unit testing

Isn't this more unit than functional tests?

What coverage are we aiming at now?

#2

Sorry, 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.

#3

Well, 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...

#4

Well, 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

#5

Well, 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).

#6

Status:needs review» needs work

I 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:

DH public has correct length. Other openid_provider.test 65 OpenIDProviderTestCase->testOpenIDProviderDHAssoc()

Second, there are a bunch of warnings like this:

Starting run with db_prefix simpletest767840 System openid_provider.test 10 OpenIDProviderTestCase->setUp()
Table 'idorangeseedsorg.simpletest767840variable' doesn't exist query: UPDATE simpletest767840variable SET value = 's:4:\"/tmp\";' WHERE name = 'file_directory_temp' User warning database.mysqli.inc 135 _db_query()
Table 'idorangeseedsorg.simpletest767840cache' doesn't exist query: DELETE FROM simpletest767840cache WHERE cid = 'variables' User warning database.mysqli.inc 135 _db_query()

... every time a test is setup.

#7

Note 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...