Skip to content

Commit

Permalink
Added testing documentation and ran test
Browse files Browse the repository at this point in the history
  • Loading branch information
tpavlek committed May 20, 2015
1 parent df72fa0 commit b9e04e9
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 0 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,17 @@ if (isset($_GET['code']) && $_GET['code']) {
// $user->profile_url = [ Full URL to profile on battle.net ]
}
```

Testing
--------

There is a simple scaffold for an integration test in `test/`. Unfortunately, it is nontrivial to use, as
the Battle.net OAuth service *requires* the use of `https` for all authentication traffic (but that does bode well for
security!)

Included is an SSL certificate as well as a private key for use with the domain `oauth2-bnet.local`. Simply add `oauth2-bnet.local`
to your `/etc/hosts` as an alias for localhost, and configure apache to serve the files in `test/` using the certificate
and key files in `test/ssl`.

Next edit `test/config.php` to fill in the values for your own client key from https://dev.battle.net and you should be able
to run the test. The page should redirect you to log in, and then dump your user values to screen if successful.
17 changes: 17 additions & 0 deletions test/ssl/server.crt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
-----BEGIN CERTIFICATE-----
MIICxzCCAjACCQD48HdWIk317zANBgkqhkiG9w0BAQsFADCBpzELMAkGA1UEBhMC
Q0ExEDAOBgNVBAgMB0FsYmVydGExETAPBgNVBAcMCEVkbW9udG9uMSQwIgYDVQQK
DBtEZXBvdHdhcmVob3VzZSBTb2Z0d2FyZSBJbmMxETAPBgNVBAsMCFNvZnR3YXJl
MRowGAYDVQQDDBFvYXV0aDItYm5ldC5sb2NhbDEeMBwGCSqGSIb3DQEJARYPdHJv
eUB0cGF2bGVrLm1lMB4XDTE1MDUyMDE4MTYwMVoXDTQwMDExMDE4MTYwMVowgacx
CzAJBgNVBAYTAkNBMRAwDgYDVQQIDAdBbGJlcnRhMREwDwYDVQQHDAhFZG1vbnRv
bjEkMCIGA1UECgwbRGVwb3R3YXJlaG91c2UgU29mdHdhcmUgSW5jMREwDwYDVQQL
DAhTb2Z0d2FyZTEaMBgGA1UEAwwRb2F1dGgyLWJuZXQubG9jYWwxHjAcBgkqhkiG
9w0BCQEWD3Ryb3lAdHBhdmxlay5tZTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkC
gYEAv++wxegh7Zsaab+wFEt8D9zUX+u3lHPIap1BMJdslW/G8LLMUMZCQEwzMYY5
c987fx8p/Dtoc+UgiH6akN7s01E3WtBQY2LlsKqoFezJmC2f7u50q+mVgEPIRVQZ
4vFs9g0jw7ZrH5CqTukCwlSVCBrqMOwzemq1ZumvRzo62ysCAwEAATANBgkqhkiG
9w0BAQsFAAOBgQADcH3H3xZ2YkNPi5fGKFSqhluQgIuDd+emU9AQZ3YWCQzKHXYq
VLyLmYydLIStSaz10jE557QfaY+oBsgKcdfXqgbwXC4jvLpd4j0UVjzV30d/rz2a
haGAPz0xNnJl6N5xHIzG5NtCT7AtyaiHvVMNOjUkCjWU9HIyluXgSrjo6w==
-----END CERTIFICATE-----
13 changes: 13 additions & 0 deletions test/ssl/server.csr
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
-----BEGIN CERTIFICATE REQUEST-----
MIIB6DCCAVECAQAwgacxCzAJBgNVBAYTAkNBMRAwDgYDVQQIDAdBbGJlcnRhMREw
DwYDVQQHDAhFZG1vbnRvbjEkMCIGA1UECgwbRGVwb3R3YXJlaG91c2UgU29mdHdh
cmUgSW5jMREwDwYDVQQLDAhTb2Z0d2FyZTEaMBgGA1UEAwwRb2F1dGgyLWJuZXQu
bG9jYWwxHjAcBgkqhkiG9w0BCQEWD3Ryb3lAdHBhdmxlay5tZTCBnzANBgkqhkiG
9w0BAQEFAAOBjQAwgYkCgYEAv++wxegh7Zsaab+wFEt8D9zUX+u3lHPIap1BMJds
lW/G8LLMUMZCQEwzMYY5c987fx8p/Dtoc+UgiH6akN7s01E3WtBQY2LlsKqoFezJ
mC2f7u50q+mVgEPIRVQZ4vFs9g0jw7ZrH5CqTukCwlSVCBrqMOwzemq1ZumvRzo6
2ysCAwEAAaAAMA0GCSqGSIb3DQEBCwUAA4GBAEFo9eFrenMLnFstjMnifcDW8Cx0
unD6Q+5wHdSV8hR0bolCMZ5L4zM1Tbgb+Dfo6KEszbg9ySCZXYCvlUPEJhSxt7ap
HsEEISbR+e8UOpc6WZTAhHLZ8HGCQBI+T+OGXIOYIJh2ej10Z9oVUre050oypNXY
/z6FmYONKjmbranv
-----END CERTIFICATE REQUEST-----
15 changes: 15 additions & 0 deletions test/ssl/server.key
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
-----BEGIN RSA PRIVATE KEY-----
MIICXQIBAAKBgQC/77DF6CHtmxppv7AUS3wP3NRf67eUc8hqnUEwl2yVb8bwssxQ
xkJATDMxhjlz3zt/Hyn8O2hz5SCIfpqQ3uzTUTda0FBjYuWwqqgV7MmYLZ/u7nSr
6ZWAQ8hFVBni8Wz2DSPDtmsfkKpO6QLCVJUIGuow7DN6arVm6a9HOjrbKwIDAQAB
AoGAHcOawyX7VPBviSSbtpn6FC+nk3RnVJMb6kSWnmVtBkN+M0dW3dPQ5E2sxqpM
8IYWoOEBTscbrJVElUYkzAB18w34qi9kMlxgLk22cxCTNWZu3yLPeZu/CisWVymk
2R1o0CqJnKLyEze4SseqylsMEE/4m3/A4V7dcAiM9m4vsKECQQD40DKQJkAnHsXA
G8qqK5KQ30SnO5LdHDKE2kMF4yjyLhpOybg5i1Spiurh6bRrzSzYH19/rOI6BkKy
s2mIDJwxAkEAxXrtTlYsyoMD2z00cCCuFo/O/Lj5VGYCwPUORVjJ6QfBL2HZZa6X
8yZ7R1EGTmJb+ll6oybsBuZVgsDyzQ4CGwJBAJlQuQdn+nnglVvGBECNbtfEK+qc
Y+fJWzvPviLfkbiBPga0d8dFmpqKFie0uU7/85UM5+ylXBUDDJBOy0Vg99ECQQCC
ZVsQoOJOjhgbydw4Nbv99dNNGK65xeoHk0hrDee00YQET24HMDPxP/Wi76NkWpo1
QqQx2t965tiLz/AC6j8FAkButtf0xVVdO/zuW5LFXFbDzKmWM/oRzAogN/LyXVI8
J85qu1u/5PFmEKHXSO6QpcFFY4GBQigkt7X/85FjTiOo
-----END RSA PRIVATE KEY-----

0 comments on commit b9e04e9

Please sign in to comment.