What are the Slack Archives?

It’s a history of our time together in the Slack Community! There’s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.

Because this space is not active, you won’t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..

Hi all, when I run codeception, I get this error ```In FactoryResolver.php line 38: Spryker Kerne

UM9F81RCP
UM9F81RCP Posts: 516 πŸ§‘πŸ»β€πŸš€ - Cadet

Hi all,
when I run codeception, I get this error

In FactoryResolver.php line 38:

  Spryker Kernel Exception
  Can not resolve ModuleBusinessFactory in Business layer for your module "Module"
  You can fix this by adding the missing Factory to your module.
  E.g. Pyz\Zed\Module\Business\ModuleBusinessFactory

The thing is that this class exists Pyz\Zed\Module\Business\ModuleBusinessFactory

What am I missing?

Comments

  • UT4U1HEHG
    UT4U1HEHG Posts: 49 πŸ§‘πŸ»β€πŸš€ - Cadet
    edited June 2020

    Hi Ahmad,
    not sure, but I saw such error when the custom namespace like β€œPyz” was not added to the config file, this key:

    $config[KernelConstants::PROJECT_NAMESPACES]
    

    So I would suggest that the problem can be connected with configuration of codeception

  • UT4U1HEHG
    UT4U1HEHG Posts: 49 πŸ§‘πŸ»β€πŸš€ - Cadet

    Check also codeception.yml

    maybe this module is not enabled:

    - \SprykerTest\Shared\Testify\Helper\LocatorHelper:
        projectNamespaces: ['Pyz']
    

    and by coverage this folder is not whitelisted

    whitelist: { include: ['../../../../src/*'] }
    
  • UM9F81RCP
    UM9F81RCP Posts: 516 πŸ§‘πŸ»β€πŸš€ - Cadet

    Hi Anton,
    thank you for your response

    Let me give some context here πŸ™‚ the test used to work before, now after I upgraded the Kernel from 3.41.1 to 3.50.0 I get this error!

    This one is set in config_default

    $config[KernelConstants::PROJECT_NAMESPACES] = [
        'Pyz'
    ];
    
  • UT4U1HEHG
    UT4U1HEHG Posts: 49 πŸ§‘πŸ»β€πŸš€ - Cadet

    the config looks correct, to be sure check also codeception.yml as I wrote above.
    But if it’s connected with kernel update 😞, I don’t know what could be the problem, you need to check release notes, maybe you will find some things which you need to update

  • UKHR9UN00
    UKHR9UN00 Posts: 70 πŸ§‘πŸ»β€πŸš€ - Cadet

    What version of spryker/testify do you use?
    Maybe updating will help: https://github.com/spryker/testify/releases

  • UM9F81RCP
    UM9F81RCP Posts: 516 πŸ§‘πŸ»β€πŸš€ - Cadet

    how does updating testify affect this?

  • UM9F81RCP
    UM9F81RCP Posts: 516 πŸ§‘πŸ»β€πŸš€ - Cadet

    why do you suspect it?

  • UKHR9UN00
    UKHR9UN00 Posts: 70 πŸ§‘πŸ»β€πŸš€ - Cadet

    Because it'll be used for resolving the Factory in a test.

  • UM9F81RCP
    UM9F81RCP Posts: 516 πŸ§‘πŸ»β€πŸš€ - Cadet

    I see .. thanks for the clarification πŸ™‚

  • UM9F81RCP
    UM9F81RCP Posts: 516 πŸ§‘πŸ»β€πŸš€ - Cadet

    Thank you it works now πŸ™‚