summaryrefslogtreecommitdiffstats
path: root/Tests/Net/OpenID/Association.php
blob: 61b9789db93835451cf84ff9658de14bca495665 (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
<?php

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));
        }
    }
}

?>