[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.6 oik-weight-zone-shipping v0.2.6 has been tested with WooCommerce 7.4.0. ...
      sb-chart-block v1.2.3 SB Chart Block v1.2.3 contains a fix for an Uncaught Error: Call to undefined function bw_trace2()  ...
      SB Chart Block v1.2.1 Update to SB Chart Block v1.2.0 for custom colors, font size options and multiple y-axis charts.  ...
      oik-css v2.1.0 Update to oik-css v2.1.0 for the ability to style CSS and GeSHi output in documentation. ...
      oik-types v2.3.0 Update to oik-types v2.3.0 for improved control over sort order on archives ...

      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-2023. All rights reserved.


      Website designed and developed by Herb Miller of Bobbing Wide
      Proudly powered by WordPress and oik-plugins
      WordPress 6.1.1. PHP: 7.4.33. Memory limit: 768M