Skip to content
This repository has been archived by the owner on Jun 30, 2022. It is now read-only.

Major refactor for 1.0 #61

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# .scrutinizer.yml
build:
nodes:
analysis:
project_setup:
override: true
tests:
override: [php-scrutinizer-run]
tools:
#external_code_coverage: true
filter:
excluded_paths:
- "tests/"
- "RoboFile.php"
40 changes: 8 additions & 32 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,52 +1,28 @@
language: php

php:
- "5.3"
- "5.4"
- "5.5"
- "7.0"
- "7.1"

env:
- WP_VERSION=4.1.1 WP_MULTISITE=0
- WP_VERSION=4.1 WP_MULTISITE=0
- WP_VERSION=4.0.1 WP_MULTISITE=0
- WP_VERSION=4.1.1 WP_MULTISITE=1
- WP_VERSION=4.1 WP_MULTISITE=1
- WP_VERSION=4.0.1 WP_MULTISITE=1
- WP_VERSION=4.9.1 WP_MULTISITE=0
- WP_VERSION=4.9 WP_MULTISITE=0

before_script:
- curl http://cs.sensiolabs.org/get/php-cs-fixer.phar -o php-cs-fixer.phar
- curl -s http://getcomposer.org/installer | php
- php composer.phar install --dev --no-interaction --prefer-source
- composer install --dev --no-interaction
#Coveralls support
- mkdir -p build/logs
- mkdir -p build/cov
#phpUnit setup
#- mkdir -p tmp
# Initialize the WP core directory
- export WP_CORE_DIR=/tmp/wordpress/
- wget -nv -O /tmp/wordpress.tar.gz https://github.com/WordPress/WordPress/tarball/$WP_VERSION
- mkdir -p $WP_CORE_DIR
- tar --strip-components=1 -zxmf /tmp/wordpress.tar.gz -C $WP_CORE_DIR
# Initialize the WP unit test directory
- export WP_TESTS_DIR=/tmp/wordpress-tests/
- svn co http://develop.svn.wordpress.org/tags/$WP_VERSION /tmp/wordpress-tests/
# Set up the database access
- cp /tmp/wordpress-tests/wp-tests-config-sample.php /tmp/wordpress-tests/wp-tests-config.php
- sed -i "s:dirname( __FILE__ ) . '/wordpress/':'$WP_CORE_DIR':" /tmp/wordpress-tests/wp-tests-config.php
- sed -i "s/youremptytestdbnamehere/wordpress_test/" /tmp/wordpress-tests/wp-tests-config.php
- sed -i "s/yourusernamehere/root/" /tmp/wordpress-tests/wp-tests-config.php
- sed -i "s/yourpasswordhere//" /tmp/wordpress-tests/wp-tests-config.php
- mysql -e 'CREATE DATABASE wordpress_test;' -uroot

script:
- phpunit
- ./vendor/bin/robo tests $WP_VERSION

after_script:
- php vendor/bin/coveralls -v --dry-run
#- php vendor/bin/coveralls -v --dry-run

notifications:
email:
recipients:
- daryl@clubduece.com
- daryl@clubduece.net
on_success: change
on_failure: always
65 changes: 65 additions & 0 deletions RoboFile.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<?php
/**
* This is project's console commands configuration for Robo task runner.
*
* @see http://robo.li/
*/
class RoboFile extends \Robo\Tasks
{
// define public methods as commands

/**
* Download the WP test suite, configure for testing, and run the tests themselves.
*
* @param string $version
*/
function tests($version = '4.9.1')
{

$this->taskExec('mysql -e "CREATE DATABASE IF NOT EXISTS test_db"')->run();
$this->taskExec('mysql -e "GRANT ALL ON test_db.* to \'root\'@\'%\'"')->run();
$this->taskSvnStack()
->checkout("https://develop.svn.wordpress.org/tags/{$version} wp-tests")
->run();

$this->setTestConfig();
$this->phpunit();

}

/**
* Run the test suite using the default configuration.
*
* @param string $config The relative path to the PHPUnit XML configuration file.
*/
function phpunit($config = 'tests/phpunit.xml.dist')
{
$this->taskPhpUnit('vendor/bin/phpunit')
->configFile($config)
->envVars(array('WP_TESTS_DIR' => 'wp-tests'))
->run();
}

private function setTestConfig()
{

if (file_exists('wp-tests/wp-tests-config-sample.php')) {
copy('wp-tests/wp-tests-config-sample.php', 'wp-tests/wp-tests-config.php');
}

$this->taskReplaceInFile( 'wp-tests/wp-tests-config.php')
->from('youremptytestdbnamehere')
->to('test_db')
->run();

$this->taskReplaceInFile( 'wp-tests/wp-tests-config.php')
->from('yourusernamehere')
->to('root')
->run();

$this->taskReplaceInFile( 'wp-tests/wp-tests-config.php')
->from('yourpasswordhere')
->to('')
->run();
}
}
235 changes: 0 additions & 235 deletions controllers/class-base-controller-plugin.php

This file was deleted.

Loading