Permalink
Browse files

first steps towards testing on travis using composer

  • Loading branch information...
1 parent 29b015e commit 46047bb3012d87e99895255a2a6a55eff7282ccb @lsmith77 lsmith77 committed Mar 17, 2012
View
@@ -2,6 +2,10 @@ nbproject
*~
tests/phpunit.xml
-lib/vendor
/cli-config.php
jackrabbit/
+
+vendor/
+
+composer.lock
+composer.phar
View
@@ -1,12 +0,0 @@
-[submodule "lib/vendor/doctrine-common"]
- path = lib/vendor/doctrine-common
- url = git://github.com/doctrine/common.git
-[submodule "lib/vendor/Symfony/Component/Yaml"]
- path = lib/vendor/Symfony/Component/Yaml
- url = git://github.com/symfony/Yaml.git
-[submodule "lib/vendor/phpcr"]
- path = lib/vendor/phpcr
- url = git://github.com/phpcr/phpcr.git
-[submodule "lib/vendor/phpcr-utils"]
- path = lib/vendor/phpcr-utils
- url = git://github.com/phpcr/phpcr-utils.git
View
@@ -11,6 +11,8 @@ env:
# - TRANSPORT=midgard_mysql
before_script:
+ - wget -nc http://getcomposer.org/composer.phar
+ - php composer.phar install --install-suggests
- ./tests/travis_${TRANSPORT}.sh
script: phpunit -c tests/phpunit_${TRANSPORT}.xml.dist
View
@@ -0,0 +1,38 @@
+<?php
+
+$vendorDir = __DIR__.'/vendor';
+
+spl_autoload_register(function($class)
+{
+ if (0 === strpos($class, 'Doctrine\ODM\PHPCR')) {
+ $path = __DIR__.'/lib/'.implode('/', explode('\\', $class)).'.php';
+ if (!stream_resolve_include_path($path)) {
+ return false;
+ }
+ require_once $path;
+ return true;
+ }
+ if (0 === strpos($class, 'Doctrine\Tests')) {
+ $path = __DIR__.'/tests/'.implode('/', explode('\\', $class)).'.php';
+ if (!stream_resolve_include_path($path)) {
+ return false;
+ }
+ require_once $path;
+ return true;
+ }
+});
+
+$file = $vendorDir.'/.composer/autoload.php';
+if (file_exists($file)) {
+ $autoload = require_once $file;
+} else {
+ throw new RuntimeException('Install dependencies to run test suite.');
+}
+
+use Doctrine\Common\Annotations\AnnotationRegistry;
+
+AnnotationRegistry::registerLoader(function($class) use ($autoload) {
+ $autoload->loadClass($class);
+ return class_exists($class, false);
+});
+AnnotationRegistry::registerFile(__DIR__.'/lib/Doctrine/ODM/PHPCR/Mapping/Annotations/DoctrineAnnotations.php');
@@ -7,23 +7,9 @@
* Add instances of commands for eventual implementation specific commands to this array.
*/
-$extraCommands = array();
-
-$vendorDir = __DIR__.'/lib/vendor';
-
-require_once $vendorDir.'/phpcr-utils/lib/vendor/Symfony/Component/ClassLoader/UniversalClassLoader.php';
-$classLoader = new \Symfony\Component\ClassLoader\UniversalClassLoader();
-$classLoader->register();
-
-$classLoader->registerNamespaces(array(
- 'Doctrine\ODM' => dirname($vendorDir),
- 'Doctrine\Common' => $vendorDir.'/doctrine-common/lib',
- 'Symfony' => array($vendorDir.'/jackalope-doctrine-dbal/lib/jackalope/lib/phpcr-utils/lib/vendor'),
- 'PHPCR' => array($vendorDir.'/phpcr/src', $vendorDir.'/phpcr-utils/src'),
- 'Jackalope'=> array($vendorDir.'/jackalope-doctrine-dbal/src', $vendorDir.'/jackalope-doctrine-dbal/lib/jackalope/src'),
- 'Doctrine\DBAL'=> $vendorDir.'/jackalope-doctrine-dbal/lib/vendor/doctrine-dbal/lib',
-));
+require_once './bootstrap.php';
+$extraCommands = array();
$extraCommands[] = new \Jackalope\Tools\Console\Command\InitDoctrineDbalCommand();
$params = array(
@@ -7,22 +7,9 @@
* Add instances of commands for eventual implementation specific commands to this array.
*/
-$extraCommands = array();
-
-$vendorDir = __DIR__.'/lib/vendor';
-
-require_once $vendorDir.'/phpcr-utils/lib/vendor/Symfony/Component/ClassLoader/UniversalClassLoader.php';
-$classLoader = new \Symfony\Component\ClassLoader\UniversalClassLoader();
-$classLoader->register();
-
-$classLoader->registerNamespaces(array(
- 'Doctrine\ODM' => dirname($vendorDir),
- 'Doctrine\Common' => $vendorDir.'/doctrine-common/lib',
- 'Symfony' => array($vendorDir.'/phpcr-utils/lib/vendor'),
- 'PHPCR' => array($vendorDir.'/phpcr/src', $vendorDir.'/phpcr-utils/src'),
- 'Jackalope'=> array($vendorDir.'/jackalope-jackrabbit/src', $vendorDir.'/jackalope-jackrabbit/lib/jackalope/src'),
-));
+require_once './bootstrap.php';
+$extraCommands = array();
$extraCommands[] = new \Jackalope\Tools\Console\Command\JackrabbitCommand();
$params = array(
@@ -7,21 +7,9 @@
* Add instances of commands for eventual implementation specific commands to this array.
*/
-$extraCommands = array();
-
-$vendorDir = __DIR__.'/lib/vendor';
-
-require_once $vendorDir.'/jackalope/lib/phpcr-utils/lib/vendor/Symfony/Component/ClassLoader/UniversalClassLoader.php';
-$classLoader = new \Symfony\Component\ClassLoader\UniversalClassLoader();
-$classLoader->register();
+require_once './bootstrap.php';
-$classLoader->registerNamespaces(array(
- 'Doctrine\ODM' => dirname($vendorDir),
- 'Doctrine\Common' => $vendorDir.'/doctrine-common/lib',
- 'Symfony' => array($vendorDir.'/jackalope/lib/phpcr-utils/lib/vendor'),
- 'PHPCR' => array($vendorDir.'/phpcr/src', $vendorDir.'/phpcr-utils/src'),
- 'Midgard\PHPCR' => __DIR__ . '/lib/vendor/Midgard/PHPCR/src'
-));
+$extraCommands = array();
$params = array(
'midgard2.configuration.db.type' => 'MySQL',
@@ -7,20 +7,9 @@
* Add instances of commands for eventual implementation specific commands to this array.
*/
-$extraCommands = array();
-
-$vendorDir = __DIR__.'/lib/vendor';
-
-require_once $vendorDir.'/jackalope/lib/phpcr-utils/lib/vendor/Symfony/Component/ClassLoader/UniversalClassLoader.php';
-$classLoader = new \Symfony\Component\ClassLoader\UniversalClassLoader();
-$classLoader->register();
+require_once './bootstrap.php';
-$classLoader->registerNamespaces(array(
- 'Doctrine\ODM' => dirname($vendorDir),
- 'Doctrine\Common' => $vendorDir.'/doctrine-common/lib',
- 'Symfony' => array($vendorDir, $vendorDir.'/jackalope/lib/phpcr-utils/lib/vendor'),
- 'PHPCR' => array($vendorDir.'/jackalope/lib/phpcr/src', $vendorDir.'/jackalope/lib/phpcr-utils/src'),
-));
+$extraCommands = array();
$classLoader->registerNamespaces(array(
'Midgard\PHPCR' => __DIR__ . '/lib/vendor/Midgard/PHPCR/src'
View
@@ -14,10 +14,11 @@
"php": ">=5.3.2",
"doctrine/common": "dev-master",
"phpcr/phpcr-implementation": "2.1.0-beta3",
- "phpcr/phpcr-utils": "1.0-beta2"
+ "phpcr/phpcr-utils": "dev-master"
},
"suggest": {
- "symfony/yaml": ">=2.0.0,<2.2.0-dev"
+ "symfony/yaml": ">=2.0.0,<2.2.0-dev",
+ "jackalope/jackalope-jackrabbit": "dev-master"
},
"autoload": {
"psr-0": { "Doctrine\\ODM\\PHPCR": "lib/" }
Submodule Yaml deleted from 1eaee0
Submodule doctrine-common deleted from 38c854
Submodule phpcr deleted from a1ebfa
Submodule phpcr-utils deleted from 778846
View
@@ -1,37 +0,0 @@
-<?php
-
-require_once __DIR__ . '/../lib/vendor/doctrine-common/lib/Doctrine/Common/ClassLoader.php';
-require_once __DIR__ . '/../lib/vendor/doctrine-common/lib/Doctrine/Common/Annotations/AnnotationRegistry.php';
-
-use Doctrine\Common\ClassLoader;
-use Doctrine\Common\Annotations\AnnotationRegistry;
-
-$classLoader = new ClassLoader('Doctrine\Tests', __DIR__ . '/../tests');
-$classLoader->register();
-
-$classLoader = new ClassLoader('Doctrine\ODM', __DIR__ . '/../lib');
-$classLoader->register();
-
-$classLoader = new ClassLoader('Doctrine', __DIR__ . '/../lib/vendor/doctrine-common/lib');
-$classLoader->register();
-
-$classLoader = new ClassLoader('Documents', __DIR__);
-$classLoader->register();
-
-$classLoader = new ClassLoader('PHPCR\Util', __DIR__ . '/../lib/vendor/phpcr-utils/src');
-$classLoader->register();
-
-$classLoader = new ClassLoader('PHPCR', __DIR__ . '/../lib/vendor/phpcr/src');
-$classLoader->register();
-
-$classLoader = new ClassLoader('Symfony\Component\Console', __DIR__ . '/../lib/vendor/jackalope/lib/phpcr-utils/lib/vendor');
-$classLoader->register();
-
-$classLoader = new ClassLoader('Symfony', __DIR__ . '/../lib/vendor');
-$classLoader->register();
-
-AnnotationRegistry::registerLoader(function($class) use ($classLoader) {
- $classLoader->loadClass($class);
- return class_exists($class, false);
-});
-AnnotationRegistry::registerFile(__DIR__.'/../lib/Doctrine/ODM/PHPCR/Mapping/Annotations/DoctrineAnnotations.php');
@@ -1,21 +0,0 @@
-<?php
-
-require_once __DIR__ . '/../lib/vendor/doctrine-common/lib/Doctrine/Common/ClassLoader.php';
-
-use Doctrine\Common\ClassLoader;
-
-$classLoader = new ClassLoader('Doctrine\DBAL', __DIR__.'/../lib/vendor/jackalope-doctrine-dbal/lib/vendor/doctrine-dbal/lib');
-$classLoader->register();
-
-$classLoader = new ClassLoader('Jackalope', __DIR__.'/../lib/vendor/jackalope-doctrine-dbal/lib/jackalope/src');
-$classLoader->register();
-
-//$classLoader = new ClassLoader('Jackalope', __DIR__.'/../lib/vendor/jackalope-doctrine-dbal/src');
-//$classLoader->register();
-
-require_once __DIR__.'/bootstrap.php';
-
-require_once __DIR__.'/../lib/vendor/jackalope-doctrine-dbal/src/Jackalope/RepositoryFactoryDoctrineDBAL.php';
-require_once __DIR__.'/../lib/vendor/jackalope-doctrine-dbal/src/Jackalope/Transport/DoctrineDBAL/Client.php';
-require_once __DIR__.'/../lib/vendor/jackalope-doctrine-dbal/src/Jackalope/Transport/DoctrineDBAL/RepositorySchema.php';
-require_once __DIR__.'/../lib/vendor/jackalope-doctrine-dbal/src/Jackalope/Transport/DoctrineDBAL/Query/QOMWalker.php';
@@ -1,22 +0,0 @@
-<?php
-
-require_once __DIR__ . '/../lib/vendor/doctrine-common/lib/Doctrine/Common/ClassLoader.php';
-
-use Doctrine\Common\ClassLoader;
-
-$classLoader = new ClassLoader('Doctrine\DBAL', __DIR__.'/../lib/vendor/jackalope-jackrabbit/lib/vendor/jackrabbit/lib');
-$classLoader->register();
-
-$classLoader = new ClassLoader('Jackalope', __DIR__.'/../lib/vendor/jackalope-jackrabbit/lib/jackalope/src');
-$classLoader->register();
-
-//$classLoader = new ClassLoader('Jackalope', __DIR__.'/../lib/vendor/jackalope-jackrabbit/src');
-//$classLoader->register();
-
-require_once __DIR__.'/bootstrap.php';
-
-require_once __DIR__.'/../lib/vendor/jackalope-jackrabbit/src/Jackalope/RepositoryFactoryJackrabbit.php';
-require_once __DIR__.'/../lib/vendor/jackalope-jackrabbit/src/Jackalope/Transport/Jackrabbit/Client.php';
-require_once __DIR__.'/../lib/vendor/jackalope-jackrabbit/src/Jackalope/Transport/Jackrabbit/curl.php';
-require_once __DIR__.'/../lib/vendor/jackalope-jackrabbit/src/Jackalope/Transport/Jackrabbit/HTTPErrorException.php';
-require_once __DIR__.'/../lib/vendor/jackalope-jackrabbit/src/Jackalope/Transport/Jackrabbit/Request.php';
@@ -1,14 +0,0 @@
-<?php
-if (gc_enabled()) {
- echo "Disabling Zend Garbage Collection to prevent segfaults, see:\n";
- echo " https://bugs.php.net/bug.php?id=51091\n";
- echo " https://github.com/midgardproject/midgard-php5/issues/50\n";
- gc_disable();
-}
-
-require_once __DIR__ . '/bootstrap.php';
-
-use Doctrine\Common\ClassLoader;
-
-$classLoader = new ClassLoader('Midgard\PHPCR', __DIR__ . '/../lib/vendor/Midgard/PHPCR/src');
-$classLoader->register();
@@ -1,4 +1,4 @@
-<phpunit bootstrap="./bootstrap_doctrine_dbal.php">
+<phpunit bootstrap="../bootstrap.php">
<php>
<var name="DOCTRINE_PHPCR_FACTORY" value="\Jackalope\RepositoryFactoryDoctrineDBAL" />
<var name="jackalope.doctrine.dbal.driver" value="pdo_mysql" />
@@ -1,4 +1,4 @@
-<phpunit bootstrap="./bootstrap_jackrabbit.php">
+<phpunit bootstrap="../bootstrap.php">
<php>
<var name="DOCTRINE_PHPCR_FACTORY" value="\Jackalope\RepositoryFactoryJackrabbit" />
<var name="jackalope.jackrabbit_uri" value="http://localhost:8080/server/" />
@@ -1,4 +1,4 @@
-<phpunit bootstrap="./bootstrap_midgard.php">
+<phpunit bootstrap="../bootstrap.php">
<php>
<var name="DOCTRINE_PHPCR_FACTORY" value="\Midgard\PHPCR\RepositoryFactory" />
<var name="midgard2.configuration.db.type" value="MySQL" />
@@ -1,4 +1,4 @@
-<phpunit bootstrap="./bootstrap_midgard.php">
+<phpunit bootstrap="../bootstrap.php">
<php>
<var name="DOCTRINE_PHPCR_FACTORY" value="\Midgard\PHPCR\RepositoryFactory" />
<var name="midgard2.configuration.db.type" value="SQLite" />
@@ -1,12 +1,7 @@
#!/bin/bash
-git submodule update --init --recursive
-
mysql -e 'create database IF NOT EXISTS phpcr_odm_tests;' -u root
-DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
-php $DIR/vendor/vendors_doctrine_dbal.php
-
cp cli-config.doctrine_dbal.php.dist cli-config.php
./bin/phpcr jackalope:init:dbal
./bin/phpcr doctrine:phpcr:register-system-node-types
@@ -1,11 +1,6 @@
#!/bin/bash
-git submodule update --init --recursive
-
-DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
-php $DIR/vendor/vendors_jackrabbit.php
-
-./lib/vendor/jackalope-jackrabbit/tests/travis.sh
+./vendor/jackalope/jackalope-jackrabbit/tests/travis.sh
cp cli-config.jackrabbit.php.dist cli-config.php
./bin/phpcr doctrine:phpcr:register-system-node-types
@@ -1,23 +0,0 @@
-#!/usr/bin/env php
-<?php
-
-set_time_limit(0);
-
-$vendorDir = __DIR__.'/../../lib/vendor';
-$deps = array(
- array('jackalope-doctrine-dbal', 'http://github.com/jackalope/jackalope-doctrine-dbal.git', 'origin/master'),
-);
-
-foreach ($deps as $dep) {
- list($name, $url, $rev) = $dep;
-
- echo "> Installing/Updating $name\n";
-
- $installDir = $vendorDir.'/'.$name;
- if (!is_dir($installDir)) {
- echo "Cloning $name into $installDir\n";
- system(sprintf('git clone -q %s %s', escapeshellarg($url), escapeshellarg($installDir)));
- }
-
- system(sprintf('cd %s && git fetch -q origin && git reset --hard %s && git submodule update --init --recursive', escapeshellarg($installDir), escapeshellarg($rev)));
-}
@@ -1,23 +0,0 @@
-#!/usr/bin/env php
-<?php
-
-set_time_limit(0);
-
-$vendorDir = __DIR__.'/../../lib/vendor';
-$deps = array(
- array('jackalope-jackrabbit', 'http://github.com/jackalope/jackalope-jackrabbit.git', 'origin/master'),
-);
-
-foreach ($deps as $dep) {
- list($name, $url, $rev) = $dep;
-
- echo "> Installing/Updating $name\n";
-
- $installDir = $vendorDir.'/'.$name;
- if (!is_dir($installDir)) {
- echo "Cloning $name into $installDir\n";
- system(sprintf('git clone -q %s %s', escapeshellarg($url), escapeshellarg($installDir)));
- }
-
- system(sprintf('cd %s && git fetch -q origin && git reset --hard %s && git submodule update --init --recursive', escapeshellarg($installDir), escapeshellarg($rev)));
-}
Oops, something went wrong.

0 comments on commit 46047bb

Please sign in to comment.