Commit 2592d994 authored by Erick Hitter's avatar Erick Hitter

Merge branch 'add/wp-auto-deploy' into 'master'

Add automated WP.org deploys

See merge request !1
parents 1cf452e7 d672d8b0
Pipeline #830 passed with stages
in 3 minutes and 1 second
# A set of files you probably don't want in your WordPress.org distribution
.distignore
.editorconfig
.git
.gitignore
.gitlab-ci.yml
.travis.yml
.wordpress-org/*
.DS_Store
Thumbs.db
behat.yml
bitbucket-pipelines.yml
bin
.circleci/config.yml
composer.json
composer.lock
Gruntfile.js
package.json
package-lock.json
phpunit.xml
phpunit.xml.dist
multisite.xml
multisite.xml.dist
.phpcs.xml
phpcs.xml
.phpcs.xml.dist
phpcs.xml.dist
README.md
wp-cli.local.yml
yarn.lock
tests
vendor
node_modules
*.sql
*.tar.gz
*.zip
# This file is for unifying the coding style for different editors and IDEs
# editorconfig.org
# WordPress Coding Standards
# https://make.wordpress.org/core/handbook/coding-standards/
root = true
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = tab
indent_size = 4
[{.jshintrc,*.json,*.yml}]
indent_style = space
indent_size = 2
[{*.txt,wp-config-sample.php}]
end_of_line = crlf
# A set of files you probably don't want in your WordPress.org distribution
/.distignore export-ignore
/.editorconfig export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.gitlab-ci.yml export-ignore
/.travis.yml export-ignore
/.DS_Store export-ignore
/.wordpress-org export-ignore
/Thumbs.db export-ignore
/behat.yml export-ignore
/bitbucket-pipelines.yml export-ignore
/bin export-ignore
/.circleci/config.yml export-ignore
/composer.json export-ignore
/composer.lock export-ignore
/Gruntfile.js export-ignore
/package.json export-ignore
/package-lock.json export-ignore
/phpunit.xml export-ignore
/phpunit.xml.dist export-ignore
/multisite.xml export-ignore
/multisite.xml.dist export-ignore
/.phpcs.xml export-ignore
/phpcs.xml export-ignore
/.phpcs.xml.dist export-ignore
/phpcs.xml.dist export-ignore
/README.md export-ignore
/wp-cli.local.yml export-ignore
/yarn.lock export-ignore
/tests export-ignore
/vendor export-ignore
/node_modules export-ignore
/*.sql export-ignore
/*.tar.gz export-ignore
/*.zip export-ignore
.DS_Store
phpcs.xml
phpunit.xml
Thumbs.db
wp-cli.local.yml
node_modules/
*.sql
*.tar.gz
*.zip
variables:
# Configure mysql service (https://hub.docker.com/_/mysql/)
MYSQL_DATABASE: wordpress_tests
MYSQL_ROOT_PASSWORD: mysql
cache:
paths:
- $HOME/.composer
- /root/.composer
before_script:
# Set up WordPress tests
- bash bin/install-wp-tests.sh $MYSQL_DATABASE root $MYSQL_ROOT_PASSWORD mysql latest true
# PHPUnit
- |
if [[ $(php -v) =~ "PHP 7." ]]; then
composer global require "phpunit/phpunit=6.1.*"
else
composer global require "phpunit/phpunit=4.8.*"
fi
# Install PHPCS and WPCS
- composer global require automattic/vipwpcs
- composer global require phpcompatibility/phpcompatibility-wp
- phpcs --config-set installed_paths $HOME/.composer/vendor/wp-coding-standards/wpcs,$HOME/.composer/vendor/automattic/vipwpcs,$HOME/.composer/vendor/phpcompatibility/php-compatibility,$HOME/.composer/vendor/phpcompatibility/phpcompatibility-paragonie,$HOME/.composer/vendor/phpcompatibility/phpcompatibility-wp
PHPunit:PHP7.3:MySQL:
stage: test
image: containers.ethitter.com:443/docker/images/php:7.3
services:
- mysql:5.6
script:
- find . -type "f" -iname "*.php" | xargs -L "1" php -l
- phpcs -n
- phpunit
allow_failure: true
PluginSVN:
stage: deploy
image: containers.ethitter.com:443/docker/images/php:7.3
before_script:
- curl -o ./bin/deploy.sh https://git-cdn.e15r.co/open-source/wp-org-plugin-deploy/raw/master/scripts/deploy.sh
- chmod +x ./bin/deploy.sh
script: ./bin/deploy.sh
when: on_success
<?xml version="1.0"?>
<ruleset name="WP Print Friendly">
<description>Generally-applicable sniffs for WordPress plugins.</description>
<!-- What to scan -->
<file>.</file>
<exclude-pattern>/vendor/</exclude-pattern>
<exclude-pattern>/node_modules/</exclude-pattern>
<exclude-pattern>/tests/*</exclude-pattern>
<!-- How to scan -->
<!-- Usage instructions: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Usage -->
<!-- Annotated ruleset: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-ruleset.xml -->
<arg value="sp"/> <!-- Show sniff and progress -->
<arg name="basepath" value="./"/><!-- Strip the file paths down to the relevant bit -->
<arg name="colors"/>
<arg name="extensions" value="php"/>
<arg name="parallel" value="8"/><!-- Enables parallel processing when available for faster results. -->
<!-- Rules: Check PHP version compatibility -->
<!-- https://github.com/PHPCompatibility/PHPCompatibility#sniffing-your-code-for-compatibility-with-specific-php-versions -->
<config name="testVersion" value="7.2-"/>
<!-- https://github.com/PHPCompatibility/PHPCompatibilityWP -->
<rule ref="PHPCompatibilityWP"/>
<!-- Rules: WordPress Coding Standards -->
<!-- https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards -->
<!-- https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/wiki/Customizable-sniff-properties -->
<config name="minimum_supported_wp_version" value="3.1"/>
<rule ref="WordPress" />
<rule ref="WordPressVIPMinimum" />
<rule ref="WordPress-VIP-Go" />
<rule ref="WordPress.NamingConventions.PrefixAllGlobals">
<properties>
<!-- Value: replace the function, class, and variable prefixes used. Separate multiple prefixes with a comma. -->
<property name="prefixes" type="array" value="wp_print_friendly"/>
</properties>
</rule>
<rule ref="WordPress.WP.I18n">
<properties>
<!-- Value: replace the text domain used. -->
<property name="text_domain" type="array" value="wp_print_friendly"/>
</properties>
</rule>
<rule ref="WordPress.WhiteSpace.ControlStructureSpacing">
<properties>
<property name="blank_line_check" value="true"/>
</properties>
</rule>
</ruleset>
module.exports = function( grunt ) {
'use strict';
// Project configuration
grunt.initConfig( {
pkg: grunt.file.readJSON( 'package.json' ),
addtextdomain: {
options: {
textdomain: 'wp_print_friendly',
},
update_all_domains: {
options: {
updateDomains: true
},
src: [ '*.php', '**/*.php', '!\.git/**/*', '!bin/**/*', '!node_modules/**/*', '!tests/**/*' ]
}
},
wp_readme_to_markdown: {
your_target: {
files: {
'README.md': 'readme.txt'
}
},
},
makepot: {
target: {
options: {
domainPath: '/languages',
exclude: [ '\.git/*', 'bin/*', 'node_modules/*', 'tests/*' ],
mainFile: 'wp-print-friendly.php',
potFilename: 'wp-print-friendly.pot',
potHeaders: {
poedit: true,
'x-poedit-keywordslist': true
},
type: 'wp-plugin',
updateTimestamp: true
}
}
},
} );
grunt.loadNpmTasks( 'grunt-wp-i18n' );
grunt.loadNpmTasks( 'grunt-wp-readme-to-markdown' );
grunt.registerTask( 'default', [ 'i18n','readme' ] );
grunt.registerTask( 'i18n', ['addtextdomain', 'makepot'] );
grunt.registerTask( 'readme', ['wp_readme_to_markdown'] );
grunt.util.linefeed = '\n';
};
This diff is collapsed.
#!/usr/bin/env bash
if [ $# -lt 3 ]; then
echo "usage: $0 <db-name> <db-user> <db-pass> [db-host] [wp-version] [skip-database-creation]"
exit 1
fi
DB_NAME=$1
DB_USER=$2
DB_PASS=$3
DB_HOST=${4-localhost}
WP_VERSION=${5-latest}
SKIP_DB_CREATE=${6-false}
TMPDIR=${TMPDIR-/tmp}
TMPDIR=$(echo $TMPDIR | sed -e "s/\/$//")
WP_TESTS_DIR=${WP_TESTS_DIR-$TMPDIR/wordpress-tests-lib}
WP_CORE_DIR=${WP_CORE_DIR-$TMPDIR/wordpress/}
download() {
if [ `which curl` ]; then
curl -s "$1" > "$2";
elif [ `which wget` ]; then
wget -nv -O "$2" "$1"
fi
}
if [[ $WP_VERSION =~ ^[0-9]+\.[0-9]+\-(beta|RC)[0-9]+$ ]]; then
WP_BRANCH=${WP_VERSION%\-*}
WP_TESTS_TAG="branches/$WP_BRANCH"
elif [[ $WP_VERSION =~ ^[0-9]+\.[0-9]+$ ]]; then
WP_TESTS_TAG="branches/$WP_VERSION"
elif [[ $WP_VERSION =~ [0-9]+\.[0-9]+\.[0-9]+ ]]; then
if [[ $WP_VERSION =~ [0-9]+\.[0-9]+\.[0] ]]; then
# version x.x.0 means the first release of the major version, so strip off the .0 and download version x.x
WP_TESTS_TAG="tags/${WP_VERSION%??}"
else
WP_TESTS_TAG="tags/$WP_VERSION"
fi
elif [[ $WP_VERSION == 'nightly' || $WP_VERSION == 'trunk' ]]; then
WP_TESTS_TAG="trunk"
else
# http serves a single offer, whereas https serves multiple. we only want one
download http://api.wordpress.org/core/version-check/1.7/ /tmp/wp-latest.json
grep '[0-9]+\.[0-9]+(\.[0-9]+)?' /tmp/wp-latest.json
LATEST_VERSION=$(grep -o '"version":"[^"]*' /tmp/wp-latest.json | sed 's/"version":"//')
if [[ -z "$LATEST_VERSION" ]]; then
echo "Latest WordPress version could not be found"
exit 1
fi
WP_TESTS_TAG="tags/$LATEST_VERSION"
fi
set -ex
install_wp() {
if [ -d $WP_CORE_DIR ]; then
return;
fi
mkdir -p $WP_CORE_DIR
if [[ $WP_VERSION == 'nightly' || $WP_VERSION == 'trunk' ]]; then
mkdir -p $TMPDIR/wordpress-nightly
download https://wordpress.org/nightly-builds/wordpress-latest.zip $TMPDIR/wordpress-nightly/wordpress-nightly.zip
unzip -q $TMPDIR/wordpress-nightly/wordpress-nightly.zip -d $TMPDIR/wordpress-nightly/
mv $TMPDIR/wordpress-nightly/wordpress/* $WP_CORE_DIR
else
if [ $WP_VERSION == 'latest' ]; then
local ARCHIVE_NAME='latest'
elif [[ $WP_VERSION =~ [0-9]+\.[0-9]+ ]]; then
# https serves multiple offers, whereas http serves single.
download https://api.wordpress.org/core/version-check/1.7/ $TMPDIR/wp-latest.json
if [[ $WP_VERSION =~ [0-9]+\.[0-9]+\.[0] ]]; then
# version x.x.0 means the first release of the major version, so strip off the .0 and download version x.x
LATEST_VERSION=${WP_VERSION%??}
else
# otherwise, scan the releases and get the most up to date minor version of the major release
local VERSION_ESCAPED=`echo $WP_VERSION | sed 's/\./\\\\./g'`
LATEST_VERSION=$(grep -o '"version":"'$VERSION_ESCAPED'[^"]*' $TMPDIR/wp-latest.json | sed 's/"version":"//' | head -1)
fi
if [[ -z "$LATEST_VERSION" ]]; then
local ARCHIVE_NAME="wordpress-$WP_VERSION"
else
local ARCHIVE_NAME="wordpress-$LATEST_VERSION"
fi
else
local ARCHIVE_NAME="wordpress-$WP_VERSION"
fi
download https://wordpress.org/${ARCHIVE_NAME}.tar.gz $TMPDIR/wordpress.tar.gz
tar --strip-components=1 -zxmf $TMPDIR/wordpress.tar.gz -C $WP_CORE_DIR
fi
download https://raw.github.com/markoheijnen/wp-mysqli/master/db.php $WP_CORE_DIR/wp-content/db.php
}
install_test_suite() {
# portable in-place argument for both GNU sed and Mac OSX sed
if [[ $(uname -s) == 'Darwin' ]]; then
local ioption='-i.bak'
else
local ioption='-i'
fi
# set up testing suite if it doesn't yet exist
if [ ! -d $WP_TESTS_DIR ]; then
# set up testing suite
mkdir -p $WP_TESTS_DIR
svn co --quiet https://develop.svn.wordpress.org/${WP_TESTS_TAG}/tests/phpunit/includes/ $WP_TESTS_DIR/includes
svn co --quiet https://develop.svn.wordpress.org/${WP_TESTS_TAG}/tests/phpunit/data/ $WP_TESTS_DIR/data
fi
if [ ! -f wp-tests-config.php ]; then
download https://develop.svn.wordpress.org/${WP_TESTS_TAG}/wp-tests-config-sample.php "$WP_TESTS_DIR"/wp-tests-config.php
# remove all forward slashes in the end
WP_CORE_DIR=$(echo $WP_CORE_DIR | sed "s:/\+$::")
sed $ioption "s:dirname( __FILE__ ) . '/src/':'$WP_CORE_DIR/':" "$WP_TESTS_DIR"/wp-tests-config.php
sed $ioption "s/youremptytestdbnamehere/$DB_NAME/" "$WP_TESTS_DIR"/wp-tests-config.php
sed $ioption "s/yourusernamehere/$DB_USER/" "$WP_TESTS_DIR"/wp-tests-config.php
sed $ioption "s/yourpasswordhere/$DB_PASS/" "$WP_TESTS_DIR"/wp-tests-config.php
sed $ioption "s|localhost|${DB_HOST}|" "$WP_TESTS_DIR"/wp-tests-config.php
fi
}
install_db() {
if [ ${SKIP_DB_CREATE} = "true" ]; then
return 0
fi
# parse DB_HOST for port or socket references
local PARTS=(${DB_HOST//\:/ })
local DB_HOSTNAME=${PARTS[0]};
local DB_SOCK_OR_PORT=${PARTS[1]};
local EXTRA=""
if ! [ -z $DB_HOSTNAME ] ; then
if [ $(echo $DB_SOCK_OR_PORT | grep -e '^[0-9]\{1,\}$') ]; then
EXTRA=" --host=$DB_HOSTNAME --port=$DB_SOCK_OR_PORT --protocol=tcp"
elif ! [ -z $DB_SOCK_OR_PORT ] ; then
EXTRA=" --socket=$DB_SOCK_OR_PORT"
elif ! [ -z $DB_HOSTNAME ] ; then
EXTRA=" --host=$DB_HOSTNAME --protocol=tcp"
fi
fi
# create database
mysqladmin create $DB_NAME --user="$DB_USER" --password="$DB_PASS"$EXTRA
}
install_wp
install_test_suite
install_db
# Copyright (C) 2019 Erick Hitter, Steven K Word, and Oomph, Inc.
# This file is distributed under the same license as the WP Print Friendly package.
msgid ""
msgstr ""
"Project-Id-Version: WP Print Friendly 0.6.2\n"
"Report-Msgid-Bugs-To: "
"https://wordpress.org/support/plugin/wp-print-friendly\n"
"POT-Creation-Date: 2019-04-14 21:25:11+00:00\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"PO-Revision-Date: 2019-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"X-Generator: grunt-wp-i18n 0.5.4\n"
"X-Poedit-KeywordsList: "
"__;_e;_x:1,2c;_ex:1,2c;_n:1,2;_nx:1,2,4c;_n_noop:1,2;_nx_noop:1,2,3c;esc_"
"attr__;esc_html__;esc_attr_e;esc_html_e;esc_attr_x:1,2c;esc_html_x:1,2c;\n"
"Language: en\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Poedit-Country: United States\n"
"X-Poedit-SourceCharset: UTF-8\n"
"X-Poedit-Basepath: ../\n"
"X-Poedit-SearchPath-0: .\n"
"X-Poedit-Bookmarks: \n"
"X-Textdomain-Support: yes\n"
#: wp-print-friendly.php:120
msgid "Print this entry"
msgstr ""
#: wp-print-friendly.php:121
msgid "Print this page"
msgstr ""
#: wp-print-friendly.php:125
msgid "Endnotes:"
msgstr ""
#: wp-print-friendly.php:670
msgid "Automatically add print links based on settings below?"
msgstr ""
#: wp-print-friendly.php:672 wp-print-friendly.php:736
msgid "Yes"
msgstr ""
#: wp-print-friendly.php:673
msgid "No"
msgstr ""
#: wp-print-friendly.php:677
msgid "Automatically place link:"
msgstr ""
#: wp-print-friendly.php:679
msgid "Above content"
msgstr ""
#: wp-print-friendly.php:680
msgid "Below content"
msgstr ""
#: wp-print-friendly.php:681
msgid "Above and below content"
msgstr ""
#: wp-print-friendly.php:685
msgid "Display automatically on:"
msgstr ""
#: wp-print-friendly.php:698
msgid "Text for link to print entire item:"
msgstr ""
#: wp-print-friendly.php:704
msgid "Text for link to print current page:"
msgstr ""
#: wp-print-friendly.php:708
msgid ""
"If viewing a multipage post (set by using the &lt;!--nextpage--&gt; tag), "
"the text above is used for a link to print just the current page."
msgstr ""
#: wp-print-friendly.php:709
msgid "<strong>To hide this link,</strong> clear the field's contents."
msgstr ""
#: wp-print-friendly.php:713
msgid "CSS for print links:"
msgstr ""
#: wp-print-friendly.php:717
msgid ""
"For page-specific print links, a second class, created by appending "
"<strong>_cur</strong> to the above text, is added to each link."
msgstr ""
#: wp-print-friendly.php:718
msgid ""
"Be aware that Internet Explorer will only interpret the first two CSS "
"classes, so if multiple classes are entered above, the page-specific class "
"may not be available in IE."
msgstr ""
#: wp-print-friendly.php:722
msgid "Open print-friendly views:"
msgstr ""
#: wp-print-friendly.php:724
msgid "In the same window"
msgstr ""
#: wp-print-friendly.php:725
msgid "In a new window"
msgstr ""
#: wp-print-friendly.php:734
msgid "Include endnotes for links found in content?"
msgstr ""
#: wp-print-friendly.php:738
msgid ""
"If enabled, content is automatically scanned for links and an endnote is "
"added for each link found. This can be helpful for users if your content "
"includes many links."
msgstr ""
#: wp-print-friendly.php:742
msgid "Endnotes heading:"
msgstr ""
#: wp-print-friendly.php:746
msgid ""
"If endnotes are enabled, the text entered above will be output above the "
"list of links."
msgstr ""
#. Plugin Name of the plugin/theme
msgid "WP Print Friendly"
msgstr ""
#: wp-print-friendly.php:882
msgid ""
"You must refresh your site's permalinks before WP Print Friendly is fully "
"activated. To do so, go to <a href=\"%s\">Permalinks</a> and click the "
"<strong><em>Save Changes</em></strong> button at the bottom of the screen."
msgstr ""
#: wp-print-friendly.php:884
msgid "When finished, click <a href=\"%s\">here</a> to hide this message."
msgstr ""
#. Plugin URI of the plugin/theme
msgid "http://oomphinc.com/plugins-modules/wp-print-friendly/"
msgstr ""
#. Description of the plugin/theme
msgid ""
"Extends WordPress' template system to support printer-friendly templates. "
"Works with permalink structures to support nice URLs."
msgstr ""
#. Author of the plugin/theme
msgid "Erick Hitter, Steven K Word, and Oomph, Inc."
msgstr ""
#. Author URI of the plugin/theme
msgid "http://oomphinc.com/"
msgstr ""
\ No newline at end of file
{
"name": "wp-print-friendly",
"version": "0.1.0",
"main": "Gruntfile.js",
"author": "Erick Hitter, Steven K Word, and Oomph, Inc.",
"devDependencies": {
"grunt": "~0.4.5",
"grunt-wp-i18n": "~0.5.0",
"grunt-wp-readme-to-markdown": "~1.0.0"
}
}
<?xml version="1.0"?>
<phpunit
bootstrap="tests/bootstrap.php"
backupGlobals="false"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
>
<testsuites>
<testsuite>
<directory prefix="test-" suffix=".php">./tests/</directory>
<exclude>./tests/test-sample.php</exclude>
</testsuite>
</testsuites>
</phpunit>
...@@ -3,8 +3,8 @@ Contributors: ethitter, stevenkword, thinkoomph ...@@ -3,8 +3,8 @@ Contributors: ethitter, stevenkword, thinkoomph
Donate link: http://www.thinkoomph.com/plugins-modules/wp-print-friendly/ Donate link: http://www.thinkoomph.com/plugins-modules/wp-print-friendly/
Tags: print, template, printer, printable Tags: print, template, printer, printable
Requires at least: 3.1 Requires at least: 3.1
Tested up to: 4.6 Tested up to: 5.2
Stable tag: 0.6.1 Stable tag: 0.6.2
License: GPLv2 or later License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html License URI: http://www.gnu.org/licenses/gpl-2.0.html
...@@ -59,6 +59,9 @@ This plugin is known to conflict with certain plugins, many pertaining to SEO an ...@@ -59,6 +59,9 @@ This plugin is known to conflict with certain plugins, many pertaining to SEO an
== Changelog == == Changelog ==
= 0.6.2 =
* PHP 7.3 compatibility.
= 0.6.1 = = 0.6.1 =
* Security update: correct misuse of `add_query_arg()` as identified by Sucuri: https://blog.sucuri.net/2015/04/security-advisory-xss-vulnerability-affecting-multiple-wordpress-plugins.html. * Security update: correct misuse of `add_query_arg()` as identified by Sucuri: https://blog.sucuri.net/2015/04/security-advisory-xss-vulnerability-affecting-multiple-wordpress-plugins.html.
...@@ -151,6 +154,9 @@ This plugin is known to conflict with certain plugins, many pertaining to SEO an ...@@ -151,6 +154,9 @@ This plugin is known to conflict with certain plugins, many pertaining to SEO an
== Upgrade Notice == == Upgrade Notice ==
= 0.6.2 =
Resolves a warning arising in PHP 7.3.
= 0.6.1 = = 0.6.1 =
Security update: correct misuse of `add_query_arg()` as identified by Sucuri: https://blog.sucuri.net/2015/04/security-advisory-xss-vulnerability-affecting-multiple-wordpress-plugins.html. Security update: correct misuse of `add_query_arg()` as identified by Sucuri: https://blog.sucuri.net/2015/04/security-advisory-xss-vulnerability-affecting-multiple-wordpress-plugins.html.
......
<?php
/**
* PHPUnit bootstrap file
*
* @package WP_Print_Friendly
*/
$_tests_dir = getenv( 'WP_TESTS_DIR' );
if ( ! $_tests_dir ) {
$_tests_dir = rtrim( sys_get_temp_dir(), '/\\' ) . '/wordpress-tests-lib';
}
if ( ! file_exists( $_tests_dir . '/includes/functions.php' ) ) {
echo "Could not find $_tests_dir/includes/functions.php, have you run bin/install-wp-tests.sh ?" . PHP_EOL; // WPCS: XSS ok.
exit( 1 );
}
// Give access to tests_add_filter() function.
require_once $_tests_dir . '/includes/functions.php';
/**
* Manually load the plugin being tested.
*/
function _manually_load_plugin() {
require dirname( dirname( __FILE__ ) ) . '/wp-print-friendly.php';
}
tests_add_filter( 'muplugins_loaded', '_manually_load_plugin' );
// Start up the WP testing environment.
require $_tests_dir . '/includes/bootstrap.php';
<?php
/**
* Class SampleTest
*
* @package WP_Print_Friendly
*/
/**
* Sample test case.
*/
class SampleTest extends WP_UnitTestCase {
/**
* A single example test.
*/
public function test_sample() {
// Replace this with some actual testing code.
$this->assertTrue( true );
}
}
...@@ -4,7 +4,7 @@ Plugin Name: WP Print Friendly ...@@ -4,7 +4,7 @@ Plugin Name: WP Print Friendly
Plugin URI: http://oomphinc.com/plugins-modules/wp-print-friendly/ Plugin URI: http://oomphinc.com/plugins-modules/wp-print-friendly/
Description: Extends WordPress' template system to support printer-friendly templates. Works with permalink structures to support nice URLs. Description: Extends WordPress' template system to support printer-friendly templates. Works with permalink structures to support nice URLs.
Author: Erick Hitter, Steven K Word, and Oomph, Inc. Author: Erick Hitter, Steven K Word, and Oomph, Inc.
Version: 0.6.1 Version: 0.6.2
Author URI: http://oomphinc.com/ Author URI: http://oomphinc.com/
Text Domain: wp_print_friendly Text Domain: wp_print_friendly
...@@ -820,7 +820,7 @@ class wp_print_friendly { ...@@ -820,7 +820,7 @@ class wp_print_friendly {
break; break;
default: default:
continue; continue 2;
break; break;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment