Privacy: Remove two test methods that fail on certain configurations.
The `test_detects_cannot_create_index()` and `tests_detects_cannot_write_html()` test methods are prone to failure under certain configurations, as discovered by the hosts reporting back the test suite results. This removes those two methods until a better approach to testing those scenarios can be created. Partial revert of [44786]. See #44233. git-svn-id: https://develop.svn.wordpress.org/trunk@44792 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
19abdee85f
commit
4a09766cb0
|
@ -213,25 +213,6 @@ class Tests_Privacy_WpPrivacyGeneratePersonalDataExportFile extends WP_UnitTestC
|
|||
wp_privacy_generate_personal_data_export_file( self::$export_request_id );
|
||||
}
|
||||
|
||||
/**
|
||||
* When the index.html file cannot be created an error should be displayed.
|
||||
*
|
||||
* @ticket 44233
|
||||
*/
|
||||
public function test_detects_cannot_create_index() {
|
||||
// Make the export directory read only so the index.html file can't be created.
|
||||
mkdir( self::$exports_dir );
|
||||
chmod( self::$exports_dir, 0444 );
|
||||
|
||||
if ( '444' !== substr( decoct( fileperms( self::$exports_dir ) ), -3 ) ) {
|
||||
$this->markTestSkipped( 'Data export directory permissions were not changed correctly.' );
|
||||
}
|
||||
|
||||
$this->setExpectedException( 'WPDieException' );
|
||||
$this->expectOutputString( '{"success":false,"data":"Unable to protect export folder from browsing."}' );
|
||||
wp_privacy_generate_personal_data_export_file( self::$export_request_id );
|
||||
}
|
||||
|
||||
/**
|
||||
* Test that an index.html file can be added to the export directory.
|
||||
*
|
||||
|
@ -244,28 +225,6 @@ class Tests_Privacy_WpPrivacyGeneratePersonalDataExportFile extends WP_UnitTestC
|
|||
$this->assertTrue( file_exists( self::$exports_dir . 'index.html' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* When the export directory is not writable the report should fail to write.
|
||||
*
|
||||
* @ticket 44233
|
||||
*/
|
||||
public function test_detects_cannot_write_html() {
|
||||
// Make the folder read only so HTML writing will fail.
|
||||
mkdir( self::$exports_dir );
|
||||
touch( self::$exports_dir . 'index.html' );
|
||||
chmod( self::$exports_dir, 0555 );
|
||||
|
||||
if ( '555' !== substr( decoct( fileperms( self::$exports_dir ) ), -3 ) ) {
|
||||
$this->markTestSkipped( 'Data export directory permissions were not changed correctly.' );
|
||||
}
|
||||
|
||||
$this->setExpectedException( 'WPDieException' );
|
||||
$this->expectOutputString( '{"success":false,"data":"Unable to open export file (HTML report) for writing."}' );
|
||||
wp_privacy_generate_personal_data_export_file( self::$export_request_id );
|
||||
|
||||
$this->assertEmpty( $this->export_file_name );
|
||||
}
|
||||
|
||||
/**
|
||||
* Test that an export file is successfully created.
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue