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..
Hello, I am trying to write tests for my Facade but I am getting the error when I run them ```[Spryk
Hello, I am trying to write tests for my Facade but I am getting the error when I run them
[Spryker\Zed\Kernel\ClassResolver\Factory\FactoryNotFoundException] Spryker Kernel Exception Can not resolve TermBusinessFactory in Business layer for your module "Term" You can fix this by adding the missing Factory to your module. E.g. Pyz\Zed\Term\Business\TermBusinessFactory
However, I have the TermBusinessFactory class: Pyz\Zed\Term\Business\TermBusinessFactory extends AbstractBusinessFactory
. My codeception.yml looks like this:
namespace: PyzTest\Zed\Term paths: tests: . data: _data support: _support log: _output coverage: enabled: true remote: false whitelist: { include: ['../../../../src/*'] } suites: Business: path: Business class_name: TermBusinessTester modules: enabled: - Asserts - \PyzTest\Shared\Testify\Helper\Environment - \SprykerTest\Shared\Testify\Helper\ConfigHelper - \SprykerTest\Shared\Testify\Helper\DependencyHelper - \SprykerTest\Shared\Propel\Helper\TransactionHelper - \SprykerTest\Shared\Testify\Helper\LocatorHelper: projectNamespaces: ['Pyz']
And it fails when I am trying to receive a facade in my FacadeTest:
$termFacade = $this->tester->getLocator()->term()->facade();
I'll post the screenshot of the Zed\Term module structure in the thread.
The implementation itself works, so it looks like a test configuration for class resolvers.
Comments
-
~Facade is wrongly named.~
~It needs to be TermBusinessFacade to work~Sorry that was wrong, mixed up Facade and Factory in my head.
0 -
Have u tryed to
use LocatorHelperTrait;
?
0 -
Unfortunately not.
0 -
The working solution is to bypass locator and instantiate the Facade as
new TermFacade()
.0 -
However I've noticed that whenever I try to use DataBuilder I'll get the following error:
Fatal error: Cannot redeclare non static Spryker\Shared\Testify\AbstractDataBuilder::$faker as static Generated\Shared\DataBuilder\CustomerBuilder::$faker in /data/shop/development/current/src/Generated/Shared/DataBuilder/CustomerBuilder.php on line 16
Usage:
$customerTransfer = (new CustomerBuilder([]))->build();
0 -
Sorry, have to pass here. Nerver used testify to write my tests. I write tests directly for everything
0 -
I am just following the documentation / vendor examples
0 -
@U014B6AG7EX maybe?
0
Categories
- All Categories
- 42 Getting Started & Guidelines
- 7 Getting Started in the Community
- 8 Additional Resources
- 7 Community Ideas and Feedback
- 75 Spryker News
- 924 Developer Corner
- 783 Spryker Development
- 88 Spryker Dev Environment
- 362 Spryker Releases
- 3 Oryx frontend framework
- 35 Propel ORM
- 68 Community Projects
- 3 Community Ideation Board
- 30 Hackathon
- 3 PHP Bridge
- 6 Gacela Project
- 25 Job Opportunities
- 3.2K π Slack Archives
- 116 Academy
- 5 Business Users
- 370 Docker
- 551 Slack General
- 2K Help
- 75 Knowledge Sharing
- 6 Random Stuff
- 4 Code Testing
- 32 Product & Business Questions
- 70 Spryker Safari Questions
- 50 Random