for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Lakion\SyliusCmsBundle\Tests\Behat\Context\Transform;
use Behat\Behat\Context\Context;
use Sylius\Component\Resource\Repository\RepositoryInterface;
final class CustomBlockContext implements Context
{
/**
* @var RepositoryInterface
*/
private $repository;
* @param RepositoryInterface $repository
public function __construct(RepositoryInterface $repository)
$this->repository = $repository;
}
* @Transform :customBlock
public function nameToDocument($name)
return $this->repository->findOneBy(['name' => $name]);