Skip to content
This repository was archived by the owner on Nov 14, 2019. It is now read-only.

Added some integration tests #183

Closed
wants to merge 13 commits into from

Conversation

javiereguiluz
Copy link
Member

In #161 we discussed a bit about integration tests. I know that some people are not very fond of this kind of tests, but the Symfony Installer is a critical piece of our platform and it must always work as expected.

This pull request adds a test which actually builds the PHAR file and test all the different installer options (no Symfony version, special lts version, branch version, etc.) It also tests the Symfony Demo application installation. No mocks or tricks are used, so the test actually downloads all the real Symfony packages from the Internet.

@@ -20,6 +20,10 @@
"symfony/filesystem": "~2.5",
"raulfraile/distill": "~0.9,!=0.9.3,!=0.9.4"
},
"require-dev": {
"kherge/box": "~2.5",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO, box should be installed separately (downloading their phar). Otherwise, you will get a bunch of unrelated deps in the phar (Box itself), and it makes things harder to test, as the phar should actually be built without dev deps (I hope the phar distributed for releases does not install dev dependencies in the phar)

@javiereguiluz
Copy link
Member Author

@fabpot when you have some free time, please enable Travis for this repository. Thanks!

@fabpot
Copy link
Member

fabpot commented Sep 10, 2015

@javiereguiluz done

PHP Parse error:  syntax error, unexpected '.', expecting ',' or ';' in /home/travis/build/symfony/symfony-installer/tests/Symfony/Installer/Tests/IntegrationTest.php on line 21
@javiereguiluz
Copy link
Member Author

Tests are finally green! @stof do you have any other comment before the merge? Thanks!


after_script:
- rm box
- rm symfony.phar
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not needed. the Travis VM is deleted anyway


before_install:
- composer self-update
- curl -LSs http://box-project.github.io/box2/installer.php | php
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you could use https here, no ?

@javiereguiluz
Copy link
Member Author

All comments have beeen addressed and tests are green. Merging!

use Symfony\Component\Process\Exception\ProcessFailedException;
use Symfony\Component\Process\ProcessUtils;

class IntegrationTest extends \PHPUnit_Framework_TestCase
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

technically, this is a functional test 😄

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants