mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Adding Tests
This commit is contained in:
parent
bd82733a6c
commit
a911c7aeae
BIN
Tests/Fixtures/.DS_Store
vendored
Normal file
BIN
Tests/Fixtures/.DS_Store
vendored
Normal file
Binary file not shown.
37
Tests/Fixtures/App/AppKernel.php
Normal file
37
Tests/Fixtures/App/AppKernel.php
Normal file
@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use Symfony\Component\HttpKernel\Kernel;
|
||||
use Symfony\Component\Config\Loader\LoaderInterface;
|
||||
|
||||
class AppKernel extends Kernel
|
||||
{
|
||||
public function registerBundles()
|
||||
{
|
||||
return array(
|
||||
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
|
||||
new Chill\ReportBundle\ChillReportBundle(),
|
||||
new Symfony\Bundle\TwigBundle\TwigBundle(),
|
||||
);
|
||||
}
|
||||
|
||||
public function registerContainerConfiguration(LoaderInterface $loader)
|
||||
{
|
||||
$loader->load(__DIR__.'/config/config_'.$this->getEnvironment().'.yml');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getCacheDir()
|
||||
{
|
||||
return sys_get_temp_dir().'/ChillReportBundle/cache';
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getLogDir()
|
||||
{
|
||||
return sys_get_temp_dir().'/ChillReportBundle/logs';
|
||||
}
|
||||
}
|
12
Tests/Fixtures/App/config/config.yml
Normal file
12
Tests/Fixtures/App/config/config.yml
Normal file
@ -0,0 +1,12 @@
|
||||
# config/config.yml
|
||||
framework:
|
||||
secret: Not very secret
|
||||
router: { resource: "%kernel.root_dir%/config/routing.yml" }
|
||||
form: true
|
||||
csrf_protection: true
|
||||
session: ~
|
||||
default_locale: fr
|
||||
translator: { fallback: fr }
|
||||
profiler: { only_exceptions: false }
|
||||
templating: #required for assetic. Remove if not needed
|
||||
engines: ['twig']
|
7
Tests/Fixtures/App/config/config_dev.yml
Normal file
7
Tests/Fixtures/App/config/config_dev.yml
Normal file
@ -0,0 +1,7 @@
|
||||
imports:
|
||||
- { resource: config.yml } #here we import a config.yml file, this is not required
|
||||
|
||||
framework:
|
||||
test: ~
|
||||
session:
|
||||
storage_id: session.storage.filesystem
|
7
Tests/Fixtures/App/config/config_test.yml
Normal file
7
Tests/Fixtures/App/config/config_test.yml
Normal file
@ -0,0 +1,7 @@
|
||||
imports:
|
||||
- { resource: config.yml } #here we import a config.yml file, this is not required
|
||||
|
||||
framework:
|
||||
test: ~
|
||||
session:
|
||||
storage_id: session.storage.filesystem
|
1
Tests/Fixtures/App/config/routing.yml
Normal file
1
Tests/Fixtures/App/config/routing.yml
Normal file
@ -0,0 +1 @@
|
||||
routing.yml
|
27
Tests/Fixtures/App/console
Normal file
27
Tests/Fixtures/App/console
Normal file
@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
// if you don't want to setup permissions the proper way, just uncomment the following PHP line
|
||||
// read http://symfony.com/doc/current/book/installation.html#configuration-and-setup for more information
|
||||
//umask(0000);
|
||||
|
||||
set_time_limit(0);
|
||||
|
||||
require_once __DIR__.'/../../bootstrap.php';
|
||||
require_once __DIR__.'/AppKernel.php';
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Console\Application;
|
||||
use Symfony\Component\Console\Input\ArgvInput;
|
||||
use Symfony\Component\Debug\Debug;
|
||||
|
||||
$input = new ArgvInput();
|
||||
$env = $input->getParameterOption(array('--env', '-e'), getenv('SYMFONY_ENV') ?: 'dev');
|
||||
$debug = getenv('SYMFONY_DEBUG') !== '0' && !$input->hasParameterOption(array('--no-debug', '')) && $env !== 'prod';
|
||||
|
||||
if ($debug) {
|
||||
Debug::enable();
|
||||
}
|
||||
|
||||
$kernel = new AppKernel($env, $debug);
|
||||
$application = new Application($kernel);
|
||||
$application->run($input);
|
7
Tests/bootstrap.php
Normal file
7
Tests/bootstrap.php
Normal file
@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
if (!is_file($autoloadFile = __DIR__.'/../vendor/autoload.php')) {
|
||||
throw new \LogicException('Could not find autoload.php in vendor/. Did you run "composer install --dev"?');
|
||||
}
|
||||
|
||||
require $autoloadFile;
|
@ -5,6 +5,9 @@
|
||||
"keywords" : ["chill", "social work"],
|
||||
"license": "AGPL-3.0",
|
||||
"homepage" : "https://github.com/Chill-project/Report",
|
||||
"autoload": {
|
||||
"psr-4": { "Chill\\ReportBundle\\": "" }
|
||||
},
|
||||
"authors" : [
|
||||
{
|
||||
"name": "Champs-Libres",
|
||||
@ -23,10 +26,5 @@
|
||||
"doctrine/orm": "2.5.*@dev",
|
||||
"doctrine/common": "2.4.*@dev",
|
||||
"doctrine/doctrine-bundle": "~1.2@dev"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/dom-crawler": "2.5",
|
||||
"doctrine/doctrine-fixtures-bundle": "~2.2",
|
||||
"symfony/security": "~2.5"
|
||||
}
|
||||
}
|
||||
|
1363
composer.lock
generated
Normal file
1363
composer.lock
generated
Normal file
File diff suppressed because it is too large
Load Diff
1
console.sh
Executable file
1
console.sh
Executable file
@ -0,0 +1 @@
|
||||
php Tests/Fixtures/App/console $1 $2 $3 $4 $5
|
20
phpunit.xml.dist
Normal file
20
phpunit.xml.dist
Normal file
@ -0,0 +1,20 @@
|
||||
<phpunit bootstrap="./Tests/bootstrap.php" colors="true">
|
||||
<testsuites>
|
||||
<testsuite name="ChillMain test suite">
|
||||
<directory suffix="Test.php">./Tests</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
<filter>
|
||||
<whitelist>
|
||||
<directory>./</directory>
|
||||
<exclude>
|
||||
<directory>./Resources</directory>
|
||||
<directory>./Tests</directory>
|
||||
<directory>./vendor</directory>
|
||||
</exclude>
|
||||
</whitelist>
|
||||
</filter>
|
||||
<php>
|
||||
<server name="KERNEL_DIR" value="./Tests/Fixtures/App/" />
|
||||
</php>
|
||||
</phpunit>
|
Loading…
x
Reference in New Issue
Block a user