Skip to content

Commit 56b9f81

Browse files
authored
Merge pull request #483 from szepeviktor/fix/ci
Fix include CI jobs
2 parents 9b6cd7c + e6b4919 commit 56b9f81

File tree

4 files changed

+39
-18
lines changed

4 files changed

+39
-18
lines changed

.travis.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,24 @@ jobs:
2525
dist: xenial
2626
env:
2727
- WP_VERSION=latest WP_MULTISITE=0 PHPUNIT_VERSION="^5.6"
28+
- php: 7.0
29+
dist: xenial
30+
env:
2831
- WP_VERSION=latest WP_MULTISITE=1 PHPUNIT_VERSION="^5.6"
2932
- php: 5.6
3033
dist: xenial
3134
env:
3235
- WP_VERSION=latest WP_MULTISITE=0 PHPUNIT_VERSION="4.8.*"
36+
- php: 5.6
37+
dist: xenial
38+
env:
3339
- WP_VERSION=latest WP_MULTISITE=1 PHPUNIT_VERSION="4.8.*"
3440
- name: "Coding Standars"
3541
php: 7.4
3642
install:
3743
- composer require --dev wp-coding-standards/wpcs dealerdirect/phpcodesniffer-composer-installer
44+
# Counter wp-enforcer
45+
- rm -f ./phpcs.xml
3846
script:
3947
- vendor/bin/phpcs
4048
- name: "Static Analysis"
@@ -54,11 +62,6 @@ cache:
5462
directories:
5563
- "${HOME}/.composer/cache"
5664

57-
before_install:
58-
- composer remove --dev stevegrunwell/wp-enforcer
59-
# Shim Composer's post-install-cmd script
60-
- install -T /dev/null vendor/bin/wp-enforcer
61-
6265
install:
6366
- bin/install-wp-tests.sh wordpress_test root "" localhost "${WP_VERSION}"
6467
- composer global require --dev "phpunit/phpunit=${PHPUNIT_VERSION}"

class-wp-bootstrap-navwalker.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,8 @@ public static function fallback( $args ) {
376376

377377
// if $args has 'echo' key and it's true echo, otherwise return.
378378
if ( array_key_exists( 'echo', $args ) && $args['echo'] ) {
379-
echo $fallback_output; // WPCS: XSS OK.
379+
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
380+
echo $fallback_output;
380381
} else {
381382
return $fallback_output;
382383
}

phpstan.neon.dist

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ parameters:
77
checkMissingIterableValueType: false
88
paths:
99
- class-wp-bootstrap-navwalker.php
10-
autoload_files:
10+
scanFiles:
1111
- tests/phpstan/class-wp-nav-menu-args.php
1212
- tests/phpstan/class-wp-nav-menu-item.php
1313
- class-wp-bootstrap-navwalker.php
@@ -22,3 +22,7 @@ parameters:
2222
-
2323
message: '#^Method WP_Bootstrap_Navwalker::(start_lvl|start_el)\(\) has no return typehint specified\.$#'
2424
path: class-wp-bootstrap-navwalker.php
25+
# Uncertain properties.
26+
-
27+
message: '#^Property WP_Nav_Menu_Args::\$\S+ \(string\) in isset\(\) is not nullable\.$#'
28+
path: class-wp-bootstrap-navwalker.php

tests/test-navwalker.php

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,17 @@ public function setUp() {
3939
$this->valid_linkmod_typeflags = array(
4040
'dropdown-header',
4141
'dropdown-divider',
42-
'dropdown-item-text'
42+
'dropdown-item-text',
4343
);
4444

4545
// array of all possible linkmods, including the valid typeflags.
46-
$this->valid_linkmod_classes = array_merge( $this->valid_linkmod_typeflags, array(
47-
'disabled',
48-
'sr-only',
49-
) );
46+
$this->valid_linkmod_classes = array_merge(
47+
$this->valid_linkmod_typeflags,
48+
array(
49+
'disabled',
50+
'sr-only',
51+
)
52+
);
5053

5154
// array of valid font-awesome icon class starters plus some randomly
5255
// chosen icon classes and some variations of upper/lower case letters.
@@ -186,9 +189,14 @@ public function test_fallback_function_output_loggedout() {
186189
);
187190

188191
// set 'echo' to false and request the markup returned.
189-
$fallback_output_return = WP_Bootstrap_Navwalker::fallback( array_merge( $this->valid_sample_fallback_args, array(
190-
'echo' => false,
191-
) ) );
192+
$fallback_output_return = WP_Bootstrap_Navwalker::fallback(
193+
array_merge(
194+
$this->valid_sample_fallback_args,
195+
array(
196+
'echo' => false,
197+
)
198+
)
199+
);
192200

193201
// return and echo should result in the same values (both empty).
194202
$this->assertEquals(
@@ -227,9 +235,14 @@ public function test_fallback_function_output_loggedin() {
227235
);
228236

229237
// set 'echo' to false and request the markup returned.
230-
$fallback_output_return = WP_Bootstrap_Navwalker::fallback( array_merge( $this->valid_sample_fallback_args, array(
231-
'echo' => false,
232-
) ) );
238+
$fallback_output_return = WP_Bootstrap_Navwalker::fallback(
239+
array_merge(
240+
$this->valid_sample_fallback_args,
241+
array(
242+
'echo' => false,
243+
)
244+
)
245+
);
233246

234247
// return and echo should both produce the same strings.
235248
$this->assertEquals(

0 commit comments

Comments
 (0)