function OpenIDTest::testConversion

Test _openid_dh_XXX_to_XXX() functions.

File

drupal/core/modules/openid/lib/Drupal/openid/Tests/OpenIDTest.php, line 41
Definition of Drupal\openid\Tests\OpenIDTest.

Class

OpenIDTest
Test internal helper functions.

Namespace

Drupal\openid\Tests

Code

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