jeudi 20 octobre 2016

How to remove /cache dir for Symfony Kernel after running tests?

When running test with Symfony Kernel, it creates /cache and /logs directory.

At the moment I load own bootstrap.php file with phpunit.xml:

<?php

require_once __DIR__.'/../vendor/autoload.php';

// clear cache
register_shutdown_function(function () {
    Nette\Utils\FileSystem::delete(__DIR__.'/cache');
    Nette\Utils\FileSystem::delete(__DIR__.'/logs');
});

  1. I wonder, is there better way to do that?
  2. The best without this extra bootstrap.php file?

Note: I don't want to keep /cache and /logs directory there by adding them to .gitignore.


Used resources with no help:

Aucun commentaire:

Enregistrer un commentaire