PHPackages                             trunkstar/symfony-bundle-test - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. trunkstar/symfony-bundle-test

ActiveLibrary[Testing &amp; Quality](/categories/testing)

trunkstar/symfony-bundle-test
=============================

1.8.3(4y ago)031MITPHPPHP ^7.2 || ^8.0

Since Dec 21Pushed 4y agoCompare

[ Source](https://github.com/Trunkstar/symfony-bundle-test)[ Packagist](https://packagist.org/packages/trunkstar/symfony-bundle-test)[ RSS](/packages/trunkstar-symfony-bundle-test/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (1)Dependencies (5)Versions (21)Used By (0)

Symfony Bundle Test
===================

[](#symfony-bundle-test)

[![Total Downloads](https://camo.githubusercontent.com/036f0955e06949fd04794487a7d4973bc06baa94346d8dcafba6615d03419cf4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6e79686f6c6d2f73796d666f6e792d62756e646c652d746573742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/nyholm/symfony-bundle-test)

**Test if your bundle is compatible with different Symfony versions**

When you want to make sure that your bundle works with different versions of Symfony you need to create a custom `TestKernel` and load your bundle and configuration.

Using this bundle test together with Matthias Nobacks's [SymfonyDependencyInjectionTest](https://github.com/SymfonyTest/SymfonyDependencyInjectionTest)will give you a good base for testing a Symfony bundle.

Install
-------

[](#install)

Via Composer

```
$ composer require --dev nyholm/symfony-bundle-test
```

Write a test
------------

[](#write-a-test)

```
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
use Nyholm\BundleTest\TestKernel;
use Acme\AcmeFooBundle;
use Acme\Service\Foo;
use Symfony\Component\HttpKernel\KernelInterface;

class BundleInitializationTest extends KernelTestCase
{
    protected static function getKernelClass(): string
    {
        return TestKernel::class;
    }

    protected static function createKernel(array $options = []): KernelInterface
    {
        /**
         * @var TestKernel $kernel
         */
        $kernel = parent::createKernel($options);
        $kernel->addTestBundle(AcmeFooBundle::class);
        $kernel->handleOptions($options);

        return $kernel;
    }

    public function testInitBundle(): void
    {
        // Boot the kernel.
        $kernel = self::bootKernel();

        // Get the container
        $container = $kernel->getContainer();

        // Or for FrameworkBundle@^5.3.6 to access private services without the PublicCompilerPass
        // $container = self::getContainer();

        // Test if your services exists
        $this->assertTrue($container->has('acme.foo'));
        $service = $container->get('acme.foo');
        $this->assertInstanceOf(Foo::class, $service);
    }

    public function testBundleWithDifferentConfiguration(): void
    {
        // Boot the kernel with a config closure, the handleOptions call in createKernel is important for that to work
        $kernel = self::bootKernel(['config' => static function(TestKernel $kernel){
            // Add some other bundles we depend on
            $kernel->addTestBundle(OtherBundle::class);

            // Add some configuration
            $kernel->addTestConfig(__DIR__.'/config.yml');
        }]);

        // ...
    }
}
```

Configure Github Actions
------------------------

[](#configure-github-actions)

You want ["Github actions"](https://docs.github.com/en/actions) to run against each currently supported LTS version of Symfony (since there would be only one per major version), plus the current if it's not an LTS too. There is no need for testing against version in between because Symfony follows [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

Create a file in .github/workflows directory:

```
#.github/workflows/php.yml
name: My bundle test

on:
  push: ~
  pull_request: ~

jobs:
  build:
    runs-on: ${{ matrix.operating-system }}
    name: PHP ${{ matrix.php }} and Symfony ${{ matrix.symfony }}
    strategy:
      matrix:
        operating-system: [ ubuntu-latest, windows-latest ]
        php: [ '7.4', '8.0' ]
        symfony: ['^4.4', '^5.3']

    steps:
      - uses: actions/checkout@master

      - name: Setup PHP ${{ matrix.php }}
        uses: shivammathur/setup-php@v2
        with:
          php-version: ${{ matrix.php }}
          tools: flex

      - name: Download dependencies
        env:
          SYMFONY_REQUIRE: ${{ matrix.symfony }}
        uses: ramsey/composer-install@v1

      - name: Run test suite on PHP ${{ matrix.php }} and Symfony ${{ matrix.symfony }}
        run: ./vendor/bin/phpunit
```

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity77

Established project with proven stability

 Bus Factor1

Top contributor holds 62.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~95 days

Recently: every ~31 days

Total

20

Last Release

1619d ago

PHP version history (3 changes)1.0.0PHP ^5.5 || ^7.0

1.7.0PHP ^5.5 || ^7.0 || ^8.0

1.8.3PHP ^7.2 || ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/d6b568fc536653e6f22a3740f559a0ff1c2adf7892a7c764d8a6dbce49c0bc45?d=identicon)[Gyvastis](/maintainers/Gyvastis)

![](https://www.gravatar.com/avatar/4242a65d2c24fb8457b423989f73150e9f605d8cfdcc694c5c478492aec6d953?d=identicon)[ViktorBry](/maintainers/ViktorBry)

---

Top Contributors

[![Nyholm](https://avatars.githubusercontent.com/u/1275206?v=4)](https://github.com/Nyholm "Nyholm (56 commits)")[![chapterjason](https://avatars.githubusercontent.com/u/1337562?v=4)](https://github.com/chapterjason "chapterjason (10 commits)")[![mwadon](https://avatars.githubusercontent.com/u/3395702?v=4)](https://github.com/mwadon "mwadon (3 commits)")[![jderusse](https://avatars.githubusercontent.com/u/578547?v=4)](https://github.com/jderusse "jderusse (2 commits)")[![stloyd](https://avatars.githubusercontent.com/u/67402?v=4)](https://github.com/stloyd "stloyd (2 commits)")[![vincentchalamon](https://avatars.githubusercontent.com/u/407859?v=4)](https://github.com/vincentchalamon "vincentchalamon (2 commits)")[![Jean85](https://avatars.githubusercontent.com/u/6729988?v=4)](https://github.com/Jean85 "Jean85 (1 commits)")[![Kocal](https://avatars.githubusercontent.com/u/2103975?v=4)](https://github.com/Kocal "Kocal (1 commits)")[![loevgaard](https://avatars.githubusercontent.com/u/2412177?v=4)](https://github.com/loevgaard "loevgaard (1 commits)")[![l-vo](https://avatars.githubusercontent.com/u/15314293?v=4)](https://github.com/l-vo "l-vo (1 commits)")[![mbabker](https://avatars.githubusercontent.com/u/368545?v=4)](https://github.com/mbabker "mbabker (1 commits)")[![Nemo64](https://avatars.githubusercontent.com/u/1749936?v=4)](https://github.com/Nemo64 "Nemo64 (1 commits)")[![umpirsky](https://avatars.githubusercontent.com/u/208957?v=4)](https://github.com/umpirsky "umpirsky (1 commits)")[![Alexandre-T](https://avatars.githubusercontent.com/u/5101481?v=4)](https://github.com/Alexandre-T "Alexandre-T (1 commits)")[![xabbuh](https://avatars.githubusercontent.com/u/1957048?v=4)](https://github.com/xabbuh "xabbuh (1 commits)")[![Baachi](https://avatars.githubusercontent.com/u/833645?v=4)](https://github.com/Baachi "Baachi (1 commits)")[![bocharsky-bw](https://avatars.githubusercontent.com/u/3317635?v=4)](https://github.com/bocharsky-bw "bocharsky-bw (1 commits)")[![DoctorBryson](https://avatars.githubusercontent.com/u/81811751?v=4)](https://github.com/DoctorBryson "DoctorBryson (1 commits)")[![fbourigault](https://avatars.githubusercontent.com/u/1116116?v=4)](https://github.com/fbourigault "fbourigault (1 commits)")[![guillaumesmo](https://avatars.githubusercontent.com/u/1309544?v=4)](https://github.com/guillaumesmo "guillaumesmo (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/trunkstar-symfony-bundle-test/health.svg)

```
[![Health](https://phpackages.com/badges/trunkstar-symfony-bundle-test/health.svg)](https://phpackages.com/packages/trunkstar-symfony-bundle-test)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M648](/packages/sylius-sylius)[simplesamlphp/simplesamlphp

A PHP implementation of a SAML 2.0 service provider and identity provider.

1.1k12.4M192](/packages/simplesamlphp-simplesamlphp)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[contao/core-bundle

Contao Open Source CMS

1231.6M2.3k](/packages/contao-core-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
