Created
January 9, 2013 15:38
-
-
Save K-Phoen/4494091 to your computer and use it in GitHub Desktop.
Functional tests for standalone Symfony2 bundles
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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(), | |
// register the other bundles your tests depend on | |
// and don't forget your own bunde! | |
new ACME\HelloBundle\AcmeHelloBundle(), | |
); | |
} | |
public function registerContainerConfiguration(LoaderInterface $loader) | |
{ | |
$loader->load(__DIR__.'/config/config_'.$this->getEnvironment().'.yml'); | |
} | |
/** | |
* @return string | |
*/ | |
public function getCacheDir() | |
{ | |
return sys_get_temp_dir().'/AcmeHelloBundle/cache'; | |
} | |
/** | |
* @return string | |
*/ | |
public function getLogDir() | |
{ | |
return sys_get_temp_dir().'/AcmeHelloBundle/logs'; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "acme/hello-bundle", | |
"type": "symfony-bundle", | |
"require": { | |
"symfony/symfony": "2.1.*", | |
"sensio/framework-extra-bundle": "2.1.x" | |
}, | |
"require-dev": { | |
"doctrine/orm": "*", | |
"doctrine/doctrine-bundle": "*", | |
"symfony/assetic-bundle": "*", | |
"behat/behat-bundle": "*", | |
"behat/mink-bundle": "*", | |
"behat/sahi-client": "*" | |
}, | |
"autoload": { | |
"psr-0": { "Acme\\HelloBundle": "" } | |
}, | |
"target-dir": "Acme/HelloBundle" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
framework: | |
secret: Hell yeah! | |
router: { resource: "%kernel.root_dir%/config/routing.yml" } | |
form: true | |
csrf_protection: true | |
session: ~ | |
default_locale: en | |
translator: { fallback: en } | |
profiler: { only_exceptions: false } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
imports: | |
- { resource: config.yml } | |
framework: | |
test: ~ | |
session: | |
storage_id: session.storage.filesystem |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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="HelloBundle Test Suite"> | |
<directory>./Tests/</directory> | |
</testsuite> | |
</testsuites> | |
<php> | |
<server name="KERNEL_DIR" value="./Tests/Fixtures/App/app" /> | |
</php> | |
</phpunit> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hello_bundle: | |
resource: "@ACMEHelloBundle/Resources/config/routing.yml" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment