Skip to content

Commit fd8121f

Browse files
jbcrdamonsson
authored andcommitted
fix PHP Spec tests
1 parent 216eebb commit fd8121f

8 files changed

Lines changed: 16 additions & 120 deletions

File tree

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"friends-of-behat/symfony-extension": "^2.1",
2828
"friends-of-behat/variadic-extension": "^1.3",
2929
"lchrusciel/api-test-case": "^4.1",
30-
"matthiasnoback/symfony-config-test": "^3.0",
30+
"matthiasnoback/symfony-config-test": "^4.0",
3131
"phpspec/phpspec": "^7.0",
3232
"phpstan/phpstan": "^0.12",
3333
"phpstan/phpstan-doctrine": "^0.12.32",

spec/Media/Provider/FileProviderSpec.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,32 +13,32 @@
1313
namespace spec\BitBag\SyliusCmsPlugin\MediaProvider;
1414

1515
use BitBag\SyliusCmsPlugin\Entity\MediaInterface;
16-
use BitBag\SyliusCmsPlugin\MediaProvider\FileProvider;
16+
use BitBag\SyliusCmsPlugin\MediaProvider\GenericProvider;
1717
use BitBag\SyliusCmsPlugin\MediaProvider\ProviderInterface;
1818
use BitBag\SyliusCmsPlugin\Uploader\MediaUploaderInterface;
1919
use PhpSpec\ObjectBehavior;
20-
use Symfony\Bundle\FrameworkBundle\Templating\EngineInterface;
20+
use Twig\Environment;
2121

2222
final class FileProviderSpec extends ObjectBehavior
2323
{
2424
function let(
2525
MediaUploaderInterface $uploader,
26-
EngineInterface $twigEngine
26+
Environment $twigEngine
2727
) {
2828
$this->beConstructedWith($uploader, $twigEngine, '@Template', '/media/');
2929
}
3030

3131
function it_is_initializable(): void
3232
{
33-
$this->shouldHaveType(FileProvider::class);
33+
$this->shouldHaveType(GenericProvider::class);
3434
}
3535

3636
function it_implements_provider_interface(): void
3737
{
3838
$this->shouldHaveType(ProviderInterface::class);
3939
}
4040

41-
public function it_renders(MediaInterface $media, EngineInterface $twigEngine): void
41+
public function it_renders(MediaInterface $media, Environment $twigEngine): void
4242
{
4343
$twigEngine->render('@Template', ['media' => $media, 'config' => []])->willReturn('content');
4444

spec/Media/Provider/ImageProviderSpec.php

Lines changed: 0 additions & 52 deletions
This file was deleted.

spec/Media/Provider/VideoProviderSpec.php

Lines changed: 0 additions & 52 deletions
This file was deleted.

spec/Twig/Runtime/RenderBlockRuntimeSpec.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@
1818
use BitBag\SyliusCmsPlugin\Twig\Runtime\RenderBlockRuntime;
1919
use BitBag\SyliusCmsPlugin\Twig\Runtime\RenderBlockRuntimeInterface;
2020
use PhpSpec\ObjectBehavior;
21-
use Symfony\Component\Templating\EngineInterface;
21+
use Twig\Environment;
2222

2323
final class RenderBlockRuntimeSpec extends ObjectBehavior
2424
{
2525
function let(
2626
BlockRepositoryInterface $blockRepository,
2727
BlockResourceResolverInterface $blockResourceResolver,
28-
EngineInterface $templatingEngine
28+
Environment $templatingEngine
2929
): void {
3030
$this->beConstructedWith($blockRepository, $blockResourceResolver, $templatingEngine);
3131
}
@@ -43,7 +43,7 @@ function it_implements_render_block_runtime_interface(): void
4343
function it_renders_block(
4444
BlockResourceResolverInterface $blockResourceResolver,
4545
BlockInterface $block,
46-
EngineInterface $templatingEngine
46+
Environment $templatingEngine
4747
): void {
4848
$blockResourceResolver->findOrLog('bitbag')->willReturn($block);
4949
$templatingEngine->render('@BitBagSyliusCmsPlugin/Shop/Block/show.html.twig', ['block' => $block])->willReturn('<div>BitBag</div>');
@@ -54,7 +54,7 @@ function it_renders_block(
5454
function it_renders_block_with_template(
5555
BlockResourceResolverInterface $blockResourceResolver,
5656
BlockInterface $block,
57-
EngineInterface $templatingEngine
57+
Environment $templatingEngine
5858
): void {
5959
$blockResourceResolver->findOrLog('bitbag')->willReturn($block);
6060
$templatingEngine->render('@BitBagSyliusCmsPlugin/Shop/Block/otherTemplate.html.twig', ['block' => $block])->willReturn('<div>BitBag Other Template</div>');

spec/Twig/Runtime/RenderProductPagesRuntimeSpec.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@
2323
use Sylius\Component\Channel\Context\ChannelContextInterface;
2424
use Sylius\Component\Core\Model\ChannelInterface;
2525
use Sylius\Component\Core\Model\ProductInterface;
26-
use Symfony\Component\Templating\EngineInterface;
26+
use Twig\Environment;
2727

2828
final class RenderProductPagesRuntimeSpec extends ObjectBehavior
2929
{
3030
function let(
3131
PageRepositoryInterface $pageRepository,
3232
ChannelContextInterface $channelContext,
33-
EngineInterface $templatingEngine,
33+
Environment $templatingEngine,
3434
SectionsSorterInterface $sectionsSorter
3535
): void {
3636
$this->beConstructedWith($pageRepository, $channelContext, $templatingEngine, $sectionsSorter);
@@ -53,7 +53,7 @@ function it_renders_product_pages(
5353
PageRepositoryInterface $pageRepository,
5454
PageInterface $page,
5555
SectionInterface $section,
56-
EngineInterface $templatingEngine,
56+
Environment $templatingEngine,
5757
SectionsSorterInterface $sectionsSorter
5858
): void {
5959
$channel->getCode()->willReturn('WEB');
@@ -74,7 +74,7 @@ function it_renders_product_pages_with_sections(
7474
PageRepositoryInterface $pageRepository,
7575
PageInterface $page,
7676
SectionInterface $section,
77-
EngineInterface $templatingEngine,
77+
Environment $templatingEngine,
7878
SectionsSorterInterface $sectionsSorter
7979
): void {
8080
$channel->getCode()->willReturn('WEB');

tests/Api/Sitemap/Provider/AbstractTestController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
namespace Tests\BitBag\SyliusCmsPlugin\Api\Sitemap\Provider;
1414

15-
use Lakion\ApiTestCase\XmlApiTestCase;
15+
use ApiTestCase\XmlApiTestCase;
1616
use Sylius\Component\Core\Model\Channel;
1717
use Sylius\Component\Core\Model\ChannelInterface;
1818
use Sylius\Component\Currency\Model\Currency;

tests/Application/config/bundles.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
Liip\ImagineBundle\LiipImagineBundle::class => ['all' => true],
4141
Payum\Bundle\PayumBundle\PayumBundle::class => ['all' => true],
4242
Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle::class => ['all' => true],
43-
WhiteOctober\PagerfantaBundle\WhiteOctoberPagerfantaBundle::class => ['all' => true],
43+
BabDev\PagerfantaBundle\WhiteOctoberPagerfantaBundle::class => ['all' => true],
4444
Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true],
4545
Sylius\Bundle\FixturesBundle\SyliusFixturesBundle::class => ['all' => true],
4646
Sylius\Bundle\PayumBundle\SyliusPayumBundle::class => ['all' => true],

0 commit comments

Comments
 (0)