Download the PHP package sebkay/touchstone without Composer

On this page you can find all versions of the php package sebkay/touchstone. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package touchstone

Touchstone

PHP

A modern wrapper around the official WordPress testsuite. It can be used to run both Unit and Integration tests.


Installation

Run the following command to install Touchstone in your project:


Usage

1.) Setup

Running the setup process downloads and installs both WordPress and the official WordPress test files in your temp directory.

Regular Connection

via a Socket

2.) Creating Tests

All your tests will need to be in the following structure from the root of your project:

All your Unit tests will need to extend the WPTS\Tests\UnitTest class and all your integrationt tests will need to extend the WPTS\Tests\IntegrationTest class.

Here's an example Unit test:

Here's an example Integration test:

3.) Running Tests

You can run either all of your tests or a single testsuite with the following commands:

4.) Configuration

You can configure certain things by creating a config.touchstone.php file in the root of your project.

Directories For Tests

Here's how to set the directories for where your tests are located:

WordPress Plugins

Here's how to load plugins which are loaded before each test.

This means for a plugin like ACF (Advanced Custom Fields) you can use functions like get_field() in your code and it won't break your tests.

Important: You will need to provide the plugin files. I recommend putting them all in bin/plugins/ in your theme/plugin and the adding that path to your .gitignore.

WordPress Theme

Here's how to load a theme which is active for each test.


Composer Scripts

You can create Composer scripts so you don't need to memorise the above commands.

To do so add the following to your composer.json file:

Then you can run the following from the command line:


Troubleshooting

Tests Won't Run

If you ever have problems running your tests, run the setup command. It's more than likely you've restarted your machine since the last time you ran the tests which deletes the WordPress test files. Re-running the setup process will usually fix the problem.

Why Does This Exist?

The official way of running the WordPress testsuite is horribly complicated and incredibly prone to user error.

Touchstone fixes both of those issues by making the process of creating and running tests easy.


All versions of touchstone with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
phpunit/phpunit Version ^10.2
sebkay/wp-unit-test-stubs Version ^1.0
symfony/console Version ^5.3
guzzlehttp/guzzle Version ^7.3
league/flysystem Version ^2.3
wp-cli/wp-config-transformer Version ^1.2
symfony/process Version ^5.3
php-stubs/wordpress-stubs Version ^5.8
vlucas/phpdotenv Version ^5.5
yoast/phpunit-polyfills Version ^2.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package sebkay/touchstone contains the following files

Loading the files please wait ....