Skip to content

Commit

Permalink
Merge pull request #42 from clue-labs/tests
Browse files Browse the repository at this point in the history
Add PHPUnit to require-dev and support legacy PHP 5.3 through PHP 7.2 and HHVM
  • Loading branch information
clue authored Oct 8, 2018
2 parents 1f556d6 + b842bbf commit bda1212
Show file tree
Hide file tree
Showing 4 changed files with 1,020 additions and 19 deletions.
24 changes: 18 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,29 @@
language: php

sudo: false

php:
- 5.3
# - 5.3 # requires old distro, see below
- 5.4
- 5.5
- 5.6
- 7
- hhvm
- 7.0
- 7.1
- 7.2
- hhvm # ignore errors, see below

# lock distro so future defaults will not break the build
dist: trusty

matrix:
include:
- php: 5.3
dist: precise
allow_failures:
- php: hhvm

sudo: false

install:
- composer install --prefer-source --no-interaction

script:
- phpunit --coverage-text
- vendor/bin/phpunit --coverage-text
26 changes: 24 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Graph visualization for your project's `composer.json` and its dependencies:
* [Updating dependency](#updating-dependency)
* [Manual Installation from Source](#manual-installation-from-source)
* [Updating manually](#updating-manually)
* [Tests](#tests)
* [License](#license)

## Usage
Expand Down Expand Up @@ -71,6 +72,11 @@ $ php graph-composer.phar export ~/path/to/your/project

You can grab a copy of clue/graph-composer in either of the following ways.

This project aims to run on any platform and thus does not require any PHP
extensions and supports running on legacy PHP 5.3 through current PHP 7+ and
HHVM.
It's *highly recommended to use PHP 7+* for this project.
### As a phar (recommended)
You can simply download a pre-compiled and ready-to-use version as a Phar
Expand Down Expand Up @@ -175,12 +181,13 @@ You can now verify everything works by running graph-composer like this:
$ php bin/graph-composer show
```

> If you want to build the above mentioned `graph-composer.phar` yourself, you have
> If you want to build the above mentioned `graph-composer.phar` yourself, you
should install this project without its development dependencies and then have
to install [clue/phar-composer](https://github.com/clue/phar-composer#install)
and can simply invoke:
>
> ```bash
> $ php phar-composer.phar build ~/workspace/graph-composer
> $ php composer.phar install --no-dev && php phar-composer.phar build
> ```

#### Updating manually
Expand All @@ -190,6 +197,21 @@ $ git pull
$ php composer.phar install
```

## Tests

To run the test suite, you first need to clone this repo and then install all
dependencies [through Composer](http://getcomposer.org):

```bash
$ composer install
```

To run the test suite, go to the project root and run:

```bash
$ php vendor/bin/phpunit
```

## License

MIT
7 changes: 5 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@
"require": {
"php": "^5.3.6 || ^7.0",
"clue/graph": "^0.9.0",
"graphp/graphviz": "^0.2.0",
"jms/composer-deps-analyzer": "0.1.*",
"symfony/console": "^2.1 || ^3.0",
"graphp/graphviz": "^0.2.0"
"symfony/console": "^3.0 || ^2.1"
},
"require-dev": {
"phpunit/phpunit": "^4.8.36"
},
"autoload": {
"psr-0": { "Clue\\GraphComposer": "src/" }
Expand Down
Loading

0 comments on commit bda1212

Please sign in to comment.