summaryrefslogtreecommitdiffstats
path: root/Tests/Auth/OpenID/SReg.php
diff options
context:
space:
mode:
authorLuke Shepard <lshepard@devrs006.snc1.facebook.com>2009-05-27 10:54:14 -0700
committerLuke Shepard <lshepard@devrs006.snc1.facebook.com>2009-05-27 10:54:14 -0700
commitae52c6b3a3b9741c0ef60b6c91ba27af1d85eab7 (patch)
tree450c172565fffe576264e64ea83a9c4978709da9 /Tests/Auth/OpenID/SReg.php
parent5a96dc7b3fbd600f5acbbf08cf8d2d131aa7f2d3 (diff)
downloadphp-openid-ae52c6b3a3b9741c0ef60b6c91ba27af1d85eab7.zip
php-openid-ae52c6b3a3b9741c0ef60b6c91ba27af1d85eab7.tar.gz
php-openid-ae52c6b3a3b9741c0ef60b6c91ba27af1d85eab7.tar.bz2
[ Upgrading php-openid test framework to use PHPUnit 3.3 ]
Reviewed By: Will Norris The set of tests assumes PHPUnit 2.3, which conflicts with my environment setup. I think PHPUnit 3.3 is pretty widespread now, and under active maintenance (latest rev 4/10/2009). There's a few changes included here. I did a few mostly automated code transformations: replace "PHPUnit_TestCase" "PHPUnit_Framework_TestCase" replace "PHPUnit_TestSuite" "PHPUnit_Framework_TestSuite" removed all require_once "PHPUnit.php" - they are unnecessary. "call by reference" is now deprecated, so changed "&$" to "$" I also made a few changes to admin/testtext.php and Tests/TestDriver.php to accomodate the new syntax. Note that this just upgrades the framework; it does not guarantee that all tests pass. I'll submit future diffs to fix or disable failing unit tests. I wasn't able to get the tests running with the previous version, so I don't know if these have always been failing. I doubt that the github has automatically running unit tests, but if so then we'll have to make sure that the central repo is running the same version of PHPUnit.
Diffstat (limited to 'Tests/Auth/OpenID/SReg.php')
-rw-r--r--Tests/Auth/OpenID/SReg.php24
1 files changed, 11 insertions, 13 deletions
diff --git a/Tests/Auth/OpenID/SReg.php b/Tests/Auth/OpenID/SReg.php
index 5142b63..3e453b9 100644
--- a/Tests/Auth/OpenID/SReg.php
+++ b/Tests/Auth/OpenID/SReg.php
@@ -8,9 +8,7 @@ require_once 'Auth/OpenID/SReg.php';
require_once 'Auth/OpenID/Message.php';
require_once 'Auth/OpenID/Server.php';
-require_once 'PHPUnit.php';
-
-class SRegURITest extends PHPUnit_TestCase {
+class SRegURITest extends PHPUnit_Framework_TestCase {
function test_is11()
{
$this->assertEquals(Auth_OpenID_SREG_NS_URI_1_1,
@@ -18,7 +16,7 @@ class SRegURITest extends PHPUnit_TestCase {
}
}
-class CheckFieldNameTest extends PHPUnit_TestCase {
+class CheckFieldNameTest extends PHPUnit_Framework_TestCase {
function test_goodNamePasses()
{
global $Auth_OpenID_sreg_data_fields;
@@ -54,7 +52,7 @@ class FakeEndpoint {
}
}
-class SupportsSRegTest extends PHPUnit_TestCase {
+class SupportsSRegTest extends PHPUnit_Framework_TestCase {
function test_unsupported()
{
$endpoint = new FakeEndpoint(array());
@@ -95,7 +93,7 @@ class FakeMessage {
}
}
-class GetNSTest extends PHPUnit_TestCase {
+class GetNSTest extends PHPUnit_Framework_TestCase {
function setUp()
{
$this->msg = new FakeMessage();
@@ -182,7 +180,7 @@ $__args_sentinel = 'args_sentinel';
$__ns_sentinel = 'ns_sentinel';
class SentinelFakeMessage {
- function SentinelFakeMessage(&$test_case)
+ function SentinelFakeMessage($test_case)
{
$this->test_case =& $test_case;
$this->message = new Auth_OpenID_Message();
@@ -200,7 +198,7 @@ class SentinelFakeMessage {
global $__TestingReq_TEST_CASE;
$__TestingReq_TEST_CASE = "FLUB";
-function __setTestCase(&$thing) {
+function __setTestCase($thing) {
global $__TestingReq_TEST_CASE;
$__TestingReq_TEST_CASE = $thing;
}
@@ -211,7 +209,7 @@ function &__getTestCase() {
}
class TestingReq extends Auth_OpenID_SRegRequest {
- function fromOpenIDRequest(&$thing, &$test_case)
+ function fromOpenIDRequest($thing, $test_case)
{
__setTestCase($test_case);
$obj = parent::fromOpenIDRequest($thing, 'TestingReq');
@@ -232,7 +230,7 @@ class TestingReq extends Auth_OpenID_SRegRequest {
}
}
-class SRegRequestTest extends PHPUnit_TestCase {
+class SRegRequestTest extends PHPUnit_Framework_TestCase {
function test_constructEmpty()
{
$req = Auth_OpenID_SRegRequest::build();
@@ -573,7 +571,7 @@ class DummySuccessResponse {
}
}
-class SRegResponseTest extends PHPUnit_TestCase {
+class SRegResponseTest extends PHPUnit_Framework_TestCase {
function test_fromSuccessResponse_signed()
{
$message = Auth_OpenID_Message::fromOpenIDArgs(array(
@@ -599,7 +597,7 @@ class SRegResponseTest extends PHPUnit_TestCase {
}
}
-class SendFieldsTest extends PHPUnit_TestCase {
+class SendFieldsTest extends PHPUnit_Framework_TestCase {
function _test($uri)
{
// Create a request message with simple registration fields
@@ -654,7 +652,7 @@ class SendFieldsTest extends PHPUnit_TestCase {
}
}
-class Tests_Auth_OpenID_SReg extends PHPUnit_TestSuite {
+class Tests_Auth_OpenID_SReg extends PHPUnit_Framework_TestSuite {
function getName()
{
return "Tests_Auth_OpenID_SReg";