Skip to content

Commit

Permalink
Merge a1da3bf into 402243d
Browse files Browse the repository at this point in the history
  • Loading branch information
aaemnnosttv committed Jul 7, 2018
2 parents 402243d + a1da3bf commit c09807b
Show file tree
Hide file tree
Showing 7 changed files with 120 additions and 165 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Expand Up @@ -8,5 +8,8 @@ charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.yml]
indent_size = 2

[*.md]
trim_trailing_whitespace = false
70 changes: 37 additions & 33 deletions .travis.yml
@@ -1,32 +1,36 @@
language: php

env:
global:
- WP_DB_USER=wp
- WP_DB_PASS=password
- WP_DB_NAME=wp_tests

matrix:
include:
- php: 7.2
env: WP_VERSION=*
- php: 7.1
env: WP_VERSION=*
- php: 7.0
env: WP_VERSION=* BUILD_DOCS=1
- php: 5.6
env: WP_VERSION=4.5.3
env: WP_VERSION=*
- php: 5.6
env: WP_VERSION=latest

- php: 7.0
env: WP_VERSION=latest
- php: 7.0
env: WP_VERSION=trunk

- php: 7.1
env: WP_VERSION=latest

- php: 7.2
env: WP_VERSION=latest
env: WP_VERSION=4.5.3

before_install:
- composer self-update --stable
- composer validate --strict
- composer validate --strict

install: composer install
install:
- composer install
- composer require --dev --update-with-dependencies johnpbloch/wordpress:$WP_VERSION wp-phpunit/wp-phpunit:$WP_VERSION
- composer show

before_script:
- bash tests/bin/install-wp-tests.sh wordpress_test root '' localhost $WP_VERSION
- mkdir -p build/logs
- mysql -u root -e "GRANT ALL PRIVILEGES ON ${WP_DB_NAME}.* TO ${WP_DB_USER} IDENTIFIED BY '${WP_DB_PASS}';"
- mysql -u root -e "CREATE DATABASE ${WP_DB_NAME};"
- mkdir -p build/logs

script: composer test

Expand All @@ -35,24 +39,24 @@ after_success: travis_retry composer coverage -- -v
before_deploy: bash build/bin/build-docs.sh

deploy:
provider: s3
access_key_id: AKIAIUOEMT3YXWAPTEJA
secret_access_key:
secure: Wqmlzs52YkR3mzmW4tvFSFincFyiJnFJvtpxsiP7wdbOqefjYiZlF5jCn6rpXvwfm3OUSFzplSDzeWUKbHjPPDkIP82Zk6jbdFPHqDurkoBdfdkIkD/X/yfQsMTDVfchRZbWaNj/+IiykuHBDkljvhbaZtepODJMIkBjkZom4Yb3pjOUARgBGy2gtI4WhaVyg4oZ1Xm0o4S6i5AUGxIZjOBfCwePhsioEZFDsaV8QVWfa7K3ttlJtpGFDLhFzB29mMVXLWbTc8I7DoEu8ghJ0bq2ilO/dRxqy3IZN7ZkLockKbg+UM4xyp/b+yQtIvmN5DMM2m3aswyz8snLqrhtKRE1QjH4/UJUunLkvn79UotXm6Vl9HTnDYG5DimsMOGxVGEuWUsY/pN0tRqPA9HGjSqOeEzgj+OjOIlUssv/E1+5+OYtpBGOnvl6tzyAffQdhdhJ+wZgOsLs9U5zRnp+t3+TAvfN6+SPmG/SQX0T7mRIZNVhICH9p/gpqjtljBJy724Xx/ZquW/tkFLB6X/M97p4OBEtX+MvwCE0L/lV2/uT2fZV3BqdYYX7fCakpWVwEA7c2pxW8VyjZf97iindxh9HQrGAu7QT3lOGyIRYsCfWgfC4yPJcMWjJZj6d5uQvVrJtMOQzVo4y9HQ9b0iXe9LYQrjdLa4xBDgLatZw2W8=
bucket: api.silk.aaemnnost.tv
acl: public_read
skip_cleanup: true
local_dir: ../silk-api-docs
on:
branch: master
php: 7.0
condition: $WP_VERSION = latest
provider: s3
access_key_id: AKIAIUOEMT3YXWAPTEJA
secret_access_key:
secure: Wqmlzs52YkR3mzmW4tvFSFincFyiJnFJvtpxsiP7wdbOqefjYiZlF5jCn6rpXvwfm3OUSFzplSDzeWUKbHjPPDkIP82Zk6jbdFPHqDurkoBdfdkIkD/X/yfQsMTDVfchRZbWaNj/+IiykuHBDkljvhbaZtepODJMIkBjkZom4Yb3pjOUARgBGy2gtI4WhaVyg4oZ1Xm0o4S6i5AUGxIZjOBfCwePhsioEZFDsaV8QVWfa7K3ttlJtpGFDLhFzB29mMVXLWbTc8I7DoEu8ghJ0bq2ilO/dRxqy3IZN7ZkLockKbg+UM4xyp/b+yQtIvmN5DMM2m3aswyz8snLqrhtKRE1QjH4/UJUunLkvn79UotXm6Vl9HTnDYG5DimsMOGxVGEuWUsY/pN0tRqPA9HGjSqOeEzgj+OjOIlUssv/E1+5+OYtpBGOnvl6tzyAffQdhdhJ+wZgOsLs9U5zRnp+t3+TAvfN6+SPmG/SQX0T7mRIZNVhICH9p/gpqjtljBJy724Xx/ZquW/tkFLB6X/M97p4OBEtX+MvwCE0L/lV2/uT2fZV3BqdYYX7fCakpWVwEA7c2pxW8VyjZf97iindxh9HQrGAu7QT3lOGyIRYsCfWgfC4yPJcMWjJZj6d5uQvVrJtMOQzVo4y9HQ9b0iXe9LYQrjdLa4xBDgLatZw2W8=
bucket: api.silk.aaemnnost.tv
acl: public_read
skip_cleanup: true
local_dir: ../silk-api-docs
on:
branch: master
php: 7.0
condition: $BUILD_DOCS

cache:
directories:
- vendor

notifications:
email:
on_success: never
on_failure: change
email:
on_success: never
on_failure: change
12 changes: 10 additions & 2 deletions composer.json
Expand Up @@ -20,9 +20,11 @@
"tightenco/collect": "^5.4"
},
"require-dev": {
"phpunit/phpunit": "^5.0",
"johnpbloch/wordpress": "^4.9",
"mockery/mockery": "^0.9.5",
"satooshi/php-coveralls": "^1.0"
"phpunit/phpunit": "^5.0",
"satooshi/php-coveralls": "^1.0",
"wp-phpunit/wp-phpunit": "^4.9"
},
"autoload": {
"psr-4": {"Silk\\":"src"},
Expand All @@ -36,5 +38,11 @@
"scripts": {
"test": "phpunit",
"coverage": "coveralls"
},
"config": {
"sort-packages": true,
"platform": {
"php": "5.6.36"
}
}
}
4 changes: 4 additions & 0 deletions phpunit.xml.dist
Expand Up @@ -19,4 +19,8 @@
<directory suffix=".php">src</directory>
</whitelist>
</filter>
<php>
<env name="WP_PHPUNIT__TESTS_CONFIG" value="tests/wp-config.php" />
<env name="WP_PHPUNIT__TABLE_PREFIX" value="tests_" />
</php>
</phpunit>
120 changes: 0 additions & 120 deletions tests/bin/install-wp-tests.sh

This file was deleted.

12 changes: 2 additions & 10 deletions tests/bootstrap.php
@@ -1,13 +1,5 @@
<?php

$_tests_dir = getenv( 'WP_TESTS_DIR' );
require_once(dirname(__DIR__) . '/vendor/autoload.php');

if ( ! $_tests_dir ) {
$_tests_dir = '/tmp/wordpress-tests-lib';
}

require_once $_tests_dir . '/includes/functions.php';

require_once realpath(__DIR__ . '/../vendor/autoload.php');

require $_tests_dir . '/includes/bootstrap.php';
require(getenv('WP_PHPUNIT__DIR') . '/includes/bootstrap.php');
64 changes: 64 additions & 0 deletions tests/wp-config.php
@@ -0,0 +1,64 @@
<?php

/* Path to the WordPress codebase you'd like to test. Add a forward slash in the end. */
define( 'ABSPATH', dirname( dirname( __FILE__ ) ) . '/wordpress/' );

/*
* Path to the theme to test with.
*
* The 'default' theme is symlinked from test/phpunit/data/themedir1/default into
* the themes directory of the WordPress installation defined above.
*/
define( 'WP_DEFAULT_THEME', 'default' );

// Test with multisite enabled.
// Alternatively, use the tests/phpunit/multisite.xml configuration file.
// define( 'WP_TESTS_MULTISITE', true );

// Force known bugs to be run.
// Tests with an associated Trac ticket that is still open are normally skipped.
// define( 'WP_TESTS_FORCE_KNOWN_BUGS', true );

// Test with WordPress debug mode (default).
define( 'WP_DEBUG', true );

// ** MySQL settings ** //

// This configuration file will be used by the copy of WordPress being tested.
// wordpress/wp-config.php will be ignored.

// WARNING WARNING WARNING!
// These tests will DROP ALL TABLES in the database with the prefix named below.
// DO NOT use a production database or one that is shared with something else.

define( 'DB_NAME' , getenv( 'WP_DB_NAME' ) ?: 'silk_tests' );
define( 'DB_USER' , getenv( 'WP_DB_USER' ) ?: 'root' );
define( 'DB_PASSWORD' , getenv( 'WP_DB_PASS' ) ?: '' );
define( 'DB_HOST' , 'localhost' );
define( 'DB_CHARSET' , 'utf8' );
define( 'DB_COLLATE' , '' );

/**#@+
* Authentication Unique Keys and Salts.
*
* Change these to different unique phrases!
* You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}
*/
define( 'AUTH_KEY', 'put your unique phrase here' );
define( 'SECURE_AUTH_KEY', 'put your unique phrase here' );
define( 'LOGGED_IN_KEY', 'put your unique phrase here' );
define( 'NONCE_KEY', 'put your unique phrase here' );
define( 'AUTH_SALT', 'put your unique phrase here' );
define( 'SECURE_AUTH_SALT', 'put your unique phrase here' );
define( 'LOGGED_IN_SALT', 'put your unique phrase here' );
define( 'NONCE_SALT', 'put your unique phrase here' );

$table_prefix = 'tests_'; // Only numbers, letters, and underscores please!

define( 'WP_TESTS_DOMAIN', 'example.org' );
define( 'WP_TESTS_EMAIL', 'admin@example.org' );
define( 'WP_TESTS_TITLE', 'Test Blog' );

define( 'WP_PHP_BINARY', 'php' );

define( 'WPLANG', '' );

0 comments on commit c09807b

Please sign in to comment.