Skip to content

Commit

Permalink
Merge branch 'release/0.19.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
garex committed Aug 30, 2016
2 parents 198c06d + 919af16 commit 8a4ab72
Show file tree
Hide file tree
Showing 16 changed files with 56 additions and 38 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ matrix:
- php: 5.3
env: DB_ENGINE=MyISAM DB_CHARSET=latin1 WP_UPGRADE=1
- php: 5.4
env: PLUGINS=akismet.3.1.4:jetpack.3.7:wordpress-seo.2.3.5:wordfence.6.0.17:contact-form-7.4.3:google-sitemap-generator.4.0.8
env: PLUGINS=akismet.3.1.11:jetpack.4.2.2:wordpress-seo.3.3.4:wordfence.6.1.14:contact-form-7.4.5:google-sitemap-generator.4.0.8
allow_failures:
- php: 5.2
env: WP_VERSION=3.5
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
## Changelog ##


### 0.19.2 ###

Welcome WordPress 4.6

* Upgrade autotests
* No new functionality was added!


### 0.19.1 ###

Partial fix of Glossary-like plugins incompatibility
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
**Donate link:** https://www.paypal.me/Ustimenko/19.83eur
**Tags:** psychological, testing, test, quiz
**Requires at least:** 3.2
**Tested up to:** 4.5.3
**Stable tag:** 0.19.1
**Tested up to:** 4.6
**Stable tag:** 0.19.2
**License:** GPLv3
**License URI:** http://www.gnu.org/licenses/gpl-3.0.html

Expand Down
2 changes: 1 addition & 1 deletion src/Addon/IFacade.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

interface WpTesting_Addon_IFacade
interface WpTesting_Addon_IFacade extends WpTesting_Facade_IORM
{

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Facade.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

class WpTesting_Facade implements WpTesting_Addon_IFacade, WpTesting_Facade_IORM, WpTesting_Facade_ITestPasser
class WpTesting_Facade implements WpTesting_Addon_IFacade, WpTesting_Facade_ITestPasser
{

private $doers = array();
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
require_once dirname(__FILE__) . '/WordPress/IPath.php';
require_once dirname(__FILE__) . '/Addon/IWordPressFacade.php';
require_once dirname(__FILE__) . '/WordPressFacade.php';
require_once dirname(__FILE__) . '/Addon/IFacade.php';
require_once dirname(__FILE__) . '/Facade/IORM.php';
require_once dirname(__FILE__) . '/Addon/IFacade.php';
require_once dirname(__FILE__) . '/Facade/ITestPasser.php';
require_once dirname(__FILE__) . '/Facade.php';
9 changes: 5 additions & 4 deletions tests/integration-environment/create.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ set -e
HERE=$(dirname $0)
DB_ENGINE=${DB_ENGINE:-InnoDB}
DB_CHARSET=${DB_CHARSET:-utf8}
WP_VERSION=${WP_VERSION:-latest}
WP_VERSION=${WP_VERSION:-4.6}
WP_UPGRADE=${WP_UPGRADE:-0}
WP_LINK_SELF=${WP_LINK_SELF:-0}
WP_T_SERVER=${WP_T_SERVER:-http://wpti.dev:8000}
Expand Down Expand Up @@ -36,7 +36,7 @@ function db {
function setup_link {
log 'Setting up symbolic link'
rm --force --recursive /tmp/wpti
cp --recursive $HERE /tmp/wpti
cp --preserve=mode,ownership,timestamps --recursive $HERE /tmp/wpti
}

function start_nginx {
Expand Down Expand Up @@ -78,8 +78,8 @@ function install_wp {
tar --extract --ungzip --file=wordpress-$WP_VERSION.tar.gz --directory=..
cd ../wordpress
log '.. clean up plugins'
rm --recursive --force wp-content/plugins
mkdir --parents wp-content/plugins
rm --recursive --force wp-content/plugins wp-content/upgrade
mkdir --parents wp-content/plugins wp-content/upgrade
if [ -f $WP_PATCH ];
then
# To create patch use: diff --unified path/to/original.php path/to/fix.php > $WP_PATCH
Expand All @@ -93,6 +93,7 @@ function install_wp {

function set_db_engine {
log "Setting DB engine to $DB_ENGINE"
mysql --user=root --execute 'SET GLOBAL sql_mode = "ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"'
mysql --user=root wpti --execute 'SHOW TABLES' | tail -n+2 | xargs -i mysql wpti --execute "ALTER TABLE {} ENGINE=$DB_ENGINE"
}

Expand Down
1 change: 1 addition & 0 deletions tests/mocha/mocha-casperjs.opts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--log-level=info
4 changes: 2 additions & 2 deletions tests/mocha/test/0-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ describe('Plugin activation', function() {

casper.waitForSelector('.jetpack-module.active', function() {
'Fatal'.should.not.be.textInDOM
}, null, 60000)
}, null, 90000)

casper.thenOpen(server + '/wp-admin/plugins.php', function () {
expect(/Plugins/).to.matchTitle
Expand All @@ -74,6 +74,6 @@ describe('Plugin activation', function() {
casper.waitForUrl(/activate/, function() {
'Fatal'.should.not.be.textInDOM
'#wp-testing .deactivate a,[data-slug=wp-testing] .deactivate a'.should.be.inDOM
}, null, 60000)
}, null, 90000)
})
})
4 changes: 2 additions & 2 deletions tests/mocha/test/answers-and-scales-2.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ describe('Answers2 and Scales2', function() {
casper.then(function() {
this.click('#wpt_question_add');
this.fillSelectors('form#post', {
'#title': 'Test With Answers Sorted',
'#title': 'Sorted Answers',
'#wpt_question_title_0': 'Question 1',
})
this.clickLabel(' No', 'label')
Expand All @@ -156,7 +156,7 @@ describe('Answers2 and Scales2', function() {
})
})

casper.waitForUrl(/answers-sorted/, function() {
casper.waitForUrl(/sorted-answers/, function() {
'Fatal'.should.not.be.textInDOM
'jQuery(".question .answer:first").text().trim()'.should.evaluate.to.be.equal('No')
this.clickLabel('Edit Test')
Expand Down
2 changes: 1 addition & 1 deletion tests/mocha/test/answers-variables.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe('Answers variables', function() {

it('should show empty test as under construction initially', function() {
casper.thenOpen(server + '/wp-admin/edit.php?post_type=wpt_test', function() {
this.clickLabel('Test With Answers Sorted', '*[@id="posts-filter"]/*//a')
this.clickLabel('Sorted Answers', '*[@id="posts-filter"]/*//a')
})

casper.waitForUrl(/edit/, function() {
Expand Down
2 changes: 1 addition & 1 deletion tests/mocha/test/diagrams.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ describe('Diagrams', function() {
this.clickLabel('Add New', '*[@id="menu-posts-wpt_test"]/*//a')
})

casper.then(function() {
casper.waitForSelector('#taxonomy-wpt_result .wpt-sortable', function() {
'Fatal'.should.not.be.textInDOM
'Add New Test'.should.be.inTitle

Expand Down
4 changes: 2 additions & 2 deletions tests/mocha/test/shortcode.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,9 @@ describe('Shortcode', function() {

describe('wpt_test_first_page: two tests updates each own`s percentage in title', function() {
it('should be added',
addShortcodeAndCheckResult('[wpt_test_first_page name=eysencks-personality-inventory-epi-extroversionintroversion]\n[wpt_test_first_page name=test-with-answers-sorted]', function() {
addShortcodeAndCheckResult('[wpt_test_first_page name=eysencks-personality-inventory-epi-extroversionintroversion]\n[wpt_test_first_page name=sorted-answers]', function() {
'The Eysenck Personality Inventory (EPI) measures two pervasive'.should.be.textInDOM
'Test With Answers Sorted'.should.be.textInDOM
'Sorted Answers'.should.be.textInDOM
}))

it('should not have percentage initially', function() {
Expand Down
28 changes: 24 additions & 4 deletions tests/mocha/test/z-plugin-deactivation.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,36 @@ describe('Plugin deactivation', function() {
})

it('should be deleted', function() {
casper.setFilter('page.confirm', function(msg) {
return true
});

casper.then(function() {
this.click('#wp-testing .delete a, [data-slug=wp-testing] .delete a')
})

casper.waitForUrl(/delete/, function() {
this.click('#submit')
})
var isClickThen = hasDeletedId = false
casper.waitFor(function check() {
isClickThen = this.evaluate(function() {
return document.location.href.indexOf('delete') > -1
})

hasDeletedId = this.evaluate(function() {
return document.getElementById('wp-testing-deleted') != null
})

return isClickThen || hasDeletedId
}, function then() {
isClickThen && this.click('#submit')
}, null, 30000)

casper.then(function() {
'#wp-testing, [data-slug=wp-testing]'.should.not.be.inDOM
if (isClickThen) {
'#wp-testing, [data-slug=wp-testing]'.should.not.be.inDOM
}
if (hasDeletedId) {
'#wp-testing-deleted'.should.be.inDOM
}
})
})

Expand Down
18 changes: 3 additions & 15 deletions tests/mocha/test/z-plugin-upgrade.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,6 @@ describe('Plugin upgrade', function() {
})
})

it('should activate plugin before update', function() {
casper.then(function() {
this.clickLabel('Activate')
})

casper.waitForText(/Deactivate/)
})

it('should select plugin for update', function() {
casper.then(function() {
this.evaluate(function() {
Expand All @@ -42,16 +34,12 @@ describe('Plugin upgrade', function() {
this.click('#doaction')
})

casper.waitForUrl(/upgrade/)
casper.waitForSelector('.updated-message.notice-success')
})

it('should update site title through DB', function() {
casper.withFrame(0, function() {
this.waitForText(/All updates have been completed/, function() {
this.thenOpen(server + '/', function() {
'Upgraded from plugin'.should.be.textInDOM
})
})
casper.thenOpen(server + '/', function() {
'Upgraded from plugin'.should.be.textInDOM
})
})
})
2 changes: 1 addition & 1 deletion wp-testing.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: Wp-testing
* Plugin URI: http://wordpress.org/extend/plugins/wp-testing/
* Description: Helps to create psychological tests.
* Version: 0.19.1
* Version: 0.19.2
* Author: Alexander Ustimenko
* Author URI: http://ustimen.co
* License: GPL3
Expand Down

0 comments on commit 8a4ab72

Please sign in to comment.