Login with Google
Frankenstests logo

Bundles

Test yourself in Symfony Bundles

1.- Which of the following directories of a bundle don’t follow the standard naming?
2.- If the AppBundle bundle needs to write temporary files, what is the best place to do it?
3.- Which of the following actions are mandatory to use a third-party bundle?
4.- If a bundle needs to use the jQuery library, where should be placed the jquery.js file?
5.- What kind of help provides the config:dump-reference command?
6.- Is this the right way to register the AppBundle bundle as a parent of the BackendBundle bundle?
// BackendBundle/BackendBundle.php
namespace BackendBundle;
use AppBundle\AppBundle;

class BackendBundle extends AppBundle {
}
7.- How can you get the root directory of the AppBundle bundle from a controller?
8.- Is there any problem in the following code?
// app/AppKernel.php
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Bundle;

class AppKernel extends Kernel {

public function registerBundles() {
$bundles = [];

if ('prod' === $this->getEnvironment()) {
$bundles = [
new Bundle\FrameworkBundle\FrameworkBundle(),
// ...
];
}
if (in_array($this->getEnvironment(), array('dev', 'test'))) {
$bundles[] = new Bundle\WebProfilerBundle\WebProfilerBundle();
}
return $bundles; }
// ...
}
9.- What is the recommended naming convention for template file names and directories?
10.- What method must be overriden in the bundle class to register compiler passes?
11.- Why the base class which all bundles extend from by default makes use of the Finder component?