diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 40c53b76bbfcdb3b614b4ff21a13d2a52de56d50..9d4d5b943af8e389cd44868ba10673a273649eb0 100755 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -20,10 +20,45 @@ before_script: 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:PHP5.3:MySQL: + stage: test + image: containers.ethitter.com:443/docker/images/php:5.3 + services: + - mysql:5.6 + script: + - find . -type "f" -iname "*.php" | xargs -L "1" php -l + - phpunit + allow_failure: true + +PHPunit:PHP5.6:MySQL: + stage: test + image: containers.ethitter.com:443/docker/images/php:5.6 + services: + - mysql:5.6 + script: + - find . -type "f" -iname "*.php" | xargs -L "1" php -l + - phpunit + allow_failure: true + +PHPunit:PHP7.0:MySQL: + stage: test + image: containers.ethitter.com:443/docker/images/php:7.0 + services: + - mysql:5.6 + script: + - find . -type "f" -iname "*.php" | xargs -L "1" php -l + - phpunit + allow_failure: true + +PHPunit:PHP7.1:MySQL: + stage: test + image: containers.ethitter.com:443/docker/images/php:7.1 + services: + - mysql:5.6 + script: + - find . -type "f" -iname "*.php" | xargs -L "1" php -l + - phpunit + allow_failure: true PHPunit:PHP7.2:MySQL: stage: test @@ -32,7 +67,6 @@ PHPunit:PHP7.2:MySQL: - mysql:5.6 script: - find . -type "f" -iname "*.php" | xargs -L "1" php -l - - phpcs -n - phpunit allow_failure: true @@ -43,13 +77,22 @@ PHPunit:PHP7.3:MySQL: - mysql:5.6 script: - find . -type "f" -iname "*.php" | xargs -L "1" php -l - - phpcs -n - phpunit allow_failure: true +PHPCS: + stage: test + image: containers.ethitter.com:443/docker/images/php:7.3 + before_script: + - 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 + script: + - phpcs -n + PluginSVN: stage: deploy - image: containers.ethitter.com:443/docker/images/php:7.3 + image: containers.ethitter.com:443/docker/wp-org-plugin-deploy:latest 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 diff --git a/tests/test-plugin.php b/tests/test-plugin.php index f74470b3d915d7df563327a20527332c0facbaf1..16374198eb692ad5f35d88f19bdaf0d28a0aefb9 100755 --- a/tests/test-plugin.php +++ b/tests/test-plugin.php @@ -78,27 +78,4 @@ class PluginTest extends WP_UnitTestCase { $this->assertNull( $redirect, 'Failed to assert that redirect is not generated for unsupported post status.' ); } - - /** - * Indirect test of redirection. - */ - public function test_published_post_redirect_through_artifacts(): void { - add_filter( 'eth_simple_shortlinks_verify_requested_post_support', function( $verify ) { - $this->assertEquals( static::$post_id_published, get_query_var( 'p' ), 'Failed to assert that requested post ID matches ID of published post.' ); - - return $verify; - } ); - - add_filter( 'eth_simple_shortlinks_redirect_url', function( $url ) { - $this->assertEquals( get_permalink( static::$post_id_published ), $url, 'Failed to assert that redirect URL is published post\'s permalink.' ); - - return $url; - } ); - - $this->go_to( wp_get_shortlink( static::$post_id_published ) ); - - $this->assertQueryTrue( - 'is_404' - ); - } }