<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[751] trunk: Move everything into trunk.</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg > ul, #logmsg > ol { margin-left: 0; margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://unit-tests.trac.wordpress.org/changeset/751">751</a></dd>
<dt>Author</dt> <dd>nacin</dd>
<dt>Date</dt> <dd>2012-06-29 23:58:49 +0000 (Fri, 29 Jun 2012)</dd>
</dl>

<h3>Log Message</h3>
<pre>Move everything into trunk. Hope this works.</pre>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkREADMEtxt">trunk/README.txt</a></li>
<li><a href="#trunkwpconfigsamplephp">trunk/wp-config-sample.php</a></li>
<li><a href="#trunkwpmailrealtestphp">trunk/wp-mail-real-test.php</a></li>
<li><a href="#trunkwptestphp">trunk/wp-test.php</a></li>
<li>trunk/wp-testcase/</li>
<li>trunk/wp-testdata/</li>
<li>trunk/wp-testlib/</li>
<li><a href="#trunkwptestsh">trunk/wptest.sh</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#READMEtxt">README.txt</a></li>
<li><a href="#wpconfigsamplephp">wp-config-sample.php</a></li>
<li><a href="#wpmailrealtestphp">wp-mail-real-test.php</a></li>
<li><a href="#wptestphp">wp-test.php</a></li>
<li>wp-testcase/</li>
<li>wp-testdata/</li>
<li>wp-testlib/</li>
<li><a href="#wptestsh">wptest.sh</a></li>
</ul>

<h3>Property Changed</h3>
<ul>
<li><a href="#">/</a></li>
<li><a href="#trunk">trunk/</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id=""></a>
<div class="propset"><h4>Property changes: </h4>
<pre class="diff"><span>
</span></pre></div>
<a id="svnexternals"></a>
<div class="delfile"><h4>Deleted: svn:externals</h4></div>
<a id="READMEtxt"></a>
<div class="delfile"><h4>Deleted: README.txt (750 => 751)</h4>
<pre class="diff"><span>
<span class="info">--- README.txt        2012-06-29 23:51:37 UTC (rev 750)
+++ README.txt        2012-06-29 23:58:49 UTC (rev 751)
</span><span class="lines">@@ -1,19 +0,0 @@
</span><del>-The short version:
-
-1. Create a clean MySQL database and user.  DO NOT USE AN EXISTING DATABASE or you will lose data, guaranteed.
-
-2. Copy wp-config-sample.php to wp-config.php, edit it and include your database name/user/password.
-
-3. $ svn up
-
-4. $ php wp-test.php
-
-Notes:
-
-Test cases live in the 'wp-testcase' subdirectory.  All files in that directory will be included by default.  Extend the WPTestCase class to ensure your test is run.
-
-wp-test.php will initialize and install a (more or less) complete running copy of WordPress each time it is run.  This makes it possible to run functional interface and module tests against a fully working database and codebase, as opposed to pure unit tests with mock objects and stubs.  Pure unit tests may be used also, of course.
-
-The test database will be wiped clean with DROP TABLE statements once tests are finished, to ensure a clean start next time the tests are run.
-
-wp-test.php is intended to run at the command line, not via a web server.
</del></span></pre></div>
<a id="trunk"></a>
<div class="propset"><h4>Property changes: trunk</h4>
<pre class="diff"><span>
</span></pre></div>
<a id="svnexternals"></a>
<div class="addfile"><h4>Added: svn:externals</h4></div>
<a id="trunkREADMEtxtfromrev750READMEtxt"></a>
<div class="copfile"><h4>Copied: trunk/README.txt (from rev 750, README.txt) (0 => 751)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/README.txt                                (rev 0)
+++ trunk/README.txt        2012-06-29 23:58:49 UTC (rev 751)
</span><span class="lines">@@ -0,0 +1,19 @@
</span><ins>+The short version:
+
+1. Create a clean MySQL database and user.  DO NOT USE AN EXISTING DATABASE or you will lose data, guaranteed.
+
+2. Copy wp-config-sample.php to wp-config.php, edit it and include your database name/user/password.
+
+3. $ svn up
+
+4. $ php wp-test.php
+
+Notes:
+
+Test cases live in the 'wp-testcase' subdirectory.  All files in that directory will be included by default.  Extend the WPTestCase class to ensure your test is run.
+
+wp-test.php will initialize and install a (more or less) complete running copy of WordPress each time it is run.  This makes it possible to run functional interface and module tests against a fully working database and codebase, as opposed to pure unit tests with mock objects and stubs.  Pure unit tests may be used also, of course.
+
+The test database will be wiped clean with DROP TABLE statements once tests are finished, to ensure a clean start next time the tests are run.
+
+wp-test.php is intended to run at the command line, not via a web server.
</ins></span></pre></div>
<a id="trunkwpconfigsamplephpfromrev750wpconfigsamplephp"></a>
<div class="copfile"><h4>Copied: trunk/wp-config-sample.php (from rev 750, wp-config-sample.php) (0 => 751)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-config-sample.php                                (rev 0)
+++ trunk/wp-config-sample.php        2012-06-29 23:58:49 UTC (rev 751)
</span><span class="lines">@@ -0,0 +1,29 @@
</span><ins>+&lt;?php
+// ** MySQL settings ** //
+
+// these will be used by the copy of wordpress being tested.
+// wordpress/wp-config.php will be ignored.
+
+// WARNING WARNING WARNING!
+// wp-test will DROP ALL TABLES in the database named below.
+// DO NOT use a production database or one that is shared with something else.
+
+define('DB_NAME', 'putyourdbnamehere');    // The name of the database
+define('DB_USER', 'usernamehere');     // Your MySQL username
+define('DB_PASSWORD', 'yourpasswordhere'); // ...and password
+define('DB_HOST', 'localhost');    // 99% chance you won't need to change this value
+define('DB_CHARSET', 'utf8');
+define('DB_COLLATE', '');
+
+// You can have multiple installations in one database if you give each a unique prefix
+$table_prefix  = 'wp_';   // Only numbers, letters, and underscores please!
+
+// Change this to localize WordPress.  A corresponding MO file for the
+// chosen language must be installed to wp-content/languages.
+// For example, install de.mo to wp-content/languages and set WPLANG to 'de'
+// to enable German language support.
+define ('WPLANG', '');
+
+// uncomment and change this if you'd like to load plugins from a particular directory prior to testing
+#define('DIR_TESTPLUGINS', './wp-plugins');
+?&gt;
</ins></span></pre></div>
<a id="trunkwpmailrealtestphpfromrev750wpmailrealtestphp"></a>
<div class="copfile"><h4>Copied: trunk/wp-mail-real-test.php (from rev 750, wp-mail-real-test.php) (0 => 751)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-mail-real-test.php                                (rev 0)
+++ trunk/wp-mail-real-test.php        2012-06-29 23:58:49 UTC (rev 751)
</span><span class="lines">@@ -0,0 +1,85 @@
</span><ins>+&lt;?php
+/**
+ * wp-mail-real-test.php
+ *
+ * Test script for wp_mail with real addresses.
+ */
+
+// parse options
+$options = 'v:r:d';
+if (is_callable('getopt')) {
+        $opts = getopt($options);
+} else {
+        include( dirname(__FILE__) . '/wp-testlib/getopt.php' );
+        $opts = getoptParser::getopt($options);
+}
+
+define('DIR_TESTROOT', realpath(dirname(__FILE__)));
+
+define('TEST_WP', true);
+define('WP_DEBUG', array_key_exists('d', $opts) );
+
+if (!empty($opts['r']))
+        define('DIR_WP', realpath($opts['r']));
+else
+        if (!empty($opts['v']))
+                define('DIR_WP', DIR_TESTROOT.'/wordpress-'.$opts['v']);
+        else
+                define('DIR_WP', DIR_TESTROOT.'/wordpress');
+
+// make sure all useful errors are displayed during setup
+error_reporting(E_ALL &amp; ~E_DEPRECATED);
+ini_set('display_errors', true);
+
+require_once(DIR_TESTROOT.'/wp-testlib/utils.php');
+
+// configure wp
+require_once(DIR_TESTROOT.'/wp-config.php');
+define('ABSPATH', realpath(DIR_WP).'/');
+
+// install wp
+define('WP_BLOG_TITLE', rand_str());
+define('WP_USER_NAME', rand_str());
+define('WP_USER_EMAIL', rand_str().'@example.com');
+
+// initialize wp
+define('WP_INSTALLING', 1);
+$_SERVER['PATH_INFO'] = $_SERVER['SCRIPT_NAME']; // prevent a warning from some sloppy code in wp-settings.php
+require_once(ABSPATH.'wp-settings.php');
+
+drop_tables();
+
+require_once(ABSPATH.'wp-admin/includes/upgrade.php');
+wp_install(WP_BLOG_TITLE, WP_USER_NAME, WP_USER_EMAIL, true);
+
+// make sure we're installed
+assert(true == is_blog_installed());
+
+define('PHPUnit_MAIN_METHOD', false);
+$original_wpdb = $GLOBALS['wpdb'];
+
+// hide warnings during testing, since that's the normal WP behaviour
+if ( !WP_DEBUG ) {
+        error_reporting(E_ALL ^ E_NOTICE);
+}
+
+$to = &quot;To &lt;wp.mail.testing@gmail.com&gt;&quot;;
+$from = &quot;From &lt;wp.mail.testing+from@gmail.com&gt;&quot;;
+$cc = &quot;CC &lt;wp.mail.testing+cc@gmail.com&gt;&quot;;
+$bcc = &quot;BCC &lt;wp.mail.testing+bcc@gmail.com&gt;&quot;;
+$subject = &quot;RFC2822 Testing&quot;;
+$message = &quot;My RFC822 Test Message&quot;;
+$headers[] = &quot;From: {$from}&quot;;
+$headers[] = &quot;CC: {$cc}&quot;;
+
+$_SERVER['SERVER_NAME'] = 'example.com';
+wp_mail( $to, $subject, $message, $headers );
+
+$headers = array();
+$subject = &quot;RFC2822 Testing 2&quot;;
+$message = &quot;My RFC822 Test Message 2&quot;;
+$to = &quot;To &lt;wp.mail.testing+to@gmail.com&gt;&quot;;
+$headers[] = &quot;BCC: {$bcc}&quot;;
+wp_mail( '', $subject, $message, $headers );
+echo &quot;Test emails sent!\n&quot;
+?&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwptestphpfromrev750wptestphp"></a>
<div class="copfile"><h4>Copied: trunk/wp-test.php (from rev 750, wp-test.php) (0 => 751)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-test.php                                (rev 0)
+++ trunk/wp-test.php        2012-06-29 23:58:49 UTC (rev 751)
</span><span class="lines">@@ -0,0 +1,216 @@
</span><ins>+&lt;?php
+/**
+ * wp-test.php
+ *
+ * WordPress Testrunner
+ *
+ * Examples:
+ *
+ * # php wp-test.php
+ * # php wp-test.php -l
+ * # php wp-test.php -t TestImageMetaFunctions,TestImageSizeFunctions
+ *
+ * Command line options:
+ *   - -d  Set WP_DEBUG to true
+ *   - -f  Force known bugs
+ *   - -h  Help
+ *   - -l  List all tests
+ *   - -m  Test multisite
+ *   - -n  Do not clean up the database at the end of the run
+ *   - -p  PHPUnit --verbose
+ *   - -q  Save queries
+ *   - -r  Uses the given path as the WP_DIR to be tested.  Overrides -v.
+ *   - -s  Skip known bugs
+ *   - -t  Specific test class names to be run (separated by spaces or commas)
+ *   - -v  Sets WP_DIR to &quot;DIR_TESTROOT/wordpress-&lt;value&gt;&quot;.  Overridden by -r.
+ *   - -g  Runs a group of test cases by matching part of the test class name
+ */
+
+// parse options
+$options = 'g:r:t:v:dfhlmnpqs';
+if (is_callable('getopt')) {
+        $opts = getopt($options);
+} else {
+        include( dirname(__FILE__) . '/wp-testlib/getopt.php' );
+        $opts = getoptParser::getopt($options);
+}
+
+if (isset($opts['h'])) {
+        echo &lt;&lt;&lt;EOH
+WordPress Testrunner
+
+Usage: php wp-test.php [arguments]
+
+Examples:
+# php wp-test.php
+# php wp-test.php -l
+# php wp-test.php -t TestImageMetaFunctions,TestImageSizeFunctions
+
+Arguments:
+  -d  Set WP_DEBUG to true
+  -f  Force known bugs
+  -h  Help
+  -l  List all tests
+  -m  Test multisite
+  -n  Do not clean up the database at the end of the run
+  -p  PHPUnit --verbose
+  -q  Save queries
+  -r  Uses the given path as the WP_DIR to be tested.  Overrides -v.
+  -s  Skip known bugs
+  -t  Specific test class names to be run (separated by spaces or commas)
+  -v  Sets WP_DIR to &quot;DIR_TESTROOT/wordpress-&lt;value&gt;&quot;.  Overridden by -r.
+  -g  Runs a group of test cases by matching part of the test class name
+
+EOH;
+        exit(1);
+}
+
+define('DIR_TESTROOT', realpath(dirname(__FILE__)));
+if (!defined('DIR_TESTCASE')) {
+        define('DIR_TESTCASE', './wp-testcase');
+}
+if (!defined('DIR_TESTDATA'))
+        define('DIR_TESTDATA', './wp-testdata');
+define('TEST_WP', true);
+define('TEST_MS', isset( $opts['m'] ) );
+define('TEST_SKIP_KNOWN_BUGS', array_key_exists('s', $opts));
+define('TEST_FORCE_KNOWN_BUGS', array_key_exists('f', $opts));
+define('WP_DEBUG', array_key_exists('d', $opts) );
+define('SAVEQUERIES', array_key_exists('q', $opts) );
+define('WP_PHPUNIT_VERBOSE', array_key_exists('p', $opts));
+
+if (!empty($opts['r']))
+        define('DIR_WP', realpath($opts['r']));
+else
+        if (!empty($opts['v']))
+                define('DIR_WP', DIR_TESTROOT.'/wordpress-'.$opts['v']);
+        else
+                define('DIR_WP', DIR_TESTROOT.'/wordpress');
+
+// make sure all useful errors are displayed during setup
+error_reporting(E_ALL &amp; ~E_DEPRECATED &amp; ~E_STRICT);
+ini_set('display_errors', true);
+
+require_once(DIR_TESTROOT.'/wp-testlib/base.php');
+require_once(DIR_TESTROOT.'/wp-testlib/utils.php');
+
+// configure wp
+
+if ( TEST_MS ) {
+        define( 'MULTISITE', true );
+        define( 'SUBDOMAIN_INSTALL', false );
+        define( 'DOMAIN_CURRENT_SITE', 'localhost' );
+        define( 'PATH_CURRENT_SITE', '/' );
+        define( 'SITE_ID_CURRENT_SITE', 1 );
+        define( 'BLOG_ID_CURRENT_SITE', 1 );
+}
+
+require_once(DIR_TESTROOT.'/wp-config.php');
+define('ABSPATH', realpath(DIR_WP).'/');
+
+if (!defined('DIR_TESTPLUGINS'))
+        define('DIR_TESTPLUGINS', './wp-plugins');
+
+
+// install wp
+define('WP_BLOG_TITLE', rand_str());
+define('WP_USER_NAME', rand_str());
+define('WP_USER_EMAIL', rand_str().'@example.com');
+
+
+// initialize wp
+define('WP_INSTALLING', 1);
+$_SERVER['PATH_INFO'] = $_SERVER['SCRIPT_NAME']; // prevent a warning from some sloppy code in wp-settings.php
+require_once(ABSPATH.'wp-settings.php');
+
+// override stuff
+require_once(DIR_TESTROOT.'/wp-testlib/mock-mailer.php');
+$GLOBALS['phpmailer'] = new MockPHPMailer();
+
+// Allow tests to override wp_die
+add_filter( 'wp_die_handler', '_wp_die_handler_filter' );
+
+drop_tables();
+
+require_once(ABSPATH.'wp-admin/includes/upgrade.php');
+wp_install(WP_BLOG_TITLE, WP_USER_NAME, WP_USER_EMAIL, true);
+
+if ( TEST_MS ) {
+        install_network();
+        $base = $path = '/';
+        $domain = 'localhost';
+        populate_network( 1, $domain, WP_USER_EMAIL, 'Test Site', $base, false );
+        // Pulled from the !is_multiste() blocks in populate_network().  These don't run in
+        // the call to populate_network() above due to setting MULTISITE earlier in wp-test.php.
+        $site_user = get_user_by( 'email', WP_USER_EMAIL );
+        $site_admins = array( $site_user-&gt;user_login );
+        $users = get_users( array( 'fields' =&gt; array( 'ID', 'user_login' ) ) );
+        if ( $users ) {
+                foreach ( $users as $user ) {
+                        if ( is_super_admin( $user-&gt;ID ) &amp;&amp; !in_array( $user-&gt;user_login, $site_admins ) )
+                                $site_admins[] = $user-&gt;user_login;
+                }
+        }
+        update_site_option( 'site_admins', $site_admins );
+
+        $wpdb-&gt;insert( $wpdb-&gt;blogs, array( 'site_id' =&gt; 1, 'domain' =&gt; $domain, 'path' =&gt; $path, 'registered' =&gt; current_time( 'mysql' ) ) );
+        $blog_id = $wpdb-&gt;insert_id;
+        update_user_meta( $site_user-&gt;ID, 'source_domain', $domain );
+        update_user_meta( $site_user-&gt;ID, 'primary_blog', $blog_id );
+        if ( !$upload_path = get_option( 'upload_path' ) ) {
+                $upload_path = substr( WP_CONTENT_DIR, strlen( ABSPATH ) ) . '/uploads';
+                update_option( 'upload_path', $upload_path );
+        }
+        update_option( 'fileupload_url', get_option( 'siteurl' ) . '/' . $upload_path );
+
+        // wp-settings.php would normally init this stuff, but that doesn't work because we've
+        // only just installed
+        $GLOBALS['blog_id'] = 1;
+        $GLOBALS['wpdb']-&gt;blogid = 1;
+        $GLOBALS['current_blog'] = $GLOBALS['wpdb']-&gt;get_results('SELECT * from wp_blogs where blog_id = 1');
+}
+
+// make sure we're installed
+assert(true == is_blog_installed());
+
+// include plugins for testing, if any
+if (is_dir(DIR_TESTPLUGINS)) {
+        $plugins = glob(realpath(DIR_TESTPLUGINS).'/*.php');
+        foreach ($plugins as $plugin)
+                include_once($plugin);
+}
+
+// needed for jacob's tests
+ini_set('include_path', ini_get('include_path') . PATH_SEPARATOR . ABSPATH . '/wp-includes');
+define('PHPUnit_MAIN_METHOD', false);
+$original_wpdb = $GLOBALS['wpdb'];
+
+include_once(DIR_TESTDATA . '/sample_blogs.php');
+// include all files in DIR_TESTCASE, and fetch all the WPTestCase descendents
+$files = wptest_get_all_test_files(DIR_TESTCASE);
+foreach ($files as $file) {
+        require_once($file);
+}
+$classes = wptest_get_all_test_cases();
+
+// some of jacob's tests clobber the wpdb object, so restore it
+$GLOBALS['wpdb'] = $original_wpdb;
+
+if ( isset($opts['l']) ) {
+        wptest_listall_testcases($classes);
+} else {
+        do_action('test_start');
+
+        // hide warnings during testing, since that's the normal WP behaviour
+        if ( !WP_DEBUG ) {
+                error_reporting( E_ALL &amp; ~E_DEPRECATED &amp; ~E_STRICT &amp; ~E_NOTICE );
+        }
+        // run the tests and print the results
+        list ($result, $printer) = wptest_run_tests($classes, isset($opts['t']) ? $opts['t'] : array(), isset($opts['g']) ? $opts['g'] : null );
+        wptest_print_result($printer,$result);
+}
+if ( !isset($opts['n']) ) {
+        // clean up the database
+        drop_tables();
+}
+?&gt;
</ins></span></pre></div>
<a id="trunkwptestshfromrev750wptestsh"></a>
<div class="copfile"><h4>Copied: trunk/wptest.sh (from rev 750, wptest.sh) (0 => 751)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wptest.sh                                (rev 0)
+++ trunk/wptest.sh        2012-06-29 23:58:49 UTC (rev 751)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+#!/bin/bash
+# Run the test runner passing all CLI args on
+php wp-test.php $@
</ins></span></pre></div>
<a id="wpconfigsamplephp"></a>
<div class="delfile"><h4>Deleted: wp-config-sample.php (750 => 751)</h4>
<pre class="diff"><span>
<span class="info">--- wp-config-sample.php        2012-06-29 23:51:37 UTC (rev 750)
+++ wp-config-sample.php        2012-06-29 23:58:49 UTC (rev 751)
</span><span class="lines">@@ -1,29 +0,0 @@
</span><del>-&lt;?php
-// ** MySQL settings ** //
-
-// these will be used by the copy of wordpress being tested.
-// wordpress/wp-config.php will be ignored.
-
-// WARNING WARNING WARNING!
-// wp-test will DROP ALL TABLES in the database named below.
-// DO NOT use a production database or one that is shared with something else.
-
-define('DB_NAME', 'putyourdbnamehere');    // The name of the database
-define('DB_USER', 'usernamehere');     // Your MySQL username
-define('DB_PASSWORD', 'yourpasswordhere'); // ...and password
-define('DB_HOST', 'localhost');    // 99% chance you won't need to change this value
-define('DB_CHARSET', 'utf8');
-define('DB_COLLATE', '');
-
-// You can have multiple installations in one database if you give each a unique prefix
-$table_prefix  = 'wp_';   // Only numbers, letters, and underscores please!
-
-// Change this to localize WordPress.  A corresponding MO file for the
-// chosen language must be installed to wp-content/languages.
-// For example, install de.mo to wp-content/languages and set WPLANG to 'de'
-// to enable German language support.
-define ('WPLANG', '');
-
-// uncomment and change this if you'd like to load plugins from a particular directory prior to testing
-#define('DIR_TESTPLUGINS', './wp-plugins');
-?&gt;
</del></span></pre></div>
<a id="wpmailrealtestphp"></a>
<div class="delfile"><h4>Deleted: wp-mail-real-test.php (750 => 751)</h4>
<pre class="diff"><span>
<span class="info">--- wp-mail-real-test.php        2012-06-29 23:51:37 UTC (rev 750)
+++ wp-mail-real-test.php        2012-06-29 23:58:49 UTC (rev 751)
</span><span class="lines">@@ -1,85 +0,0 @@
</span><del>-&lt;?php
-/**
- * wp-mail-real-test.php
- *
- * Test script for wp_mail with real addresses.
- */
-
-// parse options
-$options = 'v:r:d';
-if (is_callable('getopt')) {
-        $opts = getopt($options);
-} else {
-        include( dirname(__FILE__) . '/wp-testlib/getopt.php' );
-        $opts = getoptParser::getopt($options);
-}
-
-define('DIR_TESTROOT', realpath(dirname(__FILE__)));
-
-define('TEST_WP', true);
-define('WP_DEBUG', array_key_exists('d', $opts) );
-
-if (!empty($opts['r']))
-        define('DIR_WP', realpath($opts['r']));
-else
-        if (!empty($opts['v']))
-                define('DIR_WP', DIR_TESTROOT.'/wordpress-'.$opts['v']);
-        else
-                define('DIR_WP', DIR_TESTROOT.'/wordpress');
-
-// make sure all useful errors are displayed during setup
-error_reporting(E_ALL &amp; ~E_DEPRECATED);
-ini_set('display_errors', true);
-
-require_once(DIR_TESTROOT.'/wp-testlib/utils.php');
-
-// configure wp
-require_once(DIR_TESTROOT.'/wp-config.php');
-define('ABSPATH', realpath(DIR_WP).'/');
-
-// install wp
-define('WP_BLOG_TITLE', rand_str());
-define('WP_USER_NAME', rand_str());
-define('WP_USER_EMAIL', rand_str().'@example.com');
-
-// initialize wp
-define('WP_INSTALLING', 1);
-$_SERVER['PATH_INFO'] = $_SERVER['SCRIPT_NAME']; // prevent a warning from some sloppy code in wp-settings.php
-require_once(ABSPATH.'wp-settings.php');
-
-drop_tables();
-
-require_once(ABSPATH.'wp-admin/includes/upgrade.php');
-wp_install(WP_BLOG_TITLE, WP_USER_NAME, WP_USER_EMAIL, true);
-
-// make sure we're installed
-assert(true == is_blog_installed());
-
-define('PHPUnit_MAIN_METHOD', false);
-$original_wpdb = $GLOBALS['wpdb'];
-
-// hide warnings during testing, since that's the normal WP behaviour
-if ( !WP_DEBUG ) {
-        error_reporting(E_ALL ^ E_NOTICE);
-}
-
-$to = &quot;To &lt;wp.mail.testing@gmail.com&gt;&quot;;
-$from = &quot;From &lt;wp.mail.testing+from@gmail.com&gt;&quot;;
-$cc = &quot;CC &lt;wp.mail.testing+cc@gmail.com&gt;&quot;;
-$bcc = &quot;BCC &lt;wp.mail.testing+bcc@gmail.com&gt;&quot;;
-$subject = &quot;RFC2822 Testing&quot;;
-$message = &quot;My RFC822 Test Message&quot;;
-$headers[] = &quot;From: {$from}&quot;;
-$headers[] = &quot;CC: {$cc}&quot;;
-
-$_SERVER['SERVER_NAME'] = 'example.com';
-wp_mail( $to, $subject, $message, $headers );
-
-$headers = array();
-$subject = &quot;RFC2822 Testing 2&quot;;
-$message = &quot;My RFC822 Test Message 2&quot;;
-$to = &quot;To &lt;wp.mail.testing+to@gmail.com&gt;&quot;;
-$headers[] = &quot;BCC: {$bcc}&quot;;
-wp_mail( '', $subject, $message, $headers );
-echo &quot;Test emails sent!\n&quot;
-?&gt;
</del><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="wptestphp"></a>
<div class="delfile"><h4>Deleted: wp-test.php (750 => 751)</h4>
<pre class="diff"><span>
<span class="info">--- wp-test.php        2012-06-29 23:51:37 UTC (rev 750)
+++ wp-test.php        2012-06-29 23:58:49 UTC (rev 751)
</span><span class="lines">@@ -1,216 +0,0 @@
</span><del>-&lt;?php
-/**
- * wp-test.php
- *
- * WordPress Testrunner
- *
- * Examples:
- *
- * # php wp-test.php
- * # php wp-test.php -l
- * # php wp-test.php -t TestImageMetaFunctions,TestImageSizeFunctions
- *
- * Command line options:
- *   - -d  Set WP_DEBUG to true
- *   - -f  Force known bugs
- *   - -h  Help
- *   - -l  List all tests
- *   - -m  Test multisite
- *   - -n  Do not clean up the database at the end of the run
- *   - -p  PHPUnit --verbose
- *   - -q  Save queries
- *   - -r  Uses the given path as the WP_DIR to be tested.  Overrides -v.
- *   - -s  Skip known bugs
- *   - -t  Specific test class names to be run (separated by spaces or commas)
- *   - -v  Sets WP_DIR to &quot;DIR_TESTROOT/wordpress-&lt;value&gt;&quot;.  Overridden by -r.
- *   - -g  Runs a group of test cases by matching part of the test class name
- */
-
-// parse options
-$options = 'g:r:t:v:dfhlmnpqs';
-if (is_callable('getopt')) {
-        $opts = getopt($options);
-} else {
-        include( dirname(__FILE__) . '/wp-testlib/getopt.php' );
-        $opts = getoptParser::getopt($options);
-}
-
-if (isset($opts['h'])) {
-        echo &lt;&lt;&lt;EOH
-WordPress Testrunner
-
-Usage: php wp-test.php [arguments]
-
-Examples:
-# php wp-test.php
-# php wp-test.php -l
-# php wp-test.php -t TestImageMetaFunctions,TestImageSizeFunctions
-
-Arguments:
-  -d  Set WP_DEBUG to true
-  -f  Force known bugs
-  -h  Help
-  -l  List all tests
-  -m  Test multisite
-  -n  Do not clean up the database at the end of the run
-  -p  PHPUnit --verbose
-  -q  Save queries
-  -r  Uses the given path as the WP_DIR to be tested.  Overrides -v.
-  -s  Skip known bugs
-  -t  Specific test class names to be run (separated by spaces or commas)
-  -v  Sets WP_DIR to &quot;DIR_TESTROOT/wordpress-&lt;value&gt;&quot;.  Overridden by -r.
-  -g  Runs a group of test cases by matching part of the test class name
-
-EOH;
-        exit(1);
-}
-
-define('DIR_TESTROOT', realpath(dirname(__FILE__)));
-if (!defined('DIR_TESTCASE')) {
-        define('DIR_TESTCASE', './wp-testcase');
-}
-if (!defined('DIR_TESTDATA'))
-        define('DIR_TESTDATA', './wp-testdata');
-define('TEST_WP', true);
-define('TEST_MS', isset( $opts['m'] ) );
-define('TEST_SKIP_KNOWN_BUGS', array_key_exists('s', $opts));
-define('TEST_FORCE_KNOWN_BUGS', array_key_exists('f', $opts));
-define('WP_DEBUG', array_key_exists('d', $opts) );
-define('SAVEQUERIES', array_key_exists('q', $opts) );
-define('WP_PHPUNIT_VERBOSE', array_key_exists('p', $opts));
-
-if (!empty($opts['r']))
-        define('DIR_WP', realpath($opts['r']));
-else
-        if (!empty($opts['v']))
-                define('DIR_WP', DIR_TESTROOT.'/wordpress-'.$opts['v']);
-        else
-                define('DIR_WP', DIR_TESTROOT.'/wordpress');
-
-// make sure all useful errors are displayed during setup
-error_reporting(E_ALL &amp; ~E_DEPRECATED &amp; ~E_STRICT);
-ini_set('display_errors', true);
-
-require_once(DIR_TESTROOT.'/wp-testlib/base.php');
-require_once(DIR_TESTROOT.'/wp-testlib/utils.php');
-
-// configure wp
-
-if ( TEST_MS ) {
-        define( 'MULTISITE', true );
-        define( 'SUBDOMAIN_INSTALL', false );
-        define( 'DOMAIN_CURRENT_SITE', 'localhost' );
-        define( 'PATH_CURRENT_SITE', '/' );
-        define( 'SITE_ID_CURRENT_SITE', 1 );
-        define( 'BLOG_ID_CURRENT_SITE', 1 );
-}
-
-require_once(DIR_TESTROOT.'/wp-config.php');
-define('ABSPATH', realpath(DIR_WP).'/');
-
-if (!defined('DIR_TESTPLUGINS'))
-        define('DIR_TESTPLUGINS', './wp-plugins');
-
-
-// install wp
-define('WP_BLOG_TITLE', rand_str());
-define('WP_USER_NAME', rand_str());
-define('WP_USER_EMAIL', rand_str().'@example.com');
-
-
-// initialize wp
-define('WP_INSTALLING', 1);
-$_SERVER['PATH_INFO'] = $_SERVER['SCRIPT_NAME']; // prevent a warning from some sloppy code in wp-settings.php
-require_once(ABSPATH.'wp-settings.php');
-
-// override stuff
-require_once(DIR_TESTROOT.'/wp-testlib/mock-mailer.php');
-$GLOBALS['phpmailer'] = new MockPHPMailer();
-
-// Allow tests to override wp_die
-add_filter( 'wp_die_handler', '_wp_die_handler_filter' );
-
-drop_tables();
-
-require_once(ABSPATH.'wp-admin/includes/upgrade.php');
-wp_install(WP_BLOG_TITLE, WP_USER_NAME, WP_USER_EMAIL, true);
-
-if ( TEST_MS ) {
-        install_network();
-        $base = $path = '/';
-        $domain = 'localhost';
-        populate_network( 1, $domain, WP_USER_EMAIL, 'Test Site', $base, false );
-        // Pulled from the !is_multiste() blocks in populate_network().  These don't run in
-        // the call to populate_network() above due to setting MULTISITE earlier in wp-test.php.
-        $site_user = get_user_by( 'email', WP_USER_EMAIL );
-        $site_admins = array( $site_user-&gt;user_login );
-        $users = get_users( array( 'fields' =&gt; array( 'ID', 'user_login' ) ) );
-        if ( $users ) {
-                foreach ( $users as $user ) {
-                        if ( is_super_admin( $user-&gt;ID ) &amp;&amp; !in_array( $user-&gt;user_login, $site_admins ) )
-                                $site_admins[] = $user-&gt;user_login;
-                }
-        }
-        update_site_option( 'site_admins', $site_admins );
-
-        $wpdb-&gt;insert( $wpdb-&gt;blogs, array( 'site_id' =&gt; 1, 'domain' =&gt; $domain, 'path' =&gt; $path, 'registered' =&gt; current_time( 'mysql' ) ) );
-        $blog_id = $wpdb-&gt;insert_id;
-        update_user_meta( $site_user-&gt;ID, 'source_domain', $domain );
-        update_user_meta( $site_user-&gt;ID, 'primary_blog', $blog_id );
-        if ( !$upload_path = get_option( 'upload_path' ) ) {
-                $upload_path = substr( WP_CONTENT_DIR, strlen( ABSPATH ) ) . '/uploads';
-                update_option( 'upload_path', $upload_path );
-        }
-        update_option( 'fileupload_url', get_option( 'siteurl' ) . '/' . $upload_path );
-
-        // wp-settings.php would normally init this stuff, but that doesn't work because we've
-        // only just installed
-        $GLOBALS['blog_id'] = 1;
-        $GLOBALS['wpdb']-&gt;blogid = 1;
-        $GLOBALS['current_blog'] = $GLOBALS['wpdb']-&gt;get_results('SELECT * from wp_blogs where blog_id = 1');
-}
-
-// make sure we're installed
-assert(true == is_blog_installed());
-
-// include plugins for testing, if any
-if (is_dir(DIR_TESTPLUGINS)) {
-        $plugins = glob(realpath(DIR_TESTPLUGINS).'/*.php');
-        foreach ($plugins as $plugin)
-                include_once($plugin);
-}
-
-// needed for jacob's tests
-ini_set('include_path', ini_get('include_path') . PATH_SEPARATOR . ABSPATH . '/wp-includes');
-define('PHPUnit_MAIN_METHOD', false);
-$original_wpdb = $GLOBALS['wpdb'];
-
-include_once(DIR_TESTDATA . '/sample_blogs.php');
-// include all files in DIR_TESTCASE, and fetch all the WPTestCase descendents
-$files = wptest_get_all_test_files(DIR_TESTCASE);
-foreach ($files as $file) {
-        require_once($file);
-}
-$classes = wptest_get_all_test_cases();
-
-// some of jacob's tests clobber the wpdb object, so restore it
-$GLOBALS['wpdb'] = $original_wpdb;
-
-if ( isset($opts['l']) ) {
-        wptest_listall_testcases($classes);
-} else {
-        do_action('test_start');
-
-        // hide warnings during testing, since that's the normal WP behaviour
-        if ( !WP_DEBUG ) {
-                error_reporting( E_ALL &amp; ~E_DEPRECATED &amp; ~E_STRICT &amp; ~E_NOTICE );
-        }
-        // run the tests and print the results
-        list ($result, $printer) = wptest_run_tests($classes, isset($opts['t']) ? $opts['t'] : array(), isset($opts['g']) ? $opts['g'] : null );
-        wptest_print_result($printer,$result);
-}
-if ( !isset($opts['n']) ) {
-        // clean up the database
-        drop_tables();
-}
-?&gt;
</del></span></pre></div>
<a id="wptestsh"></a>
<div class="delfile"><h4>Deleted: wptest.sh (750 => 751)</h4>
<pre class="diff"><span>
<span class="info">--- wptest.sh        2012-06-29 23:51:37 UTC (rev 750)
+++ wptest.sh        2012-06-29 23:58:49 UTC (rev 751)
</span><span class="lines">@@ -1,3 +0,0 @@
</span><del>-#!/bin/bash
-# Run the test runner passing all CLI args on
-php wp-test.php $@
</del></span></pre>
</div>
</div>

</body>
</html>