Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
shira-374 committed Sep 19, 2018
1 parent ed015e0 commit ab07fa3
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 17 deletions.
17 changes: 15 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,40 @@
language: php

env:
global:
- COMPOSER_ROOT_VERSION=1.99.99

matrix:
include:
- name: 7.1 (tests)
php: '7.1'
env:
- INSTALL_COMMAND="composer install"
- MAIN_COMMAND="composer tests"

- name: 7.2 (tests)
- name: 7.2 (all)
php: '7.2'
env:
- INSTALL_COMMAND="composer install"
- MAIN_COMMAND="composer all"

- name: 7.2 (tests, lowest deps)
php: '7.2'
env:
- INSTALL_COMMAND="composer update --prefer-lowest --prefer-stable"
- MAIN_COMMAND="composer tests"

- name: nightly (tests)
php: nightly
env:
- INSTALL_COMMAND="composer install"
- MAIN_COMMAND="composer tests"

allow_failures:
- php: nightly

fast_finish: true

install: ${INSTALL_COMMAND}

script: ./vendor/bin/phpunit --colors
script: ${MAIN_COMMAND}
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ Composer plugin that provides a way for packages to expose custom scripts
to the root project. These scripts work similarly to the root-only
scripts_ option.

.. image:: https://travis-ci.org/kuria/composer-pkg-scripts.svg?branch=master
:target: https://travis-ci.org/kuria/composer-pkg-scripts
.. image:: https://travis-ci.com/kuria/composer-pkg-scripts.svg?branch=master
:target: https://travis-ci.com/kuria/composer-pkg-scripts

.. contents::
:depth: 2
Expand Down
11 changes: 10 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
"require-dev": {
"composer/composer": "^1.6",
"phpunit/phpunit": "^7.2.5"
"kuria/dev-meta": "^0.5"
},
"autoload": {
"psr-4": {
Expand All @@ -25,5 +25,14 @@
},
"extra": {
"class": "Kuria\\ComposerPkgScripts\\Plugin"
},
"scripts": {
"all": ["@cs", "@tests"],
"tests": "phpunit --colors=always",
"cs": [
"phpcs '--standard=./vendor/kuria/dev-meta/src/CodeSniffer/ruleset.xml' -p -s --colors src tests",
"phpstan analyze --ansi --configuration=./vendor/kuria/dev-meta/conf/phpstan-src.neon src",
"phpstan analyze --ansi --configuration=./vendor/kuria/dev-meta/conf/phpstan-tests.neon tests"
]
}
}
5 changes: 2 additions & 3 deletions tests/Capability/ScriptCommandProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,15 @@
namespace Kuria\ComposerPkgScripts\Capability;

use Composer\Command\ScriptAliasCommand;
use Composer\Package\PackageInterface;
use Kuria\ComposerPkgScripts\Command\DumpPackageScriptsCommand;
use Kuria\ComposerPkgScripts\Command\ListPackageScriptsCommand;
use Kuria\ComposerPkgScripts\Plugin;
use Kuria\ComposerPkgScripts\Script\Script;
use Kuria\ComposerPkgScripts\Script\ScriptManager;
use PHPUnit\Framework\TestCase;
use Kuria\DevMeta\Test;
use Symfony\Component\Console\Command\Command;

class ScriptCommandProviderTest extends TestCase
class ScriptCommandProviderTest extends Test
{
function testShouldGetCommands()
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Script/ScriptCompilerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
namespace Kuria\ComposerPkgScripts\Script;

use Kuria\ComposerPkgScripts\Exception\ScriptCompilerException;
use PHPUnit\Framework\TestCase;
use Kuria\DevMeta\Test;

class ScriptCompilerTest extends TestCase
class ScriptCompilerTest extends Test
{
/** @var ScriptCompiler */
private $compiler;
Expand Down
4 changes: 2 additions & 2 deletions tests/Script/ScriptLoaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

use Composer\Package\PackageInterface;
use Composer\Package\RootPackageInterface;
use PHPUnit\Framework\TestCase;
use Kuria\DevMeta\Test;

class ScriptLoaderTest extends TestCase
class ScriptLoaderTest extends Test
{
function testShouldLoadScriptsAndVariables()
{
Expand Down
5 changes: 2 additions & 3 deletions tests/Script/ScriptManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@
use Composer\Composer;
use Composer\Config;
use Composer\Package\CompletePackage;
use Composer\Package\PackageInterface;
use Composer\Package\RootPackageInterface;
use Composer\Repository\RepositoryManager;
use Composer\Repository\WritableRepositoryInterface;
use PHPUnit\Framework\TestCase;
use Kuria\DevMeta\Test;

class ScriptManagerTest extends TestCase
class ScriptManagerTest extends Test
{
function testShouldRegisterScripts()
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Script/ScriptTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace Kuria\ComposerPkgScripts\Script;

use PHPUnit\Framework\TestCase;
use Kuria\DevMeta\Test;

class ScriptTest extends TestCase
class ScriptTest extends Test
{
function testShouldCreateScript()
{
Expand Down

0 comments on commit ab07fa3

Please sign in to comment.