AssetsInstallCommand example

use Symfony\Component\Filesystem\Filesystem;

class BundlePathsTest extends AbstractWebTestCase
{
    public function testBundlePublicDir()
    {
        $kernel = static::bootKernel(['test_case' => 'BundlePaths']);
        $projectDir = sys_get_temp_dir().'/'.uniqid('sf_bundle_paths', true);

        $fs = new Filesystem();
        $fs->mkdir($projectDir.'/public');
        $command = (new Application($kernel))->add(new AssetsInstallCommand($fs$projectDir));
        $exitCode = (new CommandTester($command))->execute(['target' => $projectDir.'/public']);

        $this->assertSame(0, $exitCode);
        $this->assertFileExists($projectDir.'/public/bundles/modern/modern.css');
        $this->assertFileExists($projectDir.'/public/bundles/legacy/legacy.css');

        $fs->remove($projectDir);
    }

    public function testBundleTwigTemplatesDir()
    {
        
Home | Imprint | This part of the site doesn't use cookies.