for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
use Helpers\Repository\DomainRepository;
use Hexarchium\CoreDomain\Model\Domain\DomainId;
use Hexarchium\CoreDomain\Model\Domain\Events\ModelAdded;
use PHPUnit_Framework_Assert as Assert;
/**
* Copyright
*/
class ModelFeatureContext implements \Behat\Behat\Context\Context
You can fix this by adding a namespace to your class:
namespace YourVendor; class YourClass { }
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.
{
/** @var DomainRepository */
private $domainRepository;
* ModelFeatureContext constructor.
*
* @param DomainRepository $domainRepository
public function __construct(DomainRepository $domainRepository)
$this->domainRepository = $domainRepository;
}
* @When I create model with :arg1 id for :arg2 domain
public function iCreateModelWithIdForDomain($arg1, $arg2)
$domainId = new DomainId($arg2);
$domain = $this->domainRepository->getById($domainId);
$domain->addModel(
new \Hexarchium\CoreDomain\Model\Domain\Entity\Model(
new \Hexarchium\CoreDomain\Model\Domain\Model\ModelId($domainId, $arg1)
)
);
* @Then I should see new model in :arg1 domain
public function iShouldSeeAddedToDomain($arg1)
/** @var \Hexarchium\CoreDomain\Model\Domain\Entity\Domain $domain */
$domain = $this->domainRepository->getById(new DomainId($arg1));
$counter = 0;
foreach ($domain->pullEvents() as $event) {
if ($event instanceof ModelAdded) {
$counter++;
Assert::assertTrue($counter > 0);
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.