Tests: array_change_key_case version 26

Function:
Description: Retuns an array with all string keys lowercased [or uppercased].
Version:
Status: current
Date: 2011-12-30 00:10
Summary: Fixing array expectation.
Programmer: jj5
Tests
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
function array_change_key_case_tests() {

  // API reference: http://docs.jquery.com/QUnit
  module( "array_change_key_case" );

  test( "array_change_key_case", function() {

    deepEqual( array_change_key_case( 42 ), false );
    deepEqual( array_change_key_case( [ 3, 5 ] ), [ 3, 5 ] );
    deepEqual( array_change_key_case( { FuBaR: 42 } ), { fubar: 42 } );
    deepEqual( array_change_key_case( { FuBaR: 42 }, 'CASE_LOWER' ), { fubar: 42 } );
    deepEqual( array_change_key_case( { FuBaR: 42 }, 'CASE_UPPER' ), { FUBAR: 42 } );
    deepEqual( array_change_key_case( { FuBaR: 42 }, 2 ), { FUBAR: 42 } );

  } );

}
[top]

Comments

There are no comments yet, be the first!

Please Login or Register to post comments.