2017 © Pedro Peláez
 

library wp-nonce

Playing and testing Wordpress nonces with phpunit tests

image

vagrantin/wp-nonce

Playing and testing Wordpress nonces with phpunit tests

  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

PHP MySQL PHPUnit, (*1)

Travis, (*2)

wp-nonce testing

Using WordPressDev Composer Fork, (*3)

The purpose of this project is to test and validate Wordpress WP-nonces using phpunit test.
For this purpose I took the party to use WordPress Dev environement to perform those tests., (*4)

SETUP

To install this package we are using composer., (*5)

Composer

Once you have installed composer following the procedure available here, you can, (*6)

  1. Grab the composer.json from my git repository wp-nonce-package, with your prefered methode.
  2. Or create a composer.json file in a new project directory and write down manualy those informations:
{
  "minimum-stability": "dev",
  "require-dev": {
      "vagrantin/wp-nonce": "^1.0"
  },
  "require": {
  }
}

  • Now you can run composer update this will trigger the install of the package.
  • Then you have to go to the vendor/vagrantin/wp-nonce/ directory to perform all the following steps.

From here we consider that you are in the vendor/vagrantin/wp-nonce/ directory for all the next steps, (*7)

PHPUnit Test

  • The PHPUnit test files are in the Test/ folder, named nonceTest.php

WP-NONCE

  • The wp-nonce demo file is in the src/wp-content/plugins/ folder named wp_nonce_demo.php

Wordpress

  • Because those tests are based on Wordpress Dev environement, we have to setup a mysql database, it has to be a new database has those tests are destructive.
  1. Setup and create a test Database in mysql.
  2. Use wp-tests-config-sample.php to create a wp-tests-config.php file, so Wordpress Dev can access this newly created database.

Run the Tests

  • run phpunit

The Versions

19/05 2017

1.1.x-dev

1.1.9999999.9999999-dev

Playing and testing Wordpress nonces with phpunit tests

  Sources   Download

GPLv2.0+

wordpress test phpunit

19/05 2017

dev-master

9999999-dev

Playing and testing Wordpress nonces with phpunit tests

  Sources   Download

GPLv2.0+

wordpress test phpunit

19/05 2017

1.0.x-dev

1.0.9999999.9999999-dev

Playing and testing Wordpress nonces with phpunit tests

  Sources   Download

GPLv2.0+

wordpress test phpunit

19/05 2017

0.2.x-dev

0.2.9999999.9999999-dev

Playing and testing Wordpress nonces with phpunit tests

  Sources   Download

GPLv2.0+

wordpress test phpunit

17/05 2017

0.1.x-dev

0.1.9999999.9999999-dev

Playing and testing Wordpress nonces with phpunit tests

  Sources   Download

GPLv2.0+

The Requires

 

wordpress test phpunit