Skip to content

Commit

Permalink
added tests to develop branch.
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Mar 27, 2012
1 parent f4258f7 commit 15fe1d5
Show file tree
Hide file tree
Showing 80 changed files with 6,510 additions and 0 deletions.
32 changes: 32 additions & 0 deletions phpunit.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

// --------------------------------------------------------------
// Define the directory separator for the environment.
// --------------------------------------------------------------
define('DS', DIRECTORY_SEPARATOR);

// --------------------------------------------------------------
// Set the core Laravel path constants.
// --------------------------------------------------------------
require 'paths.php';

// --------------------------------------------------------------
// Override the application paths when testing the core.
// --------------------------------------------------------------
$path = path('base').'tests'.DS;

set_path('app', $path.'application'.DS);

set_path('bundle', $path.'bundles'.DS);

set_path('storage', $path.'storage'.DS);

// --------------------------------------------------------------
// Bootstrap the Laravel core.
// --------------------------------------------------------------
require path('sys').'core.php';

// --------------------------------------------------------------
// Start the default bundle.
// --------------------------------------------------------------
Laravel\Bundle::start(DEFAULT_BUNDLE);
9 changes: 9 additions & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<phpunit colors="true"
bootstrap="phpunit.php"
backupGlobals="false">
<testsuites>
<testsuite name="Test Suite">
<directory suffix=".test.php">tests/cases</directory>
</testsuite>
</testsuites>
</phpunit>
92 changes: 92 additions & 0 deletions release
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
<?php

require 'paths.php';

require 'laravel/core.php';

require 'vendor/Symfony/Component/ClassLoader/UniversalClassLoader.php';

use Symfony\Component\ClassLoader\UniversalClassLoader;

$loader = new UniversalClassLoader;

$loader->register();

$loader->registerNamespace('Symfony', __DIR__.'/vendor');

use Symfony\Component\Console\Application;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

$console = new Application;

class TestingReleaser extends Command {

/**
* Configure the console command.
*
* @return void
*/
protected function configure()
{
$this->setName('testing:release')->setDescription('Release to testing');
}

/**
* Merge the develop branch into testing.
*
* return void
*/
public function execute(InputInterface $input, OutputInterface $output)
{
passthru('git merge develop');
File::rmdir(__DIR__.'/tests');
@unlink(__DIR__.'/phpunit.php');
@unlink(__DIR__.'/phpunit.xml');
passthru('git commit -am "<auto> removed unit tests from repository."');
}

}

class DevelopHotfixer extends Command {

/**
* Configure the console command.
*
* @return void
*/
public function configure()
{
$this->setName('develop:hotfix')->setDescription('Bring hotfixes into develop');
}

/**
* Merge the testing and master branch hotfixes into the develop branch.
*
* @return void
*/
public function execute(InputInterface $input, OutputInterface $output)
{
File::cpdir(__DIR__.'/tests', __DIR__.'/tests_bkp');
File::copy(__DIR__.'/phpunit.php', __DIR__.'/phpunit_bkp.php');
File::copy(__DIR__.'/phpunit.xml', __DIR__.'/phpunit_bkp.xml');
passthru('git merge testing');
File::rmdir(__DIR__.'/tests');
@unlink(__DIR__.'/phpunit.php');
@unlink(__DIR__.'/phpunit.xml');
File::cpdir(__DIR__.'/tests_bkp', __DIR__.'/tests');
File::copy(__DIR__.'/phpunit_bkp.php', __DIR__.'/phpunit.php');
File::copy(__DIR__.'/phpunit_bkp.xml', __DIR__.'/phpunit.xml');
File::rmdir(__DIR__.'/tests_bkp');
@unlink(__DIR__.'/phpunit_bkp.php');
@unlink(__DIR__.'/phpunit_bkp.xml');
}

}

$console->add(new TestingReleaser);
$console->add(new DevelopHotfixer);

$console->run();
36 changes: 36 additions & 0 deletions tests/application/bundles.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php

/*
|--------------------------------------------------------------------------
| Bundle Configuration
|--------------------------------------------------------------------------
|
| Bundles allow you to conveniently extend and organize your application.
| Think of bundles as self-contained applications. They can have routes,
| controllers, models, views, configuration, etc. You can even create
| your own bundles to share with the Laravel community.
|
| This is a list of the bundles installed for your application and tells
| Laravel the location of the bundle's root directory, as well as the
| root URI the bundle responds to.
|
| For example, if you have an "admin" bundle located in "bundles/admin"
| that you want to handle requests with URIs that begin with "admin",
| simply add it to the array like this:
|
| 'admin' => array(
| 'location' => 'admin',
| 'handles' => 'admin',
| ),
|
| Note that the "location" is relative to the "bundles" directory.
| Now the bundle will be recognized by Laravel and will be able
| to respond to requests beginning with "admin"!
|
| Have a bundle that lives in the root of the bundle directory
| and doesn't respond to any requests? Just add the bundle
| name to the array and we'll take care of the rest.
|
*/

return array('dashboard' => array('handles' => 'dashboard'), 'dummy');
158 changes: 158 additions & 0 deletions tests/application/config/application.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
<?php

return array(

/*
|--------------------------------------------------------------------------
| Application URL
|--------------------------------------------------------------------------
|
| The URL used to access your application without a trailing slash. The URL
| does nto have to be set. If it isn't we'll try our best to guess the URL
| of your application.
|
*/

'url' => '',

/*
|--------------------------------------------------------------------------
| Application Index
|--------------------------------------------------------------------------
|
| If you are including the "index.php" in your URLs, you can ignore this.
|
| However, if you are using mod_rewrite to get cleaner URLs, just set
| this option to an empty string and we'll take care of the rest.
|
*/

'index' => 'index.php',

/*
|--------------------------------------------------------------------------
| Application Key
|--------------------------------------------------------------------------
|
| This key is used by the encryption and cookie classes to generate secure
| encrypted strings and hashes. It is extremely important that this key
| remain secret and should not be shared with anyone. Make it about 32
| characters of random gibberish.
|
*/

'key' => '',

/*
|--------------------------------------------------------------------------
| Application Character Encoding
|--------------------------------------------------------------------------
|
| The default character encoding used by your application. This encoding
| will be used by the Str, Text, Form, and any other classes that need
| to know what type of encoding to use for your awesome application.
|
*/

'encoding' => 'UTF-8',

/*
|--------------------------------------------------------------------------
| Application Language
|--------------------------------------------------------------------------
|
| The default language of your application. This language will be used by
| Lang library as the default language when doing string localization.
|
*/

'language' => 'en',

/*
|--------------------------------------------------------------------------
| SSL Link Generation
|--------------------------------------------------------------------------
|
| Many sites use SSL to protect their users data. However, you may not
| always be able to use SSL on your development machine, meaning all HTTPS
| will be broken during development.
|
| For this reason, you may wish to disable the generation of HTTPS links
| throughout your application. This option does just that. All attempts to
| generate HTTPS links will generate regular HTTP links instead.
|
*/

'ssl' => true,

/*
|--------------------------------------------------------------------------
| Application Timezone
|--------------------------------------------------------------------------
|
| The default timezone of your application. This timezone will be used when
| Laravel needs a date, such as when writing to a log file or travelling
| to a distant star at warp speed.
|
*/

'timezone' => 'UTC',

/*
|--------------------------------------------------------------------------
| Class Aliases
|--------------------------------------------------------------------------
|
| Here, you can specify any class aliases that you would like registered
| when Laravel loads. Aliases are lazy-loaded, so add as many as you want.
|
| Aliases make it more convenient to use namespaced classes. Instead of
| referring to the class using its full namespace, you may simply use
| the alias defined here.
|
| We have already aliased common Laravel classes to make your life easier.
|
*/

'aliases' => array(
'Auth' => 'Laravel\\Auth',
'Asset' => 'Laravel\\Asset',
'Autoloader' => 'Laravel\\Autoloader',
'Blade' => 'Laravel\\Blade',
'Bundle' => 'Laravel\\Bundle',
'Cache' => 'Laravel\\Cache',
'Config' => 'Laravel\\Config',
'Controller' => 'Laravel\\Routing\\Controller',
'Cookie' => 'Laravel\\Cookie',
'Crypter' => 'Laravel\\Crypter',
'DB' => 'Laravel\\Database',
'Event' => 'Laravel\\Event',
'File' => 'Laravel\\File',
'Filter' => 'Laravel\\Routing\\Filter',
'Form' => 'Laravel\\Form',
'Hash' => 'Laravel\\Hash',
'HTML' => 'Laravel\\HTML',
'Input' => 'Laravel\\Input',
'IoC' => 'Laravel\\IoC',
'Lang' => 'Laravel\\Lang',
'Log' => 'Laravel\\Log',
'Memcached' => 'Laravel\\Memcached',
'Paginator' => 'Laravel\\Paginator',
'URL' => 'Laravel\\URL',
'Redirect' => 'Laravel\\Redirect',
'Redis' => 'Laravel\\Redis',
'Request' => 'Laravel\\Request',
'Response' => 'Laravel\\Response',
'Route' => 'Laravel\\Routing\\Route',
'Router' => 'Laravel\\Routing\\Router',
'Schema' => 'Laravel\\Database\\Schema',
'Section' => 'Laravel\\Section',
'Session' => 'Laravel\\Session',
'Str' => 'Laravel\\Str',
'Task' => 'Laravel\\CLI\\Tasks\\Task',
'URI' => 'Laravel\\URI',
'Validator' => 'Laravel\\Validator',
'View' => 'Laravel\\View',
),

);
Loading

0 comments on commit 15fe1d5

Please sign in to comment.