manala / manalize

Provides ready-to-use environments for various projects through manala ansible roles
http://www.manala.io
MIT License
36 stars 2 forks source link

Assertions #109

Open nervo opened 7 years ago

nervo commented 7 years ago

Draft:

// manifest.php
$recipe = new Recipe();

$context = new FileSystemContext();
$context
    ->must(
        (new MakefileAssertion('Makefile'))
            ->exists('Pose ton Makfefile, fils !')
            ->fix(
                new TwigTemplateAssertionFixer('manala/Makefile.twig')
            )
    )
    ->should(
        (new MakefileTargetAssertion('Makefile', 'install'))
            ->exists('Il te faudrait une target "install", mec !')
    )
;

// Possibilité d'avoir plusieurs instances symfony
$context = new SymfonyFileSystemContext();
$context
    ->should(
        (new SymfonyConfigAssertion('framework.session.name'))
            ->exists('Ca serait quand même mieux d'avoir un nom de session, en vrai, gros')
    )

$context = new HostSystemContext();
$context
    ->must(
        (new VagrantAssertion())
            ->version('1.8.4', 'On t''avait dit de pas mettre à jour, yoh...')
    );

$recipe->play();

3 niveaux: MUST SHOULD MAY

Au setup:

A l'update:

nervo commented 7 years ago

L'ensemble des diffs entre la standard elao et sensio

+ app/Resources/TwigBundle (https://github.com/Elao/symfony-standard/tree/master/app/Resources/TwigBundle/views/Exception)
- app/Resources/views (https://github.com/symfony/symfony-standard/tree/master/app/Resources/views)
+ app/SymfonyStandard (https://github.com/Elao/symfony-standard/tree/master/app/SymfonyStandard)
~ app/config/config.yml + framework.session.name: app
~ app/config/config_test.yml + doctrine.dbal.dbname: "%database_name%_test"
~ app/config/routing.yml - app
- app/.htaccess
~ app/AppKernel.php - new AppBundle\AppBundle(),
                    + // Fixtures
                      $bundles[] = new Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle();
+ features (https://github.com/Elao/symfony-standard/tree/master/features/bootstrap)
- src/AppBundle (https://github.com/symfony/symfony-standard/tree/master/src/AppBundle)
- src/.htaccess
+ src/.gitkeep
- tests/AppBundle (https://github.com/symfony/symfony-standard/tree/master/tests/AppBundle/Controller)
+ tests/.gitkeep
~ var/cache/.gitkeep
~ var/logs/.gitkeep
~ var/sessions/.gitkeep
- web/.htaccess
~ web/app_dev.php + /* */
+ web/app_test.php
- web/apple-touch-icon.png
- web/config.php
~ web/favicon.ico
+ .editorconfig
~ .gitignore - /var/*
             + Vagrant/Ansible/PHP CS Fixer/App
+ .php_cs
+ Makefile
~ README.md
+ Vagrantfile
+ behat.yml.dist
~ composer.json ~ name
                + description
                + autoload.psr-4: "SymfonyStandard\\": "app/SymfonyStandard/"
                + require-dev: phpunit/doctrine-fixtures-bundle/behat/*
                + scripts.post-create-project-cmd: "SymfonyStandard\\Composer::hookCreateProject"
                ~ scripts.symfony-scripts: Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::removeSymfonyStandardFiles
                + extra.incenteev-parameters.env-map
                - extra.branch-alias
~ phpunit.xml.dist + phpuni.filter.whitelist.exclude: *Bundle/DataFixtures