Skip to content

Inconsistent test namespace: Tests vs Test #167

@s2x

Description

@s2x

Problem

Two test files use the namespace CrazyGoat\WorkermanBundle\Tests\... (with trailing "s"), while all other test files use CrazyGoat\WorkermanBundle\Test\... (without "s"). The autoload-dev in composer.json maps to CrazyGoat\\WorkermanBundle\\Test\\, so the Tests namespace only works by accident for top-level files (PSR-4 allows it because the directory structure matches).

This inconsistency can cause:

  • Confusion when creating new test files
  • Potential autoloading issues for namespaced test helpers
  • IDE navigation problems

Location

  • tests/ConfigLoaderTest.php, line 5: namespace CrazyGoat\WorkermanBundle\Tests;
  • tests/DependencyInjection/WorkermanCompilerPassTest.php, line 5: namespace CrazyGoat\WorkermanBundle\Tests\DependencyInjection;

Expected Namespace

All test files should use CrazyGoat\WorkermanBundle\Test\... (matching autoload-dev):

// ConfigLoaderTest.php
namespace CrazyGoat\WorkermanBundle\Test;

// WorkermanCompilerPassTest.php
namespace CrazyGoat\WorkermanBundle\Test\DependencyInjection;

Proposed Fix

Update the namespace declarations in both files to match the autoload-dev mapping.

Priority

🟢 MINOR — naming inconsistency; works by accident.

Metadata

Metadata

Assignees

No one assigned

    Labels

    code-qualityCode quality improvementsminorMinor priority - code quality

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions