mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +00:00
Privacy: Add a table of contents to Personal Data Export report for easier navigation.
Props xkon, garrett-eclipse, birgire, karmatosed. Fixes #46894. git-svn-id: https://develop.svn.wordpress.org/trunk@47278 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -39,10 +39,10 @@ class Tests_Privacy_WpPrivacyGeneratePersonalDataExportGroupHtml extends WP_Unit
|
||||
),
|
||||
);
|
||||
|
||||
$actual = wp_privacy_generate_personal_data_export_group_html( $data );
|
||||
$actual = wp_privacy_generate_personal_data_export_group_html( $data, 'test-data-group', 2 );
|
||||
$expected_table_markup = '<table><tbody><tr><th>Field 1 Name</th><td>Field 1 Value</td></tr><tr><th>Field 2 Name</th><td>Field 2 Value</td></tr></tbody></table>';
|
||||
|
||||
$this->assertContains( '<h2>Test Data Group</h2>', $actual );
|
||||
$this->assertContains( '<h2 id="test-data-group-test-data-group">Test Data Group</h2>', $actual );
|
||||
$this->assertContains( $expected_table_markup, $actual );
|
||||
}
|
||||
|
||||
@@ -79,9 +79,9 @@ class Tests_Privacy_WpPrivacyGeneratePersonalDataExportGroupHtml extends WP_Unit
|
||||
),
|
||||
);
|
||||
|
||||
$actual = wp_privacy_generate_personal_data_export_group_html( $data );
|
||||
$actual = wp_privacy_generate_personal_data_export_group_html( $data, 'test-data-group', 2 );
|
||||
|
||||
$this->assertContains( '<h2>Test Data Group', $actual );
|
||||
$this->assertContains( '<h2 id="test-data-group-test-data-group">Test Data Group', $actual );
|
||||
$this->assertContains( '<td>Field 1 Value', $actual );
|
||||
$this->assertContains( '<td>Another Field 1 Value', $actual );
|
||||
$this->assertContains( '<td>Field 2 Value', $actual );
|
||||
@@ -117,7 +117,7 @@ class Tests_Privacy_WpPrivacyGeneratePersonalDataExportGroupHtml extends WP_Unit
|
||||
),
|
||||
);
|
||||
|
||||
$actual = wp_privacy_generate_personal_data_export_group_html( $data );
|
||||
$actual = wp_privacy_generate_personal_data_export_group_html( $data, 'test-data-group', 2 );
|
||||
|
||||
$this->assertContains( '<a href="http://wordpress.org">http://wordpress.org</a>', $actual );
|
||||
$this->assertContains( '<a href="https://wordpress.org">https://wordpress.org</a>', $actual );
|
||||
@@ -131,13 +131,13 @@ class Tests_Privacy_WpPrivacyGeneratePersonalDataExportGroupHtml extends WP_Unit
|
||||
*/
|
||||
public function test_group_labels_escaped() {
|
||||
$data = array(
|
||||
'group_label' => '<div>Escape HTML in group lavels</div>',
|
||||
'group_label' => '<div>Escape HTML in group labels</div>',
|
||||
'items' => array(),
|
||||
);
|
||||
|
||||
$actual = wp_privacy_generate_personal_data_export_group_html( $data );
|
||||
$actual = wp_privacy_generate_personal_data_export_group_html( $data, 'escape-html-in-group-labels', 2 );
|
||||
|
||||
$this->assertContains( '<h2><div>Escape HTML in group lavels</div></h2>', $actual );
|
||||
$this->assertContains( '<h2 id="escape-html-in-group-labels-escape-html-in-group-labels"><div>Escape HTML in group labels</div></h2>', $actual );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -162,8 +162,7 @@ class Tests_Privacy_WpPrivacyGeneratePersonalDataExportGroupHtml extends WP_Unit
|
||||
),
|
||||
);
|
||||
|
||||
$actual = wp_privacy_generate_personal_data_export_group_html( $data );
|
||||
|
||||
$actual = wp_privacy_generate_personal_data_export_group_html( $data, 'test-data-group', 2 );
|
||||
$this->assertContains( $data['items'][0]['links']['value'], $actual );
|
||||
$this->assertContains( $data['items'][0]['formatting']['value'], $actual );
|
||||
}
|
||||
@@ -190,7 +189,7 @@ class Tests_Privacy_WpPrivacyGeneratePersonalDataExportGroupHtml extends WP_Unit
|
||||
),
|
||||
);
|
||||
|
||||
$actual = wp_privacy_generate_personal_data_export_group_html( $data );
|
||||
$actual = wp_privacy_generate_personal_data_export_group_html( $data, 'test-data-group', 2 );
|
||||
|
||||
$this->assertNotContains( $data['items'][0]['scripts']['value'], $actual );
|
||||
$this->assertContains( '<td>Testing that script tags are stripped.</td>', $actual );
|
||||
@@ -223,9 +222,9 @@ class Tests_Privacy_WpPrivacyGeneratePersonalDataExportGroupHtml extends WP_Unit
|
||||
),
|
||||
);
|
||||
|
||||
$actual = wp_privacy_generate_personal_data_export_group_html( $data );
|
||||
$actual = wp_privacy_generate_personal_data_export_group_html( $data, 'test-data-group', 2 );
|
||||
|
||||
$this->assertContains( '<h2>Test Data Group', $actual );
|
||||
$this->assertContains( '<h2 id="test-data-group-test-data-group">Test Data Group', $actual );
|
||||
$this->assertContains( '<span class="count">(2)</span></h2>', $actual );
|
||||
$this->assertSame( 2, substr_count( $actual, '<table>' ) );
|
||||
}
|
||||
@@ -248,9 +247,9 @@ class Tests_Privacy_WpPrivacyGeneratePersonalDataExportGroupHtml extends WP_Unit
|
||||
),
|
||||
);
|
||||
|
||||
$actual = wp_privacy_generate_personal_data_export_group_html( $data );
|
||||
$actual = wp_privacy_generate_personal_data_export_group_html( $data, 'test-data-group', 2 );
|
||||
|
||||
$this->assertContains( '<h2>Test Data Group</h2>', $actual );
|
||||
$this->assertContains( '<h2 id="test-data-group-test-data-group">Test Data Group</h2>', $actual );
|
||||
$this->assertNotContains( '<span class="count">', $actual );
|
||||
$this->assertSame( 1, substr_count( $actual, '<table>' ) );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user