@@ -10,10 +10,10 @@ language: php
1010
1111# Declare versions of PHP to use. Use one decimal max.
1212php :
13- - " 7.3"
14- - "7.2"
15- - " 7.0"
16- - " 5.6"
13+ - " 7.3"
14+ - " 7.2"
15+ - " 7.0"
16+ - " 5.6"
1717
1818# Ditch sudo and use containers.
1919# @link http://docs.travis-ci.com/user/migrating-from-legacy/#Why-migrate-to-container-based-infrastructure%3F
@@ -23,71 +23,71 @@ sudo: false
2323# Declare which versions of WordPress to test against.
2424# Also declare whether or not to test in Multisite.
2525env :
26- # Trunk (current version in development is 4.7)
27- # @link https://github.com/WordPress/WordPress
28- - WP_VERSION=master WP_MULTISITE=0
26+ # Trunk (current version in development is 4.7)
27+ # @link https://github.com/WordPress/WordPress
28+ - WP_VERSION=master WP_MULTISITE=0
2929
3030# Use this to prepare your build for testing.
3131# e.g. copy database configurations, environment variables, etc.
3232# Failures in this section will result in build status 'errored'.
3333before_script :
34- # Set up WordPress installation.
35- - export WP_DEVELOP_DIR=/tmp/wordpress/
36- - mkdir -p $WP_DEVELOP_DIR
37- # Use the Git mirror of WordPress.
38- - git clone --depth=1 --branch="$WP_VERSION" git://develop.git.wordpress.org/ $WP_DEVELOP_DIR
39- # Set up Twenty Seventeen theme information.
40- - theme_slug=$(basename $(pwd))
41- - theme_dir=$WP_DEVELOP_DIR/src/wp-content/themes/$theme_slug
42- - cd ..
43- - mv $theme_slug $theme_dir
44- # Set up WordPress configuration.
45- - cd $WP_DEVELOP_DIR
46- - echo $WP_DEVELOP_DIR
47- - cp wp-tests-config-sample.php wp-tests-config.php
48- - sed -i "s/youremptytestdbnamehere/wordpress_test/" wp-tests-config.php
49- - sed -i "s/yourusernamehere/root/" wp-tests-config.php
50- - sed -i "s/yourpasswordhere//" wp-tests-config.php
51- # Create WordPress database.
52- - mysql -e 'CREATE DATABASE wordpress_test;' -uroot
53- # Install CodeSniffer for WordPress Coding Standards checks.
54- - mkdir php-codesniffer && curl -L https://github.com/squizlabs/PHP_CodeSniffer/archive/2.7.0.tar.gz | tar xz --strip-components=1 -C php-codesniffer
55- # Install WordPress Coding Standards.
56- - mkdir wordpress-coding-standards && curl -L https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/archive/0.10.0.tar.gz | tar xz --strip-components=1 -C wordpress-coding-standards
57- # Hop into CodeSniffer directory.
58- - cd php-codesniffer
59- # Set install path for WordPress Coding Standards
60- # @link https://github.com/squizlabs/PHP_CodeSniffer/blob/4237c2fc98cc838730b76ee9cee316f99286a2a7/CodeSniffer.php#L1941
61- - scripts/phpcs --config-set installed_paths ../wordpress-coding-standards
62- # Hop into themes directory.
63- - cd $theme_dir
64- # After CodeSniffer install you should refresh your path.
65- - phpenv rehash
66- # Install JSCS: JavaScript Code Style checker
67- # @link http://jscs.info/
68- - npm install -g jscs
69- # Install JSHint, a JavaScript Code Quality Tool
70- # @link http://jshint.com/docs/
71- - npm install -g jshint
72- - wget https://develop.svn.wordpress.org/trunk/.jshintrc
34+ # Set up WordPress installation.
35+ - export WP_DEVELOP_DIR=/tmp/wordpress/
36+ - mkdir -p $WP_DEVELOP_DIR
37+ # Use the Git mirror of WordPress.
38+ - git clone --depth=1 --branch="$WP_VERSION" git://develop.git.wordpress.org/ $WP_DEVELOP_DIR
39+ # Set up Twenty Seventeen theme information.
40+ - theme_slug=$(basename $(pwd))
41+ - theme_dir=$WP_DEVELOP_DIR/src/wp-content/themes/$theme_slug
42+ - cd ..
43+ - mv $theme_slug $theme_dir
44+ # Set up WordPress configuration.
45+ - cd $WP_DEVELOP_DIR
46+ - echo $WP_DEVELOP_DIR
47+ - cp wp-tests-config-sample.php wp-tests-config.php
48+ - sed -i "s/youremptytestdbnamehere/wordpress_test/" wp-tests-config.php
49+ - sed -i "s/yourusernamehere/root/" wp-tests-config.php
50+ - sed -i "s/yourpasswordhere//" wp-tests-config.php
51+ # Create WordPress database.
52+ - mysql -e 'CREATE DATABASE wordpress_test;' -uroot
53+ # Install CodeSniffer for WordPress Coding Standards checks.
54+ - mkdir php-codesniffer && curl -L https://github.com/squizlabs/PHP_CodeSniffer/archive/2.7.0.tar.gz | tar xz --strip-components=1 -C php-codesniffer
55+ # Install WordPress Coding Standards.
56+ - mkdir wordpress-coding-standards && curl -L https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/archive/0.10.0.tar.gz | tar xz --strip-components=1 -C wordpress-coding-standards
57+ # Hop into CodeSniffer directory.
58+ - cd php-codesniffer
59+ # Set install path for WordPress Coding Standards
60+ # @link https://github.com/squizlabs/PHP_CodeSniffer/blob/4237c2fc98cc838730b76ee9cee316f99286a2a7/CodeSniffer.php#L1941
61+ - scripts/phpcs --config-set installed_paths ../wordpress-coding-standards
62+ # Hop into themes directory.
63+ - cd $theme_dir
64+ # After CodeSniffer install you should refresh your path.
65+ - phpenv rehash
66+ # Install JSCS: JavaScript Code Style checker
67+ # @link http://jscs.info/
68+ - npm install -g jscs
69+ # Install JSHint, a JavaScript Code Quality Tool
70+ # @link http://jshint.com/docs/
71+ - npm install -g jshint
72+ - wget https://develop.svn.wordpress.org/trunk/.jshintrc
7373
7474# Run test script commands.
7575# Default is specific to project language.
7676# All commands must exit with code 0 on success. Anything else is considered failure.
7777script :
78- # Search theme for PHP syntax errors.
79- - find . \( -name '*.php' \) -exec php -lf {} \;
80- # Run the theme through JSHint
81- - jshint .
82- # Run the theme through JavaScript Code Style checker
83- - jscs .
84- # WordPress Coding Standards
85- # @link https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards
86- # @link http://pear.php.net/package/PHP_CodeSniffer/
87- # -p flag: Show progress of the run.
88- # -s flag: Show sniff codes in all reports.
89- # -v flag: Print verbose output.
90- # -n flag: Do not print warnings (shortcut for --warning-severity=0)
91- # --standard: Use WordPress as the standard.
92- # --extensions: Only sniff PHP files.
93- - $WP_DEVELOP_DIR/php-codesniffer/scripts/phpcs -p -s -v -n . --standard=./codesniffer.ruleset.xml --extensions=php --ignore=*/woocommerce/*,*/src/*
78+ # Search theme for PHP syntax errors.
79+ - find . \( -name '*.php' \) -exec php -lf {} \;
80+ # Run the theme through JSHint
81+ - jshint .
82+ # Run the theme through JavaScript Code Style checker
83+ - jscs .
84+ # WordPress Coding Standards
85+ # @link https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards
86+ # @link http://pear.php.net/package/PHP_CodeSniffer/
87+ # -p flag: Show progress of the run.
88+ # -s flag: Show sniff codes in all reports.
89+ # -v flag: Print verbose output.
90+ # -n flag: Do not print warnings (shortcut for --warning-severity=0)
91+ # --standard: Use WordPress as the standard.
92+ # --extensions: Only sniff PHP files.
93+ - $WP_DEVELOP_DIR/php-codesniffer/scripts/phpcs -p -s -v -n . --standard=./codesniffer.ruleset.xml --extensions=php --ignore=*/woocommerce/*,*/src/*
0 commit comments