Commit e2859404 authored by Erick Hitter's avatar Erick Hitter
Browse files

Merge branch 'bump-wp-compat' into 'master'

Bump WP compatibility

See merge request !14
parents 4a29c455 b629bce0
Pipeline #3495 passed with stages
in 2 minutes and 52 seconds
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.2:MySQL:
stage: test
image: containers.ethitter.com:443/docker/images/php:7.2
services:
- mysql:5.6
script:
- find . -type "f" -iname "*.php" | xargs -L "1" php -l
- phpcs -n
- phpunit
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
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
include:
- remote: https://git-cdn.e15r.co/gitlab/ci/wordpress/-/raw/main/plugins/default.yml
......@@ -3,7 +3,7 @@
**Donate link:** http://www.thinkoomph.com/plugins-modules/view-all-posts-pages/
**Tags:** view all, pages, paged, paged post, multipage, single view, single page, wp_link_pages, nextpage, next page, quicktag
**Requires at least:** 3.2.1
**Tested up to:** 5.4
**Tested up to:** 5.5
**Stable tag:** 0.9.3
**License:** GPLv2 or later
**License URI:** http://www.gnu.org/licenses/gpl-2.0.html
......
......@@ -3,7 +3,7 @@ Contributors: ethitter, thinkoomph
Donate link: http://www.thinkoomph.com/plugins-modules/view-all-posts-pages/
Tags: view all, pages, paged, paged post, multipage, single view, single page, wp_link_pages, nextpage, next page, quicktag
Requires at least: 3.2.1
Tested up to: 5.4
Tested up to: 5.5
Stable tag: 0.9.3
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
......
......@@ -23,7 +23,7 @@ require_once $_tests_dir . '/includes/functions.php';
* Manually load the plugin being tested.
*/
function _manually_load_plugin() {
require dirname( __FILE__, 2 ) . '/view-all-posts-pages.php';
require dirname( dirname( __FILE__ ) ) . '/view-all-posts-pages.php';
}
tests_add_filter( 'muplugins_loaded', '_manually_load_plugin' );
......
......@@ -14,11 +14,11 @@ class PostFilters extends WP_UnitTestCase {
*
* @var array
*/
protected static $pages_content = [
protected static $pages_content = array(
1 => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec at neque sit amet massa pulvinar ullamcorper. Sed cursus, quam a tristique volutpat, diam justo cursus nunc, eu elementum sem orci ut ante. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Cras aliquet, diam sit amet tincidunt pulvinar, tortor neque accumsan dui, efficitur placerat justo nisl et justo. Pellentesque convallis dui nulla, vel finibus dui cursus quis. Sed semper nunc et euismod tristique. Aliquam tincidunt eget massa ac congue. Ut ipsum eros, dignissim ut eleifend eu, consectetur a eros. Proin in mattis dui.',
2 => 'Sed sed sapien et lectus aliquam tempor. Duis consequat sapien scelerisque metus pulvinar aliquam. Pellentesque vestibulum id justo vel egestas. Nullam a metus sed risus blandit egestas. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed scelerisque ipsum ante, quis iaculis nibh suscipit eget. Nulla facilisi. Nulla at lacus at mauris sodales varius et nec massa. Etiam in nisi commodo, semper velit vitae, condimentum nisl. Ut quis mauris non ipsum feugiat vehicula pulvinar vitae dui. Nulla facilisi.',
3 => 'Donec condimentum ipsum felis. Vivamus rhoncus mauris ac commodo hendrerit. Quisque ultrices nibh laoreet purus volutpat, ut congue purus suscipit. Sed eget lacus nec eros scelerisque volutpat. Fusce tristique quam eu risus porta, id vulputate dui maximus. Phasellus suscipit faucibus leo, imperdiet facilisis nisi. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed sit amet velit eu felis rhoncus placerat vel rutrum ante. Donec luctus urna quis nulla porta vestibulum. Vivamus ac lacinia odio.',
];
);
/**
* Page break trigger.
......@@ -37,27 +37,27 @@ class PostFilters extends WP_UnitTestCase {
/**
* Prepare data for tests.
*/
public function setUp(): void {
public function setUp() {
parent::setUp();
static::$post_id = $this->factory->post->create(
[
array(
'post_title' => 'Pagination Test',
'post_status' => 'publish',
'post_date' => '2019-01-01 00:01:01',
'post_content' => implode( static::$page_break, static::$pages_content ),
]
)
);
}
/**
* Test retrieving page 1 content.
*/
public function test_view_page_1(): void {
public function test_view_page_1() {
query_posts(
[
array(
'p' => static::$post_id,
]
)
);
$this->assertTrue( have_posts() );
......@@ -72,12 +72,12 @@ class PostFilters extends WP_UnitTestCase {
/**
* Test retrieving page 2 content.
*/
public function test_view_page_2(): void {
public function test_view_page_2() {
query_posts(
[
array(
'p' => static::$post_id,
'page' => 2,
]
)
);
$this->assertTrue( have_posts() );
......@@ -92,12 +92,12 @@ class PostFilters extends WP_UnitTestCase {
/**
* Test retrieving page 3 content.
*/
public function test_view_page_3(): void {
public function test_view_page_3() {
query_posts(
[
array(
'p' => static::$post_id,
'page' => 3,
]
)
);
$this->assertTrue( have_posts() );
......@@ -112,12 +112,12 @@ class PostFilters extends WP_UnitTestCase {
/**
* Test retrieving "view all" contents.
*/
public function test_view_all(): void {
public function test_view_all() {
query_posts(
[
array(
'p' => static::$post_id,
'view-all' => true,
]
)
);
$this->assertTrue( have_posts() );
......
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