test_buildToken(); } public function test_buildToken() { $token = RtmTokenBuilder2::buildToken($this->appId, $this->appCertificate, $this->userId, $this->expire); $accessToken = new AccessToken2(); $accessToken->parse($token); Util::assertEqual($this->appId, $accessToken->appId); Util::assertEqual($this->expire, $accessToken->expire); Util::assertEqual($this->userId, $accessToken->services[ServiceRtm::SERVICE_TYPE]->userId); Util::assertEqual(ServiceRtm::SERVICE_TYPE, $accessToken->services[ServiceRtm::SERVICE_TYPE]->type); Util::assertEqual($this->expire, $accessToken->services[ServiceRtm::SERVICE_TYPE]->privileges[ServiceRtm::PRIVILEGE_LOGIN]); } } $rtmTokenBuilder2Test = new RtmTokenBuilder2Test(); $rtmTokenBuilder2Test->run();