-
Notifications
You must be signed in to change notification settings - Fork 158
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #534 from BitBagCommerce/feature/OP-545
OP-545: Twig templates for blocks and pages
- Loading branch information
Showing
75 changed files
with
672 additions
and
158 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
features/admin/adding_template.feature → ...res/admin/adding_content_template.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
features/admin/managing_templates.feature → .../admin/managing_content_templates.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace spec\Sylius\CmsPlugin\Provider; | ||
|
||
use PhpSpec\ObjectBehavior; | ||
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; | ||
use Sylius\CmsPlugin\Provider\ResourceTemplateProvider; | ||
use Sylius\CmsPlugin\Provider\ResourceTemplateProviderInterface; | ||
|
||
final class ResourceTemplateProviderSpec extends ObjectBehavior | ||
{ | ||
public function let(ParameterBagInterface $parameterBag): void | ||
{ | ||
$parameterBag->get('sylius_cms.templates.pages')->willReturn([ | ||
'@CustomTemplate/Page.html.twig' => '@CustomTemplate/Page.html.twig', | ||
]); | ||
|
||
$parameterBag->get('sylius_cms.templates.blocks')->willReturn([ | ||
'@CustomTemplate/Block.html.twig' => '@CustomTemplate/Block.html.twig', | ||
]); | ||
|
||
$this->beConstructedWith($parameterBag); | ||
} | ||
|
||
public function it_is_initializable(): void | ||
{ | ||
$this->shouldHaveType(ResourceTemplateProvider::class); | ||
} | ||
|
||
public function it_implements_resource_template_provider_interface(): void | ||
{ | ||
$this->shouldImplement(ResourceTemplateProviderInterface::class); | ||
} | ||
|
||
public function it_returns_default_and_custom_page_templates(): void | ||
{ | ||
$this->getPageTemplates()->shouldReturn([ | ||
'sylius.ui.default' => '@SyliusCmsPlugin/Shop/Page/show.html.twig', | ||
'@CustomTemplate/Page.html.twig' => '@CustomTemplate/Page.html.twig', | ||
]); | ||
} | ||
|
||
public function it_returns_default_and_custom_block_templates(): void | ||
{ | ||
$this->getBlockTemplates()->shouldReturn([ | ||
'sylius.ui.default' => '@SyliusCmsPlugin/Shop/Block/show.html.twig', | ||
'@CustomTemplate/Block.html.twig' => '@CustomTemplate/Block.html.twig', | ||
]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.