Giter VIP home page Giter VIP logo

Comments (2)

Nyholm avatar Nyholm commented on August 29, 2024 1

Hm.. I added that method in the Symfony code base.

What about removing it from BaseBundleTestCase? That will require a new major version, but it is in the correct direction.

from symfony-bundle-test.

chapterjason avatar chapterjason commented on August 29, 2024

I took a closer look and yes, this could be a good idea.

I have already tested how it is usable:

<?php

namespace SoureCode\Bundle\Token\Tests;

use DAMA\DoctrineTestBundle\DAMADoctrineTestBundle;
use Doctrine\Bundle\DoctrineBundle\DoctrineBundle;
use Nyholm\BundleTest\AppKernel;
use Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
use MyCustomBundle;

abstract class MyAbstractBundleTestCase extends KernelTestCase
{

    protected static function createKernel(array $options = [])
    {
        KernelTestCase::$class = AppKernel::class;

        /**
         * @var AppKernel $kernel
         */
        $kernel = parent::createKernel($options);

        $kernel->addBundle(DoctrineBundle::class);
        $kernel->addBundle(DAMADoctrineTestBundle::class);
        $kernel->addBundle(StofDoctrineExtensionsBundle::class);
        $kernel->addBundle(MyCustomBundle::class);
        $kernel->addConfigFile(__DIR__.'/config.yml');

        return $kernel;
    }
}

To use it like this we need to take some changes in the AppKernel.

from symfony-bundle-test.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.