mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
Build/Test Tools: Add @covers tags to the import tests.
Props pbearne, jrf, hellofromTonya, patopaiar, ironprogrammer, antonvlasenko, SergeyBiryukov, costdev. See #39265. git-svn-id: https://develop.svn.wordpress.org/trunk@53864 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -33,6 +33,9 @@ class Tests_Import_Import extends WP_Import_UnitTestCase {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers WP_Import::import
|
||||
*/
|
||||
public function test_small_import() {
|
||||
global $wpdb;
|
||||
|
||||
@@ -201,6 +204,9 @@ class Tests_Import_Import extends WP_Import_UnitTestCase {
|
||||
$this->assertCount( 1, $cats );
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers WP_Import::import
|
||||
*/
|
||||
public function test_double_import() {
|
||||
$authors = array(
|
||||
'admin' => false,
|
||||
@@ -242,6 +248,9 @@ class Tests_Import_Import extends WP_Import_UnitTestCase {
|
||||
$this->assertSame( 1, $comment_count->total_comments );
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers ::get_importers
|
||||
*/
|
||||
public function test_ordering_of_importers() {
|
||||
global $wp_importers;
|
||||
$_wp_importers = $wp_importers; // Preserve global state.
|
||||
@@ -267,6 +276,8 @@ class Tests_Import_Import extends WP_Import_UnitTestCase {
|
||||
|
||||
/**
|
||||
* @ticket 21007
|
||||
*
|
||||
* @covers WP_Import::import
|
||||
*/
|
||||
public function test_slashes_should_not_be_stripped() {
|
||||
global $wpdb;
|
||||
|
||||
@@ -24,6 +24,10 @@ class Tests_Import_Parser extends WP_Import_UnitTestCase {
|
||||
require_once DIR_TESTDATA . '/plugins/wordpress-importer/wordpress-importer.php';
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers WXR_Parser_SimpleXML::parse
|
||||
* @covers WXR_Parser_XML::parse
|
||||
*/
|
||||
public function test_malformed_wxr() {
|
||||
$file = DIR_TESTDATA . '/export/malformed.xml';
|
||||
|
||||
@@ -36,6 +40,11 @@ class Tests_Import_Parser extends WP_Import_UnitTestCase {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers WXR_Parser_SimpleXML::parse
|
||||
* @covers WXR_Parser_XML::parse
|
||||
* @covers WXR_Parser_Regex::parse
|
||||
*/
|
||||
public function test_invalid_wxr() {
|
||||
$f1 = DIR_TESTDATA . '/export/missing-version-tag.xml';
|
||||
$f2 = DIR_TESTDATA . '/export/invalid-version-tag.xml';
|
||||
@@ -50,6 +59,11 @@ class Tests_Import_Parser extends WP_Import_UnitTestCase {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers WXR_Parser_SimpleXML::parse
|
||||
* @covers WXR_Parser_XML::parse
|
||||
* @covers WXR_Parser_Regex::parse
|
||||
*/
|
||||
public function test_wxr_version_1_1() {
|
||||
$file = DIR_TESTDATA . '/export/valid-wxr-1.1.xml';
|
||||
|
||||
@@ -143,6 +157,11 @@ class Tests_Import_Parser extends WP_Import_UnitTestCase {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers WXR_Parser_SimpleXML::parse
|
||||
* @covers WXR_Parser_XML::parse
|
||||
* @covers WXR_Parser_Regex::parse
|
||||
*/
|
||||
public function test_wxr_version_1_0() {
|
||||
$file = DIR_TESTDATA . '/export/valid-wxr-1.0.xml';
|
||||
|
||||
@@ -236,6 +255,10 @@ class Tests_Import_Parser extends WP_Import_UnitTestCase {
|
||||
* sections that contain escaped closing tags ("]]>" -> "]]]]><![CDATA[>").
|
||||
*
|
||||
* @link https://core.trac.wordpress.org/ticket/15203
|
||||
*
|
||||
* @covers WXR_Parser_SimpleXML::parse
|
||||
* @covers WXR_Parser_XML::parse
|
||||
* @covers WXR_Parser_Regex::parse
|
||||
*/
|
||||
public function test_escaped_cdata_closing_sequence() {
|
||||
$file = DIR_TESTDATA . '/export/crazy-cdata-escaped.xml';
|
||||
@@ -269,6 +292,8 @@ class Tests_Import_Parser extends WP_Import_UnitTestCase {
|
||||
/**
|
||||
* Ensure that the regex parser can still parse invalid CDATA blocks (i.e. those
|
||||
* with "]]>" unescaped within a CDATA section).
|
||||
*
|
||||
* @covers WXR_Parser_Regex::parse
|
||||
*/
|
||||
public function test_unescaped_cdata_closing_sequence() {
|
||||
$file = DIR_TESTDATA . '/export/crazy-cdata.xml';
|
||||
|
||||
@@ -4,6 +4,8 @@ require_once __DIR__ . '/base.php';
|
||||
|
||||
/**
|
||||
* @group import
|
||||
*
|
||||
* @covers WP_Import::import
|
||||
*/
|
||||
class Tests_Import_Postmeta extends WP_Import_UnitTestCase {
|
||||
public function set_up() {
|
||||
|
||||
Reference in New Issue
Block a user