Skip to content

Commit

Permalink
Add Base Test
Browse files Browse the repository at this point in the history
  • Loading branch information
Garfield-fr committed Dec 16, 2011
1 parent b4f5b1c commit 97f91ae
Show file tree
Hide file tree
Showing 4 changed files with 110 additions and 0 deletions.
34 changes: 34 additions & 0 deletions Tests/autoload.php.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php

/*
* This file is part of the FunstaffFeedBundle package.
*
* (c) Funstaff <http://github.com/Funstaff/FunstaffFeedBundle>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

$vendorDir = __DIR__.'/../vendor';
require_once $vendorDir.'/symfony/src/Symfony/Component/ClassLoader/UniversalClassLoader.php';

use Symfony\Component\ClassLoader\UniversalClassLoader;

$loader = new UniversalClassLoader();
$loader->registerNamespaces(array(
'Symfony' => array($vendorDir.'/symfony/src', $vendorDir.'/bundles'),
'Monolog' => array($vendorDir.'/monolog/src'),
'Funstaff' => array($vendorDir.'/bundles')
));
$loader->register();

spl_autoload_register(function($class) {
if (0 === strpos($class, 'Funstaff\\FeedBundle\\')) {
$path = __DIR__.'/../'.implode('/', array_slice(explode('\\', $class), 2)).'.php';
if (!stream_resolve_include_path($path)) {
return false;
}
require_once $path;
return true;
}
});
16 changes: 16 additions & 0 deletions Tests/bootstrap.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

/*
* This file is part of the FunstaffFeedBundle package.
*
* (c) Funstaff <http://github.com/Funstaff/FunstaffFeedBundle>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

if (file_exists($file = __DIR__.'/autoload.php')) {
require_once $file;
} elseif (file_exists($file = __DIR__.'/autoload.php.dist')) {
require_once $file;
}
29 changes: 29 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>

<phpunit backupGlobals="false"
backupStaticAttributes="false"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false"
bootstrap="./Tests/bootstrap.php"
>

<testsuites>
<testsuite name="TikaBundle Test Suite">
<directory>./Tests</directory>
</testsuite>
</testsuites>

<filter>
<whitelist>
<directory>./</directory>
<exclude>
<directory>./Test</directory>
</exclude>
</whitelist>
</filter>
</phpunit>
31 changes: 31 additions & 0 deletions vendor/vendors.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/usr/bin/env php
<?php

/*
* This file is part of the FunstaffTikaBundle package.
*
* (c) Funstaff <http://github.com/Funstaff/FunstaffTikaBundle>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

set_time_limit(0);

$vendorDir = __DIR__;
$deps = array(
array('symfony', 'http://github.com/symfony/symfony', isset($_SERVER['SYMFONY_VERSION']) ? $_SERVER['SYMFONY_VERSION'] : 'origin/2.0'),
);

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)));
}

0 comments on commit 97f91ae

Please sign in to comment.