Skip to:
Content

bbPress.org

Ticket #2542: 2542.4.diff

File 2542.4.diff, 2.0 KB (added by netweb, 9 years ago)
  • phpunit.xml.dist

     
     1<phpunit
     2        bootstrap="tests/bootstrap.php"
     3        backupGlobals="false"
     4        colors="true"
     5        >
     6        <testsuites>
     7        <testsuite>
     8            <directory prefix="bbp_" suffix=".php">tests/testcases/</directory>
     9        </testsuite>
     10    </testsuites>
     11</phpunit>
  • tests/bootstrap.php

     
     1<?php
     2/**
     3 * Bootstrap the plugin unit testing environment.
     4 *
     5 * Edit 'active_plugins' setting below to point to your main plugin file.
     6 *
     7 * @package wordpress-plugin-tests
     8 */
     9
     10// Activates this plugin in WordPress so it can be tested.
     11$GLOBALS['wp_tests_options'] = array(
     12        'active_plugins' => array( 'bbpress/bbpress.php' ),
     13);
     14
     15// If the develop repo location is defined (as WP_DEVELOP_DIR), use that
     16// location. Otherwise, we'll just assume that this plugin is installed in a
     17// WordPress develop SVN checkout.
     18
     19if( false !== getenv( 'WP_DEVELOP_DIR' ) ) {
     20        require getenv( 'WP_DEVELOP_DIR' ) . '/tests/phpunit/includes/bootstrap.php';
     21} else {
     22        require '../../../../tests/phpunit/includes/bootstrap.php';
     23}
  • tests/testcases/bbp_bbpress_tests.php

     
     1<?php
     2
     3/**
     4 * Tests to test that that testing framework is testing tests. Meta, huh?
     5 *
     6 * @package wordpress-plugins-tests
     7 */
     8class BBP_bbPress_Tests  extends WP_UnitTestCase  {
     9
     10        /**
     11         * Ensure that the plugin has been installed and activated.
     12         */
     13        function test_plugin_activated() {
     14                $this->assertTrue( is_plugin_active( 'bbpress/bbpress.php' ) );
     15        }
     16}