Changeset 51599 for trunk/tests/phpunit/tests/functions.php
- Timestamp:
- 08/11/2021 09:06:31 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/functions.php
r51565 r51599 1036 1036 $json = wp_json_encode( $data, 0, 1 ); 1037 1037 $this->assertFalse( $json ); 1038 } 1039 1040 /** 1041 * @ticket 53238 1042 */ 1043 function test_wp_json_file_decode() { 1044 $result = wp_json_file_decode( 1045 DIR_TESTDATA . '/blocks/notice/block.json' 1046 ); 1047 1048 $this->assertIsObject( $result ); 1049 $this->assertSame( 'tests/notice', $result->name ); 1050 } 1051 1052 /** 1053 * @ticket 53238 1054 */ 1055 function test_wp_json_file_decode_associative_array() { 1056 $result = wp_json_file_decode( 1057 DIR_TESTDATA . '/blocks/notice/block.json', 1058 array( 'associative' => true ) 1059 ); 1060 1061 $this->assertIsArray( $result ); 1062 $this->assertSame( 'tests/notice', $result['name'] ); 1038 1063 } 1039 1064
Note: See TracChangeset
for help on using the changeset viewer.