Skip to content

Controller namespace issue for modules in urlPrefixes #39

Open
@SOHELAHMED7

Description

@SOHELAHMED7

Controller namespace for modules in urlPrefixes does not work properly.

If controllers have same name/id in different modules, we get error.

Expected: It should not throw error and should generate the code successfully.

Given the failing test 73aa9b3

we get error:

phpunit --filter '/IssueFixTest::testControllerNamespaceIssueForModulesInUrlPrefixes$/'
PHPUnit 8.5.38 by Sebastian Bergmann and contributors.

E                                                                   1 / 1 (100%)

Time: 79 ms, Memory: 12.00 MB

There was 1 error:

1) tests\unit\IssueFixTest::testControllerNamespaceIssueForModulesInUrlPrefixes
Laminas\Code\Generator\Exception\InvalidArgumentException: A method by name actionList already exists in this class.

/app/vendor/laminas/laminas-code/src/Generator/ClassGenerator.php:866
/app/vendor/laminas/laminas-code/src/Generator/ClassGenerator.php:852
/app/src/lib/generators/ControllersGenerator.php:136
/app/src/lib/generators/ControllersGenerator.php:83
/app/src/generator/ApiGenerator.php:477
/app/tests/DbTestCase.php:62
/app/tests/unit/IssueFixTest.php:368
phpvfscomposer:///app/vendor/phpunit/phpunit/phpunit:97

ERRORS!
Tests: 1, Assertions: 1, Errors: 1.


Related to #14

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions