388690382c
* `wp-admin` and `wp-includes` are scanned for classes to autoload * Several 3rd-party and Ryan McCue-shaped libraries are excluded when the classmap is generated, see `composer.json`: `autoload.exclude-from-classmap` * `wp-vendor/autoload_52.php` is included at the top of `wp-settings.php` - no changes need to be made to unit tests to include the autoloader * An avalanche of `require()` and `require_once()` calls that loaded class files have been removed from the codebase. The following files have been added to `svn:ignore` - they are not 5.2-compatible and fail during pre-commit: * src/wp-vendor/autoload.php * src/wp-vendor/composer/autoload_real.php * src/wp-vendor/composer/autoload_static.php * src/wp-vendor/composer/ClassLoader.php We favor these files instead: * src/wp-vendor/autoload_52.php * src/wp-vendor/composer/autoload_real_52.php * src/wp-vendor/composer/ClassLoader52.php When new PHP classes are added to the codebase, simply run `composer install` or `composer update` from the project root to update the autoloader. The future is now. See #36335. git-svn-id: https://develop.svn.wordpress.org/trunk@38399 602fd350-edb4-49c9-b593-d223f7449a82 |
||
---|---|---|
.. | ||
data | ||
includes | ||
tests | ||
build.xml | ||
multisite.xml | ||
README.txt | ||
wp-mail-real-test.php |
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-tests-config-sample.php to wp-tests-config.php, edit it and include your database name/user/password. 3. $ svn up 4. Run the tests from the "trunk" directory: To execute a particular test: $ phpunit tests/phpunit/tests/test_case.php To execute all tests: $ phpunit Notes: Test cases live in the 'tests' subdirectory. All files in that directory will be included by default. Extend the WP_UnitTestCase class to ensure your test is run. 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. Changes to the test database will be rolled back as tests are finished, to ensure a clean start next time the tests are run. phpunit is intended to run at the command line, not via a web server.