NFQ Library
Initial setup (dependencies and database structure)
$ composer install
$ app/console doctrine:database:create
$ app/console assets:install
$ app/console assetic:dump
Load data fixtures
$ app/console doctrine:schema:drop --force
$ app/console doctrine:schema:create
$ app/console doctrine:fixtures:load -n --fixtures src/Nfq/Fairytale/CoreBundle/DataFixtures/ORM/
Test environment (which is being used for tests) has other database configured, thus you need to create it as well.
$ app/console doctrine:database:create -e test
Run tests.
$ bin/behat
HEADS UP: Behat tests are configured to reload fixtures, so running Behat wipes test database!
After regenerating entity classes from mapping some changes have to be made manually:
see Doctrine ORM User class section:
- Class must extend
FOS\UserBundle\Entity\User
id
field must beprotected
(doctrine generates it asprivate
)- Constructor must call
parent::__construct();
- Image class must implement
Nfq\Fairytale\CoreBundle\Upload\UploadInterface
- Constructor must call
$this->createdAt = new \DateTime();