Test bundle to practice making a Symfony bundle.
This repository contains an ultra slim bundle. It serves as a basis for practicing certain Symfony bundle development skills.
It's a good idea to fork this repository. This allows you to save your progress in your own Github account and continue where you left off later on.
You might want to validate whether your bundle works in your Symfony project. You can use two approaches for this:
Packagist: if you have forked this repository, you can use packagist.org to register your bundle and install it using composer.
Symlink: you can also symlink the project and have the bundle installed manually. To symlink the bundle directory, run the following command from the root of your Symfony project folder (replace
<path-to-your-test-bundle-dir>with the path to where your test bundle resides, for example
# Unix mkdir -R vendor/mmbakker \ && cd vendor/mmbakker \ && ln -S <path-to-your-test-bundle-dir>
The following tasks test knowledge on how to create a bundle and how to tackle specific problems when developing a Symfony bundle.
Add service configuration for
MessageBuilderdoes not autowire out-of-the-box.
- Can you solve it?
Some variables need to be different on each environment (think of database credentials for example). This is most commonly done by using environment variables.
- Now that
MessageBuilderautowires, can you make it so that it accepts configuration from an environment variable when implemented in an app?
- Now that
Every bundle should have unit tests, ensuring the functionality provided is proper and works. This is especially important for libraries or projects that are under constant development by multiple people.
- Where do you put a unit test in a bundle?
- What test would you write for this bundle?