Changeset 760 in tests
- Timestamp:
- 06/30/2012 05:30:59 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 10 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/README.txt
r751 r760 7 7 3. $ svn up 8 8 9 4. $ php wp-test.php9 4. $ phpunit path/to/test_case.php 10 10 11 11 Notes: 12 12 13 Test cases live in the 'wp-testcase' subdirectory. All files in that directory will be included by default. Extend the WP TestCase class to ensure your test is run.13 Test cases live in the 'wp-testcase' subdirectory. All files in that directory will be included by default. Extend the WP_UnitTestCase class to ensure your test is run. 14 14 15 wp-test.phpwill 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.15 phpunit 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. 16 16 17 17 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. 18 18 19 wp-test.phpis intended to run at the command line, not via a web server.19 phpunit is intended to run at the command line, not via a web server. -
trunk/wp-config-sample.php
r751 r760 1 1 <?php 2 3 /* Path to the WordPress codebase you'd like to test. Add a backslash in the end. */ 4 define( 'ABSPATH', dirname( __FILE__ ) . '/wordpress/' ); 5 2 6 // ** MySQL settings ** // 3 7 … … 9 13 // DO NOT use a production database or one that is shared with something else. 10 14 11 define( 'DB_NAME', 'putyourdbnamehere'); // The name of the database12 define( 'DB_USER', 'usernamehere'); // Your MySQL username13 define( 'DB_PASSWORD', 'yourpasswordhere'); // ...and password14 define( 'DB_HOST', 'localhost'); // 99% chance you won't need to change this value15 define( 'DB_CHARSET', 'utf8');16 define( 'DB_COLLATE', '');15 define( 'DB_NAME', 'putyourdbnamehere' ); // The name of the database 16 define( 'DB_USER', 'usernamehere' ); // Your MySQL username 17 define( 'DB_PASSWORD', 'yourpasswordhere' ); // ...and password 18 define( 'DB_HOST', 'localhost' ); // 99% chance you won't need to change this value 19 define( 'DB_CHARSET', 'utf8' ); 20 define( 'DB_COLLATE', '' ); 17 21 18 22 // You can have multiple installations in one database if you give each a unique prefix … … 23 27 // For example, install de.mo to wp-content/languages and set WPLANG to 'de' 24 28 // to enable German language support. 25 define ( 'WPLANG', '');29 define ( 'WPLANG', '' ); 26 30 27 // uncomment and change this if you'd like to load plugins from a particular directory prior to testing 28 #define('DIR_TESTPLUGINS', './wp-plugins'); 29 ?> 31 define( 'WP_TESTS_DOMAIN', 'example.org' ); 32 define( 'WP_TESTS_EMAIL', 'admin@example.org' ); 33 define( 'WP_TESTS_TITLE', 'Test Blog' ); 34 define( 'WP_TESTS_NETWORK_TITLE', 'Test Network' ); 35 define( 'WP_TESTS_SUBDOMAIN_INSTALL', true ); 36 $base = '/'; 37 38 /* Cron tries to make an HTTP request to the blog, which always fails, because tests are run in CLI mode only */ 39 define( 'DISABLE_WP_CRON', true ); 40 41 define( 'WP_ALLOW_MULTISITE', false ); 42 if ( WP_ALLOW_MULTISITE ) { 43 define( 'WP_TESTS_BLOGS', 'first,second,third,fourth' ); 44 } 45 if ( WP_ALLOW_MULTISITE && ! defined('WP_INSTALLING') ) { 46 define( 'SUBDOMAIN_INSTALL', WP_TESTS_SUBDOMAIN_INSTALL ); 47 define( 'MULTISITE', true ); 48 define( 'DOMAIN_CURRENT_SITE', WP_TESTS_DOMAIN ); 49 define( 'PATH_CURRENT_SITE', '/' ); 50 define( 'SITE_ID_CURRENT_SITE', 1 ); 51 define( 'BLOG_ID_CURRENT_SITE', 1 ); 52 //define( 'SUNRISE', TRUE ); 53 } 54 55 $table_prefix = 'wp_'; 56 57 define( 'WP_PHP_BINARY', 'php' );
Note: See TracChangeset
for help on using the changeset viewer.