-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge upstream changes to test files from wordpress-develop (#181)
* Merge missing change from https://core.trac.wordpress.org/changeset/47122. * Merge changes from https://core.trac.wordpress.org/changeset/48840/. * Merge changes from https://core.trac.wordpress.org/changeset/49033. * Merge changes from https://core.trac.wordpress.org/changeset/53864. * Merge changes from https://core.trac.wordpress.org/changeset/54402. * Merge changes from https://core.trac.wordpress.org/changeset/56738. * Add a weekly schedule. --------- Co-authored-by: desrosj <[email protected]> Co-authored-by: swissspidy <[email protected]>
- Loading branch information
1 parent
c693419
commit 90f7db9
Showing
4 changed files
with
49 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,6 @@ public function set_up() { | |
global $wpdb; | ||
// Crude but effective: make sure there's no residual data in the main tables. | ||
foreach ( array( 'posts', 'postmeta', 'comments', 'terms', 'term_taxonomy', 'term_relationships', 'users', 'usermeta' ) as $table ) { | ||
// phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared | ||
$wpdb->query( "DELETE FROM {$wpdb->$table}" ); | ||
} | ||
} | ||
|
@@ -33,6 +32,9 @@ public function tear_down() { | |
parent::tear_down(); | ||
} | ||
|
||
/** | ||
* @covers WP_Import::import | ||
*/ | ||
public function test_small_import() { | ||
global $wpdb; | ||
|
||
|
@@ -59,8 +61,8 @@ public function test_small_import() { | |
$this->assertSame( '[email protected]', $author->user_email ); | ||
|
||
// Check that terms were imported correctly. | ||
$this->assertSame( '30', wp_count_terms( 'category' ) ); | ||
$this->assertSame( '3', wp_count_terms( 'post_tag' ) ); | ||
$this->assertSame( '30', wp_count_terms( array( 'taxonomy' => 'category' ) ) ); | ||
$this->assertSame( '3', wp_count_terms( array( 'taxonomy' => 'post_tag' ) ) ); | ||
$foo = get_term_by( 'slug', 'foo', 'category' ); | ||
$this->assertSame( 0, $foo->parent ); | ||
$bar = get_term_by( 'slug', 'bar', 'category' ); | ||
|
@@ -201,6 +203,9 @@ public function test_small_import() { | |
$this->assertCount( 1, $cats ); | ||
} | ||
|
||
/** | ||
* @covers WP_Import::import | ||
*/ | ||
public function test_double_import() { | ||
$authors = array( | ||
'admin' => false, | ||
|
@@ -224,8 +229,8 @@ public function test_double_import() { | |
$this->assertSame( 'author', $author->user_login ); | ||
$this->assertSame( '[email protected]', $author->user_email ); | ||
|
||
$this->assertSame( '30', wp_count_terms( 'category' ) ); | ||
$this->assertSame( '3', wp_count_terms( 'post_tag' ) ); | ||
$this->assertSame( '30', wp_count_terms( array( 'taxonomy' => 'category' ) ) ); | ||
$this->assertSame( '3', wp_count_terms( array( 'taxonomy' => 'post_tag' ) ) ); | ||
$foo = get_term_by( 'slug', 'foo', 'category' ); | ||
$this->assertSame( 0, $foo->parent ); | ||
$bar = get_term_by( 'slug', 'bar', 'category' ); | ||
|
@@ -244,6 +249,8 @@ public function test_double_import() { | |
|
||
/** | ||
* @ticket 21007 | ||
* | ||
* @covers WP_Import::import | ||
*/ | ||
public function test_slashes_should_not_be_stripped() { | ||
global $wpdb; | ||
|
@@ -291,6 +298,4 @@ public function test_fetch_remote_file_php81_deprecation() { | |
'The WP Error object did not contain the expected error' | ||
); | ||
} | ||
|
||
// function test_menu_import | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters