Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Test Bundle Laravel Package

infinitytracking/test-bundle

A lightweight test bundle from Infinity Tracking designed to validate package structure and integration workflows. It offers a minimal setup for exercising bundle behavior in PHP projects, making it useful as a starting point for testing and development.

View on GitHub
Deep Wiki
Context7

Getting Started

Read this first: the numbers are the assessment. infinitytracking/test-bundle has 0 stars, 0 dependents, and its release history stops at v1.0.1 — a single maintenance commit (468d81e [Upgrade] Update phpunit to 5.7), which places the last real activity firmly in the PHPUnit-5.7 era (that branch shipped Feb 2017 and went unmaintained in early 2019). It targets Symfony2, which reached end-of-life in November 2018 (2.8). This is not a package you introduce into a new project. It is a package you either (a) inherit inside an existing Symfony 2.x codebase that already has it in composer.json, or (b) evaluate as a source of ideas to copy — not depend on. v1.0.1 does not change that verdict: bumping PHPUnit to 5.7 is the minimum work needed to keep a bundle testable on PHP 7, not a modernisation.

Where to look, in order:

  1. composer.json — the real contract. Check require for symfony/symfony (expect ~2.3–~2.8), php (expect >=5.3 or ~5.5|~7.0), and whether the autoload is PSR-0 or PSR-4. Since v1.0.1, also check require-dev for phpunit/phpunit: ~5.7 — that constraint is now the single most useful compatibility fact in the file. This one file tells you if it can even install on your PHP.
  2. The bundle class (*Bundle.php) and DependencyInjection/ — shows registered services, compiler passes, and the config tree.
  3. Resources/config/ — service definitions; these are what you override in tests.
  4. Tests/ inside the bundle — for a "test helper" bundle this doubles as both the test suite and the usage documentation. It's often the best README, and post-v1.0.1 it also reveals exactly which PHPUnit 5.7 APIs the base classes depend on (PHPUnit_Framework_TestCase, non-void setUp(), getMock()).
  5. README / Resources/doc/ — likely thin or stale given the age; trust the code over the prose.

Minimal installation on a legacy project:

composer require --dev infinitytracking/test-bundle:~1.0.1

If no matching constraint resolves, pin the tag or branch explicitly — do not let Composer guess:

"require-dev": {
    "infinitytracking/test-bundle": "^1.0"
}

Register it in app/AppKernel.php, test environment only:

public function registerBundles()
{
    $bundles = [ /* ... */ ];

    if (in_array($this->getEnvironment(), ['test'], true)) {
        $bundles[] = new InfinityTracking\TestBundle\InfinityTrackingTestBundle();
    }

    return $bundles;
}

Then dump the container for the test env (app/console cache:clear --env=test) and confirm services appear (app/console debug:container --env=test | grep -i infinity).

First use case: pin phpunit/phpunit to ~5.7 in your own composer.json to match what the bundle was built and tested against, extend whatever base test case the bundle ships for one functional test, and verify the kernel boots with the bundle's services wired. That smoke test is the whole point of the first hour — if the kernel won't boot on your PHP/Symfony patch level, stop and read the next section.

Implementation Patterns

Pattern 1 — Extend the bundle's base test case for functional tests.

The bundle's value proposition is "structured test implementation," which in Symfony2 terms almost always means an abstract TestCase that boots the kernel, gives you the container, and (sometimes) wraps each test in a DB transaction. Adopt it by inheritance, not by static calls:

use InfinityTracking\TestBundle\Test\WebTestCase; // adjust namespace

class CheckoutControllerTest extends WebTestCase
{
    public function testCartPersists()
    {
        $client = static::createClient(['environment' => 'test']);
        $client->request('GET', '/cart');
        $this->assertSame(200, $client->getResponse()->getStatusCode());
    }
}

Because v1.0.1 locks the bundle to PHPUnit 5.7, expect the old non-namespaced PHPUnit_Framework_TestCase ancestry and setUp() with no void return type. If your project has already moved to PHPUnit 9+, do not fight the inheritance chain — prefer composition: write your own App\Tests\Functional\KernelAwareTest that uses the bundle's helpers as traits, so you have one seam to cut later.

Pattern 2 — Override bundle services in app/config/config_test.yml.

Test-helper bundles normally expose services you'll want to swap (a clock, a fixture loader, an HTTP transport). The integration point is the test config, not forking:

# app/config/config_test.yml
services:
    infinity_tracking.test.some_helper:
        class: App\Test\StubHelper
        arguments: ['%kernel.debug%']

This is the cleanest way to keep using the bundle while bending it to your needs, and it survives a Composer update far better than editing vendor/.

Pattern 3 — Wrap fixture/DB helpers behind your own base class.

Because the bundle likely handles data setup (fixtures, truncation, transaction rollback), do not let tests call it directly. Write one project base class that delegates:

abstract class DbTestCase extends InfinityBaseTestCase
{
    protected function setUp()
    {
        parent::setUp();
        $this->loadFixturesFrom(__DIR__ . '/../Fixtures');
    }
}

When the bundle inevitably dies, you change one file — or swap the body for dama/doctrine-test-bundle plus hautelook/alice-bundle/nelmio/alice and keep every test untouched.

Pattern 4 — Pin PHPUnit in lockstep, and isolate the test environment in CI.

v1.0.1 is a PHPUnit-version bump, which is a strong signal that the bundle is sensitive to the runner version. Declare phpunit/phpunit: ~5.7 at the project level (or per-CI-job) so a composer update cannot silently lift you onto a runner the base classes were never written for. Then run the suite as a dedicated Symfony environment with its own cache and its own DB:

app/console cache:clear --env=test --no-warmup
phpunit -c app/ --filter Checkout

Assert that config_test.yml is loaded and that kernel.debug is honoured; helper bundles frequently change assertion verbosity based on debug mode.

Pattern 5 — Reuse the bundle's assertion helpers in plain unit tests.

If it ships custom PHPUnit assertions (response-shape, JSON-path, domain-invariant checks), those often have no container dependency and are the safest part to keep. They are also the cheapest thing to port to a modern PHPUnit — a static assertion method is a copy-paste, not a rewrite. Read the helper class for ContainerInterface/KernelInterface type-hints before you lean on it:

$this->assertJsonContains(['status' => 'ok'], $response->getContent());

Pattern 6 — Migration-in-place, not migration-at-once.

The realistic workflow on a live Symfony2 app: keep the bundle for the test base class, but introduce modern equivalents in parallel (symfony/browser-kit, Doctrine transaction rollback) and delete the bundle's contribution test-by-test. Track which tests still use it. The v1.0.1 PHPUnit bump is not a reason to delay this — it's confirmation that the only maintenance the package will ever receive is version-alignment, not features.

Gotchas and Tips

  • v1.0.1 sets a hard PHPUnit ceiling of 5.7. PHPUnit 5.7 supports PHP 5.6–7.x and does not run on PHP 8. If you are planning to move the app to PHP 8, the bundle's shipped test tooling is not part of that path — plan to extract the helpers first, or run the legacy suite in a separate PHP 7 container. On PHPUnit 9+/10+, expect breakage from removed methods, non-void setUp() signatures, and getMock() usage.
  • It is abandoned, not merely old. Zero stars, zero dependents, and the most recent commit is a PHPUnit version bump. There will be no fixes, no security patches, and no StackOverflow answers. Treat it as vendored code you own. Fork it into your repo (App\TestSupport\) rather than requiring it, so a composer update can't shift the ground under you.
  • Symfony2 is EOL. The PHPUnit bump addresses the test runner, not the framework. Bundle inheritance from Symfony\Bundle\FrameworkBundle\Test\WebTestCase still carries the Symfony 2 kernel-boot semantics (old createClient() signature, no KernelBrowser), so a modern Symfony upgrade is a rewrite of every functional test that touches it.
  • PHP version ceiling. Check composer.json for php constraints before anything else. A >=5.3 constraint usually means the code contains PHP 5-isms (no scalar type hints, each(), etc.) that will still parse on 7.x but fail with deprecations on 8.x.
  • The bundle class may be PSR-0. Symfony2-era bundles often autoload from src/InfinityTracking/TestBundle/ with the old layout. If class_exists() fails after registering, it's an autoload layout problem, not a service problem.
  • Debug by booting the kernel first. Nine out of ten "bundle not working" cases are a test-env cache issue. rm -rf app/cache/test before concluding anything. Then app/console debug:container --env=test and debug:config <alias> --env=test.
  • Config quirks hide in DependencyInjection/Configuration.php. If the config tree requires a key with no default, the bundle will fail only in the test env and only when a test boots the kernel — unit tests pass, functional tests explode. Read the config tree before writing your first functional test.
  • --filter is your friend on a slow legacy suite. These base classes often boot the kernel once per class; use --filter and --stop-on-failure while you are establishing whether the bundle is even viable, so you aren't waiting on a full run each time.
  • Extension points are: config overrides, compiler passes, and subclassing — in that order. Prefer service replacement in config_test.yml, then subclassing, and only touch vendor/ as an absolute last resort (and if you do, fork it, don't patch in place).
  • Have the replacement ready before you need it. The modern equivalents are boringly reliable: Symfony's own WebTestCase/KernelBrowser, dama/doctrine-test-bundle for per-test transaction rollback, doctrine/data-fixtures + nelmio/alice for fixtures, and symfony/panther if you need a browser. On any project you control, skip this bundle and use those. The only defensible reason to keep infinitytracking/test-bundle in a dependency graph is that it is already there.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
elsayed85/laravel-api-exceptions
ouhssini/laravel-demo-mode
daworks/ncloud-outbound-mailer-driver
gp247/cms
ignibyte/aic-gates
nexa-merchant/blog
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
cgv/localized-resource