[oik] plugins.com

WordPress plugins and themes

  • Home
  • About
    • lazy shortcodes
    • smart shortcodes
    • oik base plugin
      • oik – donate
      • oik PayPal buttons
      • oik installation
      • oik Button Shortcode button
      • oik changelog
      • oik FAQ
      • oik plugins on SVN
      • oik plugins on GitHub
  • Plugins
    • oik base plugin
    • FREE oik plugins
    • WordPress plugins
    • Premium oik plugins
    • Bespoke oik plugins
  • Shortcodes
    • Shortcode examples
  • Blocks
    • Block examples
  • APIs
    • ALL action and filter hooks
  • Blog

tests/bootstrap.php


Lines:
1 to 63 of 63
<?php // (C) Copyright Bobbing Wide 2016


/**
 * PHPUnit bootstrap for oik-batch 
 
 * For running WordPress plugin and/or theme unit tests under PHPUnit.
 
 * Normally, the bootstrap file is invoked by phpunit, 
 * loading phpunit.xml in preference to phpunit.xml.dist,
 * and finding the bootstrap parameter in the main tag
 * `<phpunit bootstrap="tests/bootstrap.php" backupGlobals="false" colors="true">`
 *
 * With oik-batch the bootstrap is different. 
 * Instead of loading tests/bootstrap.php we load ../oik-batch/oik-wp.php 
 * using `phpunit --bootstrap=../oik-batch/oik-wp.php`
 * or `<phpunit bootstrap="../oik-batch/oik-wp.php" >`
 * 
 * oik-wp will instantiate WordPress, with all the active plugins and themes,
 * and without resetting the database.
 *
 *
 * The bootstrap file for wordpress-develop-tests does a lot of things including resetting the database.
 * But most importantly it loads the PHP classes that we need to develop our tests ( WP_UnitTestCase )
 * 
 * We would like to try running tests on any database without destroying the original contents.
 * In this code we're trying to answer the questions...
 * 
 * - Is this possible?
 * - How easy is this to do?
 * - What problems does this introduce with regards to using existing test data?
 * - i.e. Is this a silly thing to do?
 * - Can we run phpunit under WordPress or must phpunit be in charge?
 * 
 
 * @TODO Rather than resetting the database to a defined checkpoint ( original idea August 2016 )
 * we need to ensure that WP_UnitTestCase does not do anything silly with the database.
 * We do this by implementing our own instance of WP_UnitTestCase.
 * 
 * 
 */
bootstrap_loaded(); 


 
 
/* function bootstrap_loaded() – Function to invoke when loaded */

/* function _manually_load_plugin() – Self load the plugin’s main .php file */

/* function locate_wordpress_develop_tests() – Locate the wordpress-develop-tests code */

/* function locate_oik_batch() – Locate oik-batch */

/* function continue_loading_bootstrap() – Load the WordPress develop tests bootstrap.php file */

/* function load_bootstrap_functions() – Load the WordPress develop tests functions.php file or our oik-batch replacements for in situ */

/* function locate_wordpress_develop_tests_plugin() – Locate the wordpress-develop-tests plugin */

/* function check_wordpress_develop_tests_version() – Check WordPress develop tests are compatible with WordPress installation */

 
 View on GitHub

Called by

    Invoked by

      Calls

      1 to 1 of 1
      • bootstrap_loaded() – Function to invoke when loaded

      Call hooks

      File name: tests/bootstrap.php
      Plugin ref: oik-batch
      Version: 1.0.0
      Deprecated?: No
      API Letters: B,P,T

      Published: March 14, 2017 | Last updated: March 14, 2017

      Information

      File name: tests/bootstrap.php
      Plugin ref: oik-batch
      Version: 1.0.0
      Deprecated?: No
      API Letters: B,P,T

      Recent plugin updates

      oik-weight-zone-shipping v0.2.13 oik-weight-zone-shipping v0.2.13 has been tested with WooCommerce 10.1.2 and WordPress 6.8.2 ...
      SB Children Block v1.3.0 Upgrade to SB Children Block v1.3.0 for support for PHP 8.3 and PHP 8.4  ...
      oik v4.15.3 Update to oik v4.15.3 for a couple of security fixes. Tested with WordPress 6.8.2 ...
      oik-privacy-policy v1.4.9 Update to oik-privacy-policy v1.4.9 for a security fix. Tested with WordPress 6.8.2 and PHP 8.3 and PHP 8.4 ...
      oik-nivo-slider v1.17.0 oik-nivo-slider v1.17.0 introduces the Nivo slider block - oik-nivo-slider/nivo. ...

      Plugins

      • All Plugins
      • oik base plugin
      • FREE oik plugins
      • WordPress plugins
      • Premium oik plugins

      Themes

      • FREE themes
      • Bespoke themes
      • Premium themes

      Blocks

      • All Blocks
      • Block examples
      • About Blocks

      Shortcodes

      • All Shortcodes
      • Shortcode examples
      • About Shortcodes

      Reference

      • About APIs
      • All APIs
      • All Classes
      • All Files
      • All Hooks

      Support

      • Contact
      • Cookies policy
      • Get API key
      • Privacy
      • Request support
      • Sitemap
      • Stay informed
      • Terms and Conditions
      oik-plugins
      Email: herb@bobbingwide.com

      Weight shipping plugins

      Find out which cart weight shipping plugin you need for your WooCommerce site.
      Which cart weight based plugin do I need?

      Site:  www.oik-plugins.com
      © Copyright oik-plugins 2011-2025. All rights reserved.


      Website designed and developed by Herb Miller of Bobbing Wide
      Proudly powered by WordPress and oik-plugins

      WordPress version: 6.8.3

      Gutenberg version: 21.7.0

      PHP version: 8.2.29