Skip to content

Commit

Permalink
OP-322: Behat update block textarea element with new content
Browse files Browse the repository at this point in the history
  • Loading branch information
jkindly committed Jul 2, 2024
1 parent d4759d0 commit 2a39af6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
5 changes: 2 additions & 3 deletions tests/Behat/Context/Setup/BlockContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

use Behat\Behat\Context\Context;
use BitBag\SyliusCmsPlugin\Entity\BlockInterface;
use BitBag\SyliusCmsPlugin\Entity\ContentConfiguration;
use BitBag\SyliusCmsPlugin\Entity\ContentConfigurationInterface;
use BitBag\SyliusCmsPlugin\Repository\BlockRepositoryInterface;
use Sylius\Behat\Service\SharedStorageInterface;
Expand All @@ -25,7 +26,6 @@ public function __construct(
private SharedStorageInterface $sharedStorage,
private RandomStringGeneratorInterface $randomStringGenerator,
private FactoryInterface $blockFactory,
private FactoryInterface $contentConfigurationFactory,
private BlockRepositoryInterface $blockRepository,
) {
}
Expand Down Expand Up @@ -96,8 +96,7 @@ private function createBlockWithTextareaContentElement(string $code): BlockInter
{
$block = $this->createBlock($code);

/** @var ContentConfigurationInterface $contentConfiguration */
$contentConfiguration = $this->contentConfigurationFactory->createNew();
$contentConfiguration = new ContentConfiguration();
$contentConfiguration->setType('textarea');
$contentConfiguration->setConfiguration(['textarea' => 'Content']);
$contentConfiguration->setBlock($block);
Expand Down
1 change: 0 additions & 1 deletion tests/Behat/Resources/services/contexts/setup.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
<argument type="service" id="sylius.behat.shared_storage" />
<argument type="service" id="bitbag_sylius_cms_plugin.behat.random_string_generator" />
<argument type="service" id="bitbag_sylius_cms_plugin.factory.block" />
<argument type="service" id="bitbag_sylius_cms_plugin.factory.content_configuration" />
<argument type="service" id="bitbag_sylius_cms_plugin.repository.block" />
</service>

Expand Down

0 comments on commit 2a39af6

Please sign in to comment.