Permalink
Browse files

Merge pull request #5 from xi-project/composer-and-travis

Composer and Travis CI
  • Loading branch information...
2 parents 343b838 + 85300ee commit 569e8cd9685e255e65768e71354ee69f28267d5a @Ezku Ezku committed Oct 15, 2012
Showing with 54 additions and 27 deletions.
  1. +3 −0 .gitignore
  2. +14 −0 .travis.yml
  3. +23 −0 composer.json
  4. +6 −27 tests/bootstrap.php
  5. +8 −0 tests/phpunit.xml.dist
View
@@ -2,3 +2,6 @@
/.idea
/tests/phpunit.xml
/tests/coverage
+/vendor/
+composer.phar
+composer.lock
View
@@ -0,0 +1,14 @@
+language: php
+
+php:
+ - 5.3
+ - 5.4
+
+before_script:
+ - wget http://getcomposer.org/composer.phar
+ - php composer.phar install
+
+script: phpunit -c tests
+
+notifications:
+ irc: "irc.freenode.net#xi-project"
View
@@ -0,0 +1,23 @@
+{
+ "name": "xi/collections",
+ "type": "library",
+ "description": "Functional, immutable and extensible enumerations and collections for PHP 5.3.",
+ "keywords": ["collections"],
+ "homepage": "http://github.com/xi-project/xi-collections",
+ "license": "BSD-3-Clause",
+ "authors": [
+ {
+ "name": "Eevert Saukkokoski",
+ "email": "eevert.saukkokoski@gmail.com",
+ "role": "Developer"
+ }
+ ],
+ "require": {
+ "php": ">=5.3.0"
+ },
+ "autoload": {
+ "psr-0": {
+ "Xi\\Collections": ["library/", "tests/"]
+ }
+ }
+}
View
@@ -1,29 +1,8 @@
<?php
-/**
- * Maximum level error reporting
- */
-error_reporting(E_ALL | E_STRICT);
-/**
- * Get both the test and library directories in the include path
- */
-set_include_path(dirname(__DIR__) . '/library' . PATH_SEPARATOR . __DIR__ . PATH_SEPARATOR . get_include_path());
-
-/**
- * Register a trivial autoloader
- */
-spl_autoload_register(function($class) {
- $filename = str_replace(array("\\", "_"), DIRECTORY_SEPARATOR, $class) . '.php';
- foreach (explode(PATH_SEPARATOR, get_include_path()) as $includePath) {
- if (file_exists($includePath . DIRECTORY_SEPARATOR . $filename)) {
- include_once $filename;
- break;
- }
- }
- return class_exists($class, false);
-});
-
-/**
- * Set default time zone
- */
-date_default_timezone_set('Europe/Helsinki');
+if (!@include __DIR__ . '/../vendor/autoload.php') {
+ die("You must set up the project dependencies, run the following commands:
+wget http://getcomposer.org/composer.phar
+php composer.phar install
+");
+}
View
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<phpunit bootstrap="bootstrap.php" colors="true">
+ <testsuites>
+ <testsuite name="xi-collections tests">
+ <directory>./Xi</directory>
+ </testsuite>
+ </testsuites>
+</phpunit>

0 comments on commit 569e8cd

Please sign in to comment.