Changeset 904 in tests for trunk/tests/compat.php
- Timestamp:
- 07/18/2012 07:01:41 PM (12 years ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/compat.php
r903 r904 4 4 * @group compat 5 5 */ 6 class Test MbSubStrextends WP_UnitTestCase {7 function test_mb_s trcut() {6 class Tests_Compat extends WP_UnitTestCase { 7 function test_mb_substr() { 8 8 $this->assertEquals('баб', _mb_substr('баба', 0, 3)); 9 9 $this->assertEquals('баб', _mb_substr('баба', 0, -1)); … … 11 11 $this->assertEquals('I am your б', _mb_substr('I am your баба', 0, 11)); 12 12 } 13 }14 13 15 /** 16 * @group compat 17 */ 18 class TestHashHMAC extends WP_UnitTestCase { 19 function test_simple() { 14 function test_hash_hmac_simple() { 20 15 $this->assertEquals('140d1cb79fa12e2a31f32d35ad0a2723', _hash_hmac('md5', 'simple', 'key')); 21 16 $this->assertEquals('993003b95758e0ac2eba451a4c5877eb1bb7b92a', _hash_hmac('sha1', 'simple', 'key')); 22 17 } 23 18 24 function test_ key_padding() {19 function test_hash_hmac_padding() { 25 20 $this->assertEquals('3c1399103807cf12ec38228614416a8c', _hash_hmac('md5', 'simple', '65 character key 65 character key 65 character key 65 character k')); 26 21 $this->assertEquals('4428826d20003e309d6c2a6515891370daf184ea', _hash_hmac('sha1', 'simple', '65 character key 65 character key 65 character key 65 character k')); 27 22 } 28 23 29 function test_ raw_output() {24 function test_hash_hmac_output() { 30 25 $this->assertEquals(array( 1 => '140d1cb79fa12e2a31f32d35ad0a2723'), unpack('H32', _hash_hmac('md5', 'simple', 'key', true))); 31 26 $this->assertEquals(array( 1 => '993003b95758e0ac2eba451a4c5877eb1bb7b92a'), unpack('H40', _hash_hmac('sha1', 'simple', 'key', true)));
Note: See TracChangeset
for help on using the changeset viewer.