function OpenIDTestCase::testConversion

Test _openid_dh_XXX_to_XXX() functions.

File

drupal/modules/openid/openid.test, line 682
Tests for openid.module.

Class

OpenIDTestCase
Test internal helper functions.

Code

function testConversion() {
  $this
    ->assertIdentical(_openid_dh_long_to_base64('12345678901234567890123456789012345678901234567890'), 'CHJ/Y2mq+DyhUCZ0evjH8ZbOPwrS', '_openid_dh_long_to_base64() returned expected result.');
  $this
    ->assertIdentical(_openid_dh_base64_to_long('BsH/g8Nrpn2dtBSdu/sr1y8hxwyx'), '9876543210987654321098765432109876543210987654321', '_openid_dh_base64_to_long() returned expected result.');
  $this
    ->assertIdentical(_openid_dh_long_to_binary('12345678901234567890123456789012345678901234567890'), "", '_openid_dh_long_to_binary() returned expected result.');
  $this
    ->assertIdentical(_openid_dh_binary_to_long(""), '9876543210987654321098765432109876543210987654321', '_openid_dh_binary_to_long() returned expected result.');
}