* @package taoLti */ class OauthTestCase extends TaoPhpUnitTestRunner { private $oauthCustomer; /** * tests initialization */ public function setUp(): void { TaoPhpUnitTestRunner::initTest(); $oauthClass = new core_kernel_classes_Class(OAuthDataStore::CLASS_URI_OAUTH_CONSUMER); $resource = $oauthClass->createInstanceWithProperties([ OAuthDataStore::PROPERTY_OAUTH_KEY => 'test_key', OAuthDataStore::PROPERTY_OAUTH_SECRET => md5(rand()), ]); $this->oauthCustomer = new tao_models_classes_oauth_Credentials($resource); } public function tearDown(): void { $this->oauthCustomer->delete(); } /** * @doesNotPerformAssertions */ public function testSignature() { $request = new common_http_Request('http://example.com/oauthtest'); $service = new tao_models_classes_oauth_Service(); $signed = $service->sign($request, $this->oauthCustomer); //assert no exception $service->validate($signed); } }