PHPackages                             nyholm/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. nyholm/symfony-bundle-test

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

nyholm/symfony-bundle-test
==========================

3.1.0(10mo ago)115522.8k↓20.3%28[1 issues](https://github.com/SymfonyTest/symfony-bundle-test/issues)[3 PRs](https://github.com/SymfonyTest/symfony-bundle-test/pulls)20MITPHPPHP ^7.2.5 || ^8.0CI failing

Since Dec 21Pushed 6mo ago7 watchersCompare

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

READMEChangelog (10)Dependencies (6)Versions (24)Used By (20)

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.

Support
-------

[](#support)

Currently supported PHP and Symfony Versions.

BranchPHP VersionSymfony VersionSupportedmaster7.2+, 8.0+5.4, 6.0+, 7.0+Yes2.x7.2+, 8.0+4.4, 6.3 - 6.4noPlease always try to update to the latest version of this package before reporting an issue.

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-22.04', 'windows-2022' ]
        php: [ '7.4', '8.0', '8.1', '8.2', '8.3' ]
        symfony: ['5.4.*', '6.4.*', '7.0.*']
        exclude:
        - php: '7.4'
          symfony: '6.4.*'
        - php: '8.0'
          symfony: '6.4.*'
        - php: '7.4'
          symfony: '7.0.*'
        - php: '8.0'
          symfony: '7.0.*'
        - php: '8.1'
          symfony: '7.0.*'

    steps:
      - uses: actions/checkout@v4

      - 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@v2

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

###  Health Score

62

—

FairBetter than 99% of packages

Maintenance61

Regular maintenance activity

Popularity53

Moderate usage in the ecosystem

Community47

Growing community involvement

Maturity78

Established project with proven stability

 Bus Factor1

Top contributor holds 53.6% 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 ~143 days

Recently: every ~356 days

Total

23

Last Release

308d ago

Major Versions

1.x-dev → 2.0.02022-04-04

2.x-dev → 3.0.02024-01-08

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

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

1.x-devPHP ^7.2 || ^8.0

2.0.0PHP ^7.2 || ^8.0 || ^8.1

3.0.0PHP ^7.2.5 || ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/401ccc5eea13c60cf807ae982af00e368e2166e2f26d8eb541dcd881a57385bc?d=identicon)[Nyholm](/maintainers/Nyholm)

---

Top Contributors

[![Nyholm](https://avatars.githubusercontent.com/u/1275206?v=4)](https://github.com/Nyholm "Nyholm (59 commits)")[![chapterjason](https://avatars.githubusercontent.com/u/1337562?v=4)](https://github.com/chapterjason "chapterjason (18 commits)")[![loevgaard](https://avatars.githubusercontent.com/u/2412177?v=4)](https://github.com/loevgaard "loevgaard (4 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 (3 commits)")[![stloyd](https://avatars.githubusercontent.com/u/67402?v=4)](https://github.com/stloyd "stloyd (2 commits)")[![Chris53897](https://avatars.githubusercontent.com/u/7104259?v=4)](https://github.com/Chris53897 "Chris53897 (2 commits)")[![vincentchalamon](https://avatars.githubusercontent.com/u/407859?v=4)](https://github.com/vincentchalamon "vincentchalamon (2 commits)")[![mbabker](https://avatars.githubusercontent.com/u/368545?v=4)](https://github.com/mbabker "mbabker (2 commits)")[![l-vo](https://avatars.githubusercontent.com/u/15314293?v=4)](https://github.com/l-vo "l-vo (1 commits)")[![Nemo64](https://avatars.githubusercontent.com/u/1749936?v=4)](https://github.com/Nemo64 "Nemo64 (1 commits)")[![nicolas-grekas](https://avatars.githubusercontent.com/u/243674?v=4)](https://github.com/nicolas-grekas "nicolas-grekas (1 commits)")[![smoench](https://avatars.githubusercontent.com/u/183530?v=4)](https://github.com/smoench "smoench (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)")[![fbourigault](https://avatars.githubusercontent.com/u/1116116?v=4)](https://github.com/fbourigault "fbourigault (1 commits)")[![GrahamCampbell](https://avatars.githubusercontent.com/u/2829600?v=4)](https://github.com/GrahamCampbell "GrahamCampbell (1 commits)")

---

Tags

hacktoberfestsymfonysymfony-bundletesting

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.5M370](/packages/easycorp-easyadmin-bundle)[sulu/sulu

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

1.3k1.4M195](/packages/sulu-sulu)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.4M506](/packages/shopware-core)[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

9017.2k55](/packages/open-dxp-opendxp)[friendsoftypo3/content-blocks

TYPO3 CMS Content Blocks - Content Types API | Define reusable components via YAML

101466.4k44](/packages/friendsoftypo3-content-blocks)[chameleon-system/chameleon-base

The Chameleon System core.

1027.9k4](/packages/chameleon-system-chameleon-base)

PHPackages © 2026

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