Skip to:
Content

bbPress.org

Ticket #2542: 2542.2.diff

File 2542.2.diff, 2.5 KB (added by netweb, 7 years ago)
  • new file trunk/phpunit.xml.dist

    diff --git a/trunk/phpunit.xml.dist b/trunk/phpunit.xml.dist
    new file mode 10644
    - +  
     1<phpunit bootstrap="tests/bootstrap.php" backupGlobals="false" colors="true">
     2    <testsuites>
     3        <!-- Default test suite to run all tests -->
     4        <testsuite>
     5            <directory prefix="bbp_test_" suffix=".php">tests</directory>
     6        </testsuite>
     7    </testsuites>
     8</phpunit>
     9 No newline at end of file
  • new file trunk/tests/bbp_test_wordpress_plugin_tests.php

    diff --git a/trunk/tests/bbp_test_wordpress_plugin_tests.php b/trunk/tests/bbp_test_wordpress_plugin_tests.php
    new file mode 10644
    - +  
     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 WP_Test_WordPress_Plugin_Tests  extends WP_UnitTestCase  {
     9
     10        /**
     11         * Run a simple test to ensure that the tests are running
     12         */
     13         function test_tests() {
     14
     15                $this->assertTrue( true );
     16
     17         }
     18
     19        /**
     20         * Ensure that the plugin has been installed and activated.
     21         */
     22        function test_plugin_activated() {
     23
     24                $this->assertTrue( is_plugin_active( 'bbpress/bbpress.php' ) );
     25
     26        }
     27
     28}
  • new file trunk/tests/bootstrap.php

    diff --git a/trunk/tests/bootstrap.php b/trunk/tests/bootstrap.php
    new file mode 10644
    - +  
     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}