Make WordPress Core

Changeset 407 in tests for wp-testlib/base.php


Ignore:
Timestamp:
08/04/2011 08:38:26 PM (15 years ago)
Author:
ryan
Message:

Pinking shears

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wp-testlib/base.php

    r373 r407  
    3636                _enable_wp_die();
    3737        }
    38        
     38
    3939        /**
    4040         * Treat any error, which wasn't handled by PHPUnit as a failure
     
    264264        function _generate_post_content_test(&$posts, $separate_funcs = true) {
    265265                global $wpdb;
    266                
     266
    267267                $out = '';
    268268                if (!$separate_funcs)
     
    313313                                }
    314314                        }
    315                        
     315
    316316                        $meta = $wpdb->get_results("SELECT DISTINCT meta_key FROM {$wpdb->postmeta} WHERE post_id = $post->ID");
    317317                        #$out .= "\t\t".'$this->assertEquals('.count($postmeta).', count($meta));'."\n";
     
    320320                                $out .= "\t\t".'$this->assertEquals('.var_export(get_post_meta($post->ID, $m->meta_key, false), true).', get_post_meta($post->ID, \''.addslashes($m->meta_key).'\', false));'."\n";
    321321                        }
    322                        
    323                                                
     322
     323
    324324                        $comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d ORDER BY comment_date DESC", $post->ID));
    325325
     
    357357                system('mysqldump -u '.DB_USER.' --password='.DB_PASSWORD.' -cqnt '.DB_NAME.' '.$table_list);
    358358        }
    359        
     359
    360360        function _load_sql_dump($file) {
    361361                $lines = file($file);
    362                
     362
    363363                global $wpdb;
    364364                foreach ($lines as $line) {
     
    394394
    395395        /**
    396          * Checks if track ticket #$ticket_id is resolved 
     396         * Checks if track ticket #$ticket_id is resolved
    397397         *
    398398         * @return bool|null true if the ticket is resolved, false if not resolved, null on error
     
    452452                }
    453453        }
    454        
    455        
     454
     455
    456456        // convenience function: return the # of posts associated with a tag
    457457        function _tag_count($name) {
     
    460460                        return $t->count;
    461461        }
    462        
     462
    463463        // convenience function: return the # of posts associated with a category
    464464        function _category_count($name) {
     
    467467                        return $t->count;
    468468        }
    469        
     469
    470470}
    471471
     
    519519/**
    520520 * Simple function to list out all the test cases for command line interfaces
    521  * 
     521 *
    522522 * @param $test_classes The test casses array as returned by wptest_get_all_test_cases()
    523523 * @return none
     
    527527        natcasesort( $test_classes );
    528528        echo array_reduce($test_classes, '_wptest_listall_testcases_helper');
    529         echo "\nUse -t TestCaseName to run individual test cases\n";   
     529        echo "\nUse -t TestCaseName to run individual test cases\n";
    530530}
    531531
Note: See TracChangeset for help on using the changeset viewer.