summaryrefslogtreecommitdiffstats
path: root/Tests/Net/OpenID/Association.php
blob: 8e547c2267af9fe97d631975d018c3554cfc43ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php

/**
 * Tests for the Association implementation.
 *
 * PHP versions 4 and 5
 *
 * LICENSE: See the COPYING file included in this distribution.
 *
 * @package OpenID
 * @author JanRain, Inc. <openid@janrain.com>
 * @copyright 2005 Janrain, Inc.
 * @license http://www.gnu.org/copyleft/lesser.html LGPL
 */

require_once('PHPUnit.php');
require_once('Net/OpenID/Association.php');

class Tests_Net_OpenID_Association extends PHPUnit_TestCase {
    function test_me()
    {
        $issued = time();
        $lifetime = 600;
        $assoc = new Net_OpenID_Association('handle', 'secret', $issued,
                                            $lifetime, 'HMAC-SHA1');
        $s = $assoc->serialize();
        $assoc2 = Net_OpenID_Association::deserialize('Net_OpenID_Association',
                                                      $s);
        if ($assoc2 === null) {
            $this->fail('deserialize returned null');
        } else {
            $this->assertTrue($assoc2->equal($assoc));
        }
    }
}

?>