Browse files

Use composer for testing purposes

try --dev

dont do --dev

switch

Indentation

remove whitelines
  • Loading branch information...
1 parent f46d15c commit 237692e670d41d96e2df6547e1dcabd3d1c08264 @henrikbjorn henrikbjorn committed Nov 14, 2011
Showing with 37 additions and 39 deletions.
  1. +2 −0 .gitignore
  2. +3 −1 .travis.yml
  3. +7 −12 Tests/bootstrap.php
  4. +0 −21 Tests/vendors.php
  5. +25 −0 composer.json
  6. +0 −5 phpunit.xml.dist
View
2 .gitignore
@@ -1,3 +1,5 @@
phpunit.xml
coverage
vendor
+composer.phar
+composer.lock
View
4 .travis.yml
@@ -4,4 +4,6 @@ php:
- 5.3
- 5.4
-before_script: php Tests/vendors.php
+before_script:
+ - wget http://getcomposer.org/composer.phar
+ - php composer.phar install
View
19 Tests/bootstrap.php
@@ -1,19 +1,14 @@
<?php
-if (isset($_SERVER['TRAVIS']) && !isset($_SERVER['SYMFONY'])) {
- $_SERVER['SYMFONY'] = __DIR__ . '/../vendor/symfony/src';
+if (!@include __DIR__ . '/../vendor/.composer/autoload.php') {
+ die(<<<'EOT'
+You must set up the project dependencies, run the following commands:
+wget http://getcomposer.org/composer.phar
+php composer.phar install
+EOT
+ );
}
-require_once $_SERVER['SYMFONY'] . '/Symfony/Component/ClassLoader/UniversalClassLoader.php';
-
-use Symfony\Component\ClassLoader\UniversalClassLoader;
-
-$loader = new UniversalClassLoader();
-$loader->registerNamespaces(array(
- 'Symfony' => $_SERVER['SYMFONY'],
-));
-$loader->register();
-
spl_autoload_register(function($class) {
if (0 === strpos($class, 'SimpleThings\\FormExtraBundle\\')) {
$path = __DIR__.'/../'.implode('/', array_slice(explode('\\', $class), 2)).'.php';
View
21 Tests/vendors.php
@@ -1,21 +0,0 @@
-<?php
-
-set_time_limit(0);
-
-$vendorDir = __DIR__ . '/../vendor';
-$deps = array(
- array('symfony', 'http://github.com/symfony/symfony', 'origin/master'),
-);
-
-foreach ($deps as $dep) {
- list($name, $url, $rev) = $dep;
-
- echo "> Installing/Updating $name\n";
-
- $installDir = $vendorDir.'/'.$name;
- if (!is_dir($installDir)) {
- system(sprintf('git clone -q %s %s', escapeshellarg($url), escapeshellarg($installDir)));
- }
-
- system(sprintf('cd %s && git fetch -q origin && git reset --hard %s', escapeshellarg($installDir), escapeshellarg($rev)));
-}
View
25 composer.json
@@ -0,0 +1,25 @@
+{
+ "name": "simplethings/form-extra-bundle",
+ "description": "This bundles provides extra FormType's for Symfony2",
+ "keywords": ["symfony2", "form", "recaptcha"],
+ "type": "symfony-bundle",
+ "license": "MIT",
+ "authors": [{
+ "name" : "Benjamin Eberlei",
+ "email" : "kontakt@beberlei.de"
+ },
+ {
+ "name" : "Henrik Bjørnskov",
+ "email" : "henrik@bjrnskov.dk"
+ }],
+ "require": {
+ "php": ">=5.3.0",
+ "symfony/symfony" : ">=2.0"
+ },
+ "autoload": {
+ "psr-0": {
+ "SimpleThings\\FormExtraBundle\\": ""
+ }
+ },
+ "target-dir" : "SimpleThings/FormExtraBundle"
+}
View
5 phpunit.xml.dist
@@ -1,11 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="./Tests/bootstrap.php" colors="true">
-<!--
- <php>
- <server name="SYMFONY" value="../../vendor/symfony/src" />
- </php>
--->
<testsuites>
<testsuite name="SimpleThingsFormExtraBundle">
<directory suffix="Test.php">./Tests</directory>

0 comments on commit 237692e

Please sign in to comment.