A PHP Error was encountered

Severity: 8192

Message: Function get_magic_quotes_gpc() is deprecated

Filename: core/Input.php

Line Number: 516

A PHP Error was encountered

Severity: 8192

Message: Function get_magic_quotes_gpc() is deprecated

Filename: core/Input.php

Line Number: 516

A PHP Error was encountered

Severity: Notice

Message: Trying to access array offset on value of type null

Filename: Query/Parser.php

Line Number: 2326

A PHP Error was encountered

Severity: Notice

Message: Trying to access array offset on value of type null

Filename: Query/Parser.php

Line Number: 2326

A PHP Error was encountered

Severity: Notice

Message: Trying to access array offset on value of type null

Filename: Query/Parser.php

Line Number: 2326

Diff for base64_encode tests versions 15 and 23 | JsPHP: a JavaScript library providing the PHP API

Diff tests: base64_encode

Function:
Description: Encodes string using MIME base64 algorithm.
Version A:
Version B:
base64_encode tests version 15base64_encode tests version 23
 1function base64_encode_tests() {
 1function base64_encode_tests() {
 2
 2
 3  // API reference: http://docs.jquery.com/QUnit
 3  // API reference: http://docs.jquery.com/QUnit
 4  module( "base64_encode" );
 4  module( "base64_encode" );
 5
 5
 6  function cycle( $value ) {
 6  function cycle( $value, $utf8_encode ) {
 7
 7
 8    var $encoded = base64_encode( $value );
 8    var $clean_value = $utf8_encode ? utf8_encode( $value ) : $value;
 9
10    var $encoded = base64_encode( $clean_value );
 9    var $decoded = base64_decode( $encoded );
11    var $decoded = base64_decode( $encoded );
10
12
11    equal( $decoded, $value );
13    if ( $utf8_encode ) { $decoded = utf8_decode( $decoded ); }
12
14
15    equal( $decoded, $value, 'Encoded/decoded equals original value.' );
16
13  }
17  }
14
18
15  test( "base64_encode", function() {
19  test( "base64_encode", function() {
16
20
17    var data = [
21    var data = [
18      [ '', '', 0 ],
22      [ '', '', 0, false ],
19      [ 'a', 'YQ==', 1 ],
23      [ 'a', 'YQ==', 1, false ],
20      [ 1, 'MQ==', 1 ],
24      [ 1, 'MQ==', 1, false ],
21      [ '1', 'MQ==', 1 ],
25      [ '1', 'MQ==', 1, false ],
22      [ '漢字仮名交じり文', '5ryi5a2X5Luu5ZCN5Lqk44GY44KK5paH', 24 ]
26      [ '漢字仮名交じり文', '5ryi5a2X5Luu5ZCN5Lqk44GY44KK5paH', 24, true ]
23    ];
27    ];
24
28
25    for ( var i in data ) {
29    for ( var i in data ) {
26
30
31      var is_utf16 = data[ i ][ 3 ];
27      var utf8 = utf8_encode( data[ i ][ 0 ] );
32      var utf8 = utf8_encode( data[ i ][ 0 ] );
28
33
29      equal( base64_encode( utf8 ), data[ i ][ 1 ] );
34      equal( base64_encode( utf8 ), data[ i ][ 1 ] );
35
36      cycle( utf8, true );
37      cycle( utf8, false );
38      cycle( data[ i ][ 0 ], true );
30
39
31      cycle( utf8 );
40      if ( is_utf16 ) {
32      //cycle( data[ i ][ 0 ] );
41        raises(
42          function() { cycle( data[ i ][ 0 ], false ); },
43          'Cannot encode UTF-16 string.',
44          'Cannot encode UTF-16 string.'
45        );
46      }
47      else {
48        cycle( data[ i ][ 0 ], false );
49      }
33
50
34      //equal( data[ i ][ 0 ].length, data[ i ][ 2 ] );
51      //equal( data[ i ][ 0 ].length, data[ i ][ 2 ] );
35
52
36    }
53    }
37
54
38  } );
55  } );
39
56
40}
57}