Skip to content

Commit

Permalink
Add travis file and tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
fumikito committed Jun 13, 2019
1 parent 737e670 commit c515cae
Show file tree
Hide file tree
Showing 7 changed files with 113 additions and 68 deletions.
87 changes: 35 additions & 52 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,65 +1,48 @@
sudo: false
dist: trusty

language: php

notifications:
email:
on_success: never
on_failure: change

branches:
only:
- master

- master
- "/^v?[0-9\\.]+$/"
cache:
directories:
- $HOME/.composer/cache

matrix:
include:
- php: 7.2
env: WP_VERSION=latest
- php: 7.1
env: WP_VERSION=latest
- php: 7.0
env: WP_VERSION=latest
- php: 5.6
env: WP_VERSION=latest
- php: 5.6
env: WP_VERSION=trunk
- php: 5.6
env: WP_TRAVISCI=phpcs
- php: 5.3
env: WP_VERSION=latest
dist: precise

- "$HOME/.composer/cache"
php:
- 5.6
- 7.0
env:
- WP_VERSION=latest WP_MULTISITE=0
- WP_VERSION=4.9 WP_MULTISITE=0
- WP_VERSION=5.0 WP_MULTISITE=0
before_script:
- export PATH="$HOME/.composer/vendor/bin:$PATH"
- |
if [ -f ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini ]; then
phpenv config-rm xdebug.ini
else
echo "xdebug.ini does not exist"
fi
- |
if [[ ! -z "$WP_VERSION" ]] ; then
bash bin/install-wp-tests.sh wordpress_test root '' localhost $WP_VERSION
composer global require "phpunit/phpunit=4.8.*|5.7.*"
fi
- |
if [[ "$WP_TRAVISCI" == "phpcs" ]] ; then
composer global require wp-coding-standards/wpcs
phpcs --config-set installed_paths $HOME/.composer/vendor/wp-coding-standards/wpcs
fi
- composer install
- curl -s -o $HOME/.nvm/nvm.sh https://raw.githubusercontent.com/creationix/nvm/v0.31.0/nvm.sh
- source $HOME/.nvm/nvm.sh
- nvm install v10.13.0
- node --version
- npm install && npm run package
- bash bin/install-wp-tests.sh wordpress_test root '' localhost $WP_VERSION
script:
- |
if [[ ! -z "$WP_VERSION" ]] ; then
phpunit
WP_MULTISITE=1 phpunit
fi
- |
if [[ "$WP_TRAVISCI" == "phpcs" ]] ; then
phpcs
fi
- composer test
before_deploy:
- composer install --no-dev
- rm -rf .git
- "curl -L https://raw.githubusercontent.com/fumikito/wp-readme/master/wp-readme.php | php"
- rm -rf {tests,assets,bin,node_modules,.git,phpunit.xml.dist,.gitignore,.travis.yml,phpunit.xml.dist,README.md,composer.lock,package-lock.json,.phpcs.xml.dist.travis.yml}
- sed -i -e "s/nightly/${TRAVIS_TAG}/" readme.txt
- sed -i -e "s/nightly/${TRAVIS_TAG}/" $(basename $TRAVIS_REPO_SLUG).php
- zip -r hiden-$TRAVIS_TAG.zip ./
deploy:
provider: releases
api_key:
secure: hwK3iqs89CvYAxWmp88379PG53mIvG7RS3kKKBQ9LrSPqCOi5nOMk3S9HYj14dqCFpu1nbYnXC4v1AzIoNWbYKkUQuCbYgAOYsYHB5BxiDNl2u2RtQRjA6is5rSXK5U3gagT3/yFcM0+vdJuFjMwSjwPsoEEi+wcCT31SANM1HA2Ypbvp3zVP1KzootE0pKmNBmwJQFHQ1/I56ObR72M5m0VwGriUVx7/FJU7CTUh/R00AeGsWGBSlXS8srPeVpI41JS48GmNkS+fGrteOyckiho38o8EkZg8oH0D+OpHRI8QqX0Ckj3cVUj3EOED8narFyAoCKHiH/+R1Tl2EwLzM7DSCHOEuf36+bZSP4eCARmodFWeoyP5rtO3/Yox8QtOQ8PHIfoMLGcOa4pVX4jYmnRDB0xfRvgKO+WXXKpqNfxCrYT361IL4Q4uqoYBIl2MYw9atuuXZU7ssdm7adz7ewnGfB6kn+nH1k8kWuDG9FWXicZ9YAcLhnW8b9Ciuv1P0mIThCpBIJSK2k0L0yzD2XtDV0uS+mMxNhLo9sPJWhIqJ50qyCZgQmxlbED9KFSXcq1z5CBgz2qm92idBnJwTa8KsQGpPAxvrsdn1gKtDDOJXpMaveOcTBBC5fxWO2c08emOVT1sRBw2Wu9PZKGBE2JWO0UXL5EWJwJHTZg+6A=
file: hiden-$TRAVIS_TAG.zip
skip_cleanup: true
on:
repo: kuno1/hiden
tags: true
39 changes: 37 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,37 @@
# hiden
A repository manager for kunoiciwp.com
# Hiden

Contributors: kunoichi,Takahashi_Fumiki
Donate link: https://kunoichiwp.com/product/plugin/hiden
Tags: plugin, theme, updater
Requires at least: 4.9
Tested up to: 5.2.1
Stable tag: nightly
License: GPLv3 or later
License URI: https://www.gnu.org/licenses/gpl-3.0.html

A auto updater for [Kunoichi WP Marketplace(kunoiciwp.com).

## Description

This plugin integrates WordPress updater with [Kunoichi WP Marketplace](https://kunoichiwp.com).

Just install and activate, your can update all of our products.

### Current Status

* Plugin updater

## Installation

1. Download this plugin's zip file `hiden-x.x.x.zip`.
2. Go to WordPress admin screen "Plugins > Add New". You will find upload button just after title text.
3. Click the button and open an uploader, then upload zip file.
4. After finishing install, activate it.

After activation, API key is required. You can get one at [Kunoichi my account](https://kunoichiwp.com/my-account/license/).

If the license is valid, you can update plugins and themes.

## Supports

Please visit our [support forum](https://kunoichiwp.com/product/plugin/hiden).
3 changes: 3 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
],
"minimum-stability": "stable",
"require": {},
"scripts": {
"test": "phpunit"
},
"require-dev": {
"phpunit/phpunit": "^6"
},
Expand Down
6 changes: 3 additions & 3 deletions hiden.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php
/**
Plugin Name: Hiden
Plugin URI: https://kunoichiwp.com/product/hiden
Plugin URI: https://kunoichiwp.com/product/plugin/hiden
Description: Plugin and theme updater for kunoichi.
Version: 1.0.0
PHP Version: 5.4
Version: nightly
PHP Version: 5.6
Author: Kunoichi INC.
Author URI: https://kunoichiwp.com
License: GPL 3.0 or later
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
},
"repository": {
"type": "git",
"url": ""
"url": "https://github.com/kuno1/hiden"
},
"keywords": [],
"author": "",
"keywords": [ "wordpress", "wordpress-plugin" ],
"author": "Kunoichi INC <[email protected]>",
"license": "GPL-3.0-or-later",
"bugs": {
"url": ""
"url": "https://github.com/kuno1/hiden/issues"
},
"homepage": "https://kunoichiwp.com",
"devDependencies": {
Expand Down
28 changes: 28 additions & 0 deletions tests/test-plugins.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

/**
* Test plugins api.
*
* @property-read \Kunoichi\Hiden\API\Plugins $plugins
*/
class PluginsTest extends WP_UnitTestCase {

/**
* Test list functions.
*/
public function test_list() {
// Test list.
$this->assertInstanceOf( 'WP_Error', $this->plugins->get_plugin_list( [] ) );
}

function __get( $name ) {
switch ( $name ) {
case 'plugins':
return \Kunoichi\Hiden\API\Plugins::get_instance();
default:
return parent::__get( $name ); // TODO: Change the autogenerated stub
}
}


}
10 changes: 3 additions & 7 deletions tests/test-sample.php → tests/test-utilities.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
<?php
/**
* Class SampleTest
*
* @package Hiden
*/

/**
* Sample test case.
* Utilities test case
* @package hiden
*/
class SampleTest extends WP_UnitTestCase {
class UtilitiesTest extends WP_UnitTestCase {

/**
* A single example test.
Expand Down

0 comments on commit c515cae

Please sign in to comment.