Changeset 50616
- Timestamp:
- 03/30/2021 02:22:48 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/privacy/wpPrivacyGeneratePersonalDataExportFile.php
r50613 r50616 388 388 } 389 389 390 /** 391 * Sets up the export contents. 392 * 393 * Tasks: 394 * - Delete or update the '_export_data_grouped' post meta. 395 * - Run `wp_privacy_generate_personal_data_export_file()`. 396 * - Unzip the export package in a temporary directory to give the test access to the export files. 397 * 398 * @param mixed $export_data_grouped Optional. '_export_data_grouped' post meta value. 399 * When null, delete the meta; else update to the given value. 400 * @return string Export report directory path. 401 */ 390 402 private function setup_export_contents_test( $export_data_grouped = null ) { 403 // Delete or update the given meta. 391 404 if ( null === $export_data_grouped ) { 392 405 delete_post_meta( self::$export_request_id, '_export_data_grouped' ); … … 400 413 $this->assertTrue( file_exists( $this->export_file_name ) ); 401 414 415 // Create a temporary export directory for the test's export files. 402 416 $report_dir = trailingslashit( self::$exports_dir . 'test_contents' ); 403 417 mkdir( $report_dir ); 404 418 419 // Unzip the current test's export file to give the test access to .html and .json files. 405 420 $zip = new ZipArchive(); 406 421 $opened_zip = $zip->open( $this->export_file_name ); 407 422 $this->assertTrue( $opened_zip ); 408 409 423 $zip->extractTo( $report_dir ); 410 424 $zip->close(); … … 414 428 415 429 /** 416 * Replace expected content's timestamp placeholder with the actual content's timestamp.430 * Replaces expected content's timestamp placeholder with the actual content's timestamp. 417 431 * 418 432 * Used when the expected content has a placeholder, i.e. used to avoid second time differences
Note: See TracChangeset
for help on using the changeset viewer.