Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added travis

  • Loading branch information...
commit a43e2ac3d7272706b23904ffa6333d8ba8dffe33 1 parent b500933
@phiamo authored
View
17 .travis.yml
@@ -0,0 +1,17 @@
+language: php
+php:
+ - 5.3
+ # - 5.4
+
+env:
+ #- SYMFONY_VERSION=v2.0.0
+ #- SYMFONY_VERSION=v2.0.1
+ # - SYMFONY_VERSION=v2.0.2 # broken tag
+ #- SYMFONY_VERSION=v2.0.3
+ #- SYMFONY_VERSION=v2.0.4
+ #- SYMFONY_VERSION=v2.0.5
+ - SYMFONY_VERSION=v2.0.6
+ - SYMFONY_VERSION=origin/master
+
+before_script: php Tests/tests/vendors.php
+script: phpunit
View
12 Tests/Controller/BarcodeControllerTest.php
@@ -0,0 +1,12 @@
+<?php
+namespace Mopa\BootstrapBundle\Tests\Controller;
+
+use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
+
+class BarcodeController extends WebTestCase
+{
+ public function testTest()
+ {
+ $this->assertTrue(True, 'Wow');
+ }
+}
View
25 Tests/tests/autoload.php.dist
@@ -0,0 +1,25 @@
+<?php
+
+$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'),
+ 'Knp' => array($vendorDir.'/knpmenu/src'),
+));
+$loader->register();
+
+spl_autoload_register(function($class) {
+ if (0 === strpos($class, 'Mopa\\BarcodeBundle\\')) {
+ $path = __DIR__.'/../../'.implode('/', array_slice(explode('\\', $class), 2)).'.php';
+
+ if (!stream_resolve_include_path($path)) {
+ return false;
+ }
+ require_once $path;
+ return true;
+ }
+});
View
16 Tests/tests/bootstrap.php
@@ -0,0 +1,16 @@
+<?php
+
+/*
+ * this file is part of the symfony package.
+ *
+ * (c) fabien potencier <fabien.potencier@symfony-project.com>
+ *
+ * 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;
+}
View
28 Tests/tests/vendors.php
@@ -0,0 +1,28 @@
+#!/usr/bin/env php
+<?php
+
+set_time_limit(0);
+
+$vendorDir = __DIR__.'/../../vendor';
+if (!is_dir($vendorDir)) {
+ mkdir($vendorDir);
+}
+
+$deps = array(
+ array('symfony', 'git://github.com/symfony/symfony.git', isset($_SERVER['SYMFONY_VERSION']) ? $_SERVER['SYMFONY_VERSION'] : 'origin/master'),
+ array('bundles/BootstrapBundle', 'git://github.com/phiamo/MopaBootstrapBundle.git', '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 --quiet %s %s', escapeshellarg($url), escapeshellarg($installDir)));
+ }
+
+ system(sprintf('cd %s && git fetch origin && git reset --hard %s', escapeshellarg($installDir), escapeshellarg($rev)));
+}
+
View
20 phpunit.xml.dist
@@ -0,0 +1,20 @@
+<?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/tests/bootstrap.php"
+>
+ <testsuites>
+ <testsuite name="Barcode Test Suite">
+ <directory>./Tests/</directory>
+ </testsuite>
+ </testsuites>
+
+</phpunit>
Please sign in to comment.
Something went wrong with that request. Please try again.