buddypress/tests/bootstrap.php
Boone B Gorges 119419eaf3 Refactor and reorganization of BP_Group_Extension
The shiny new BP_Group_Extension class boasts the following features:

- The *_screen* methods (edit_screen(), edit_screen_save(), etc) now share
  identical requirements for markup and logic. You no longer need to provide
  a Submit button for edit_screen() but not for create_screen(); BuddyPress
  provides one for you in each context. (For backward compatibility, we verify
  that your edit_screen() method does not already have a Submit button before
  auto-adding our own.) Nonces are now created and checked automatically for
  all form contexts. And it is no longer necessary to check whether you are on
  the correct group creation or admin step before outputting your markup -
  BP_Group_Extension does it for you.
- Introduces support for fallback methods settings_screen() and
  settings_screen_save(). When you define these methods in your extension, they
  will provide the markup and form-saving logic for your Create, Edit, and
  Admin panels. If you provide specific methods for a given context (say,
  edit_screen() and create_screen_save()), BP_Group_Extension detects it, and
  uses the more specific ones instead. This should make it much easier to write
  DRY code in your BP_Group_Extension classes, while maintaining maximum
  flexibility.
- Configuration should now be set using a config array, which is then passed
  to parent::init() at the end of your class constructor. This technique more
  closely mirrors the way that BuddyPress and WordPress handle configuration
  elsewhere. BP_Group_Extension parses your config array to arbitrary depth, so
  that you only need to pass those values that you wish to change from the
  defaults.
- Complete backward compatibility for legacy BP_Group_Extension plugins.
- Improved organization, documentation, and unit tests.

Props johnjamesjacoby for detailed feedback.

See #4955

git-svn-id: https://buddypress.svn.wordpress.org/trunk@6997 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
2013-05-05 19:08:19 +00:00

19 lines
550 B
PHP

<?php
define( 'BP_PLUGIN_DIR', dirname( dirname( __FILE__ ) ) . '/' );
if ( ! defined( 'BP_TESTS_DIR' ) ) {
define( 'BP_TESTS_DIR', dirname( __FILE__ ) . '/' );
}
require_once getenv( 'WP_TESTS_DIR' ) . '/includes/functions.php';
function _install_and_load_buddypress() {
require BP_TESTS_DIR . '/includes/loader.php';
}
tests_add_filter( 'muplugins_loaded', '_install_and_load_buddypress' );
require getenv( 'WP_TESTS_DIR' ) . '/includes/bootstrap.php';
// Load the BP-specific testing tools
require BP_TESTS_DIR . '/includes/testcase.php';