mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-10-03 14:17:06 +00:00
Build/Test Tools: Reduce the use of unnecessary randomness in tests.
This increases the overall reliability of the tests. Props johnillo Fixes #37371 git-svn-id: https://develop.svn.wordpress.org/trunk@52389 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -68,8 +68,8 @@ class Tests_Post extends WP_UnitTestCase {
|
||||
$post = array(
|
||||
'post_author' => self::$editor_id,
|
||||
'post_status' => 'publish',
|
||||
'post_content' => rand_str(),
|
||||
'post_title' => rand_str(),
|
||||
'post_content' => "{$post_type}_content",
|
||||
'post_title' => "{$post_type}_title",
|
||||
'tax_input' => array(
|
||||
'post_tag' => 'tag1,tag2',
|
||||
'ctax' => 'cterm1,cterm2',
|
||||
@@ -126,8 +126,8 @@ class Tests_Post extends WP_UnitTestCase {
|
||||
$post = array(
|
||||
'post_author' => self::$editor_id,
|
||||
'post_status' => 'publish',
|
||||
'post_content' => rand_str(),
|
||||
'post_title' => rand_str(),
|
||||
'post_content' => 'content',
|
||||
'post_title' => 'title',
|
||||
'post_date' => date_format( date_create( "@{$future_date}" ), 'Y-m-d H:i:s' ),
|
||||
);
|
||||
|
||||
@@ -162,8 +162,8 @@ class Tests_Post extends WP_UnitTestCase {
|
||||
$post = array(
|
||||
'post_author' => self::$editor_id,
|
||||
'post_status' => 'publish',
|
||||
'post_content' => rand_str(),
|
||||
'post_title' => rand_str(),
|
||||
'post_content' => 'content',
|
||||
'post_title' => 'title',
|
||||
'post_date' => date_format( date_create( "@{$future_date_1}" ), 'Y-m-d H:i:s' ),
|
||||
);
|
||||
|
||||
@@ -207,8 +207,8 @@ class Tests_Post extends WP_UnitTestCase {
|
||||
$post = array(
|
||||
'post_author' => self::$editor_id,
|
||||
'post_status' => 'publish',
|
||||
'post_content' => rand_str(),
|
||||
'post_title' => rand_str(),
|
||||
'post_content' => 'content',
|
||||
'post_title' => 'title',
|
||||
'post_date' => date_format( date_create( "@{$future_date_1}" ), 'Y-m-d H:i:s' ),
|
||||
);
|
||||
|
||||
@@ -249,8 +249,8 @@ class Tests_Post extends WP_UnitTestCase {
|
||||
$post = array(
|
||||
'post_author' => self::$editor_id,
|
||||
'post_status' => 'draft',
|
||||
'post_content' => rand_str(),
|
||||
'post_title' => rand_str(),
|
||||
'post_content' => 'content',
|
||||
'post_title' => 'title',
|
||||
'post_date' => date_format( date_create( "@{$future_date}" ), 'Y-m-d H:i:s' ),
|
||||
);
|
||||
|
||||
@@ -284,8 +284,8 @@ class Tests_Post extends WP_UnitTestCase {
|
||||
$post = array(
|
||||
'post_author' => self::$editor_id,
|
||||
'post_status' => 'publish',
|
||||
'post_content' => rand_str(),
|
||||
'post_title' => rand_str(),
|
||||
'post_content' => 'content',
|
||||
'post_title' => 'title',
|
||||
'post_date' => date_format( date_create( "@{$future_date_1}" ), 'Y-m-d H:i:s' ),
|
||||
);
|
||||
|
||||
@@ -328,8 +328,8 @@ class Tests_Post extends WP_UnitTestCase {
|
||||
$post = array(
|
||||
'post_author' => self::$editor_id,
|
||||
'post_status' => 'publish',
|
||||
'post_content' => rand_str(),
|
||||
'post_title' => rand_str(),
|
||||
'post_content' => "{$status}_content",
|
||||
'post_title' => "{$status}_title",
|
||||
'post_date' => date_format( date_create( "@{$future_date_1}" ), 'Y-m-d H:i:s' ),
|
||||
);
|
||||
|
||||
@@ -370,8 +370,8 @@ class Tests_Post extends WP_UnitTestCase {
|
||||
$post = array(
|
||||
'post_author' => self::$editor_id,
|
||||
'post_status' => 'private',
|
||||
'post_content' => rand_str(),
|
||||
'post_title' => rand_str(),
|
||||
'post_content' => 'content',
|
||||
'post_title' => 'title',
|
||||
'post_date' => date_format( date_create( "@{$future_date}" ), 'Y-m-d H:i:s' ),
|
||||
);
|
||||
|
||||
@@ -404,8 +404,8 @@ class Tests_Post extends WP_UnitTestCase {
|
||||
$post = array(
|
||||
'post_author' => self::$editor_id,
|
||||
'post_status' => 'publish',
|
||||
'post_content' => rand_str(),
|
||||
'post_title' => rand_str(),
|
||||
'post_content' => 'content',
|
||||
'post_title' => 'title',
|
||||
'post_date' => '2012-02-30 00:00:00',
|
||||
);
|
||||
|
||||
@@ -427,8 +427,8 @@ class Tests_Post extends WP_UnitTestCase {
|
||||
$post = array(
|
||||
'post_author' => self::$editor_id,
|
||||
'post_status' => 'publish',
|
||||
'post_content' => rand_str(),
|
||||
'post_title' => rand_str(),
|
||||
'post_content' => 'content',
|
||||
'post_title' => 'title',
|
||||
'post_date' => date_format( date_create( "@{$future_date_1}" ), 'Y-m-d H:i:s' ),
|
||||
);
|
||||
|
||||
@@ -533,8 +533,8 @@ class Tests_Post extends WP_UnitTestCase {
|
||||
$post = array(
|
||||
'post_author' => self::$editor_id,
|
||||
'post_status' => 'publish',
|
||||
'post_content' => rand_str(),
|
||||
'post_title' => rand_str(),
|
||||
'post_content' => 'content',
|
||||
'post_title' => 'title',
|
||||
'post_date' => date_format( date_create( "@{$future_date}" ), 'Y-m-d H:i:s' ),
|
||||
);
|
||||
|
||||
@@ -564,7 +564,7 @@ class Tests_Post extends WP_UnitTestCase {
|
||||
$post = array(
|
||||
'post_author' => self::$editor_id,
|
||||
'post_status' => 'publish',
|
||||
'post_content' => rand_str(),
|
||||
'post_content' => 'content',
|
||||
'post_title' => '',
|
||||
'post_date' => '2007-10-31 06:15:00',
|
||||
);
|
||||
@@ -782,11 +782,11 @@ class Tests_Post extends WP_UnitTestCase {
|
||||
|
||||
register_taxonomy( 'test_tax', 'post' );
|
||||
|
||||
$title = rand_str();
|
||||
$title = 'title';
|
||||
$post_data = array(
|
||||
'post_author' => self::$editor_id,
|
||||
'post_status' => 'publish',
|
||||
'post_content' => rand_str(),
|
||||
'post_content' => 'content',
|
||||
'post_title' => $title,
|
||||
'tax_input' => array(
|
||||
'test_tax' => array( 'term', 'term2', 'term3' ),
|
||||
@@ -906,7 +906,7 @@ class Tests_Post extends WP_UnitTestCase {
|
||||
register_taxonomy( $tax, $post_type );
|
||||
|
||||
$post = self::factory()->post->create( array( 'post_type' => $post_type ) );
|
||||
wp_set_object_terms( $post, rand_str(), $tax );
|
||||
wp_set_object_terms( $post, 'foo', $tax );
|
||||
|
||||
$wp_tag_cloud = wp_tag_cloud(
|
||||
array(
|
||||
@@ -973,8 +973,8 @@ class Tests_Post extends WP_UnitTestCase {
|
||||
array(
|
||||
'post_author' => self::$editor_id,
|
||||
'post_status' => 'publish',
|
||||
'post_content' => rand_str(),
|
||||
'post_title' => rand_str(),
|
||||
'post_content' => 'content',
|
||||
'post_title' => 'title',
|
||||
)
|
||||
);
|
||||
$post = get_post( $post_id );
|
||||
@@ -991,8 +991,8 @@ class Tests_Post extends WP_UnitTestCase {
|
||||
array(
|
||||
'post_author' => self::$editor_id,
|
||||
'post_status' => 'publish',
|
||||
'post_content' => rand_str(),
|
||||
'post_title' => rand_str(),
|
||||
'post_content' => 'content',
|
||||
'post_title' => 'title',
|
||||
'post_type' => 'page',
|
||||
)
|
||||
);
|
||||
@@ -1203,8 +1203,8 @@ class Tests_Post extends WP_UnitTestCase {
|
||||
$post = array(
|
||||
'post_author' => self::$editor_id,
|
||||
'post_status' => 'publish',
|
||||
'post_content' => rand_str(),
|
||||
'post_title' => rand_str(),
|
||||
'post_content' => 'content',
|
||||
'post_title' => 'title',
|
||||
'post_date_gmt' => '2014-01-01 12:00:00',
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user