Files
SyliusCmsPlugin/spec/Entity/FrequentlyAskedQuestionSpec.php
2018-06-26 23:50:30 +02:00

71 lines
2.0 KiB
PHP
Executable File

<?php
/*
* This file has been created by developers from BitBag.
* Feel free to contact us once you face any issues or want to start
* another great project.
* You can find more information about us on https://bitbag.shop and write us
* an email on mikolaj.krol@bitbag.pl.
*/
declare(strict_types=1);
namespace spec\BitBag\SyliusCmsPlugin\Entity;
use BitBag\SyliusCmsPlugin\Entity\FrequentlyAskedQuestion;
use BitBag\SyliusCmsPlugin\Entity\FrequentlyAskedQuestionInterface;
use PhpSpec\ObjectBehavior;
use Sylius\Component\Core\Model\ChannelInterface;
use Sylius\Component\Resource\Model\ResourceInterface;
final class FrequentlyAskedQuestionSpec extends ObjectBehavior
{
function it_is_initializable(): void
{
$this->shouldHaveType(FrequentlyAskedQuestion::class);
}
function it_is_a_resource(): void
{
$this->shouldHaveType(ResourceInterface::class);
}
function it_implements_frequently_asked_question_interface(): void
{
$this->shouldHaveType(FrequentlyAskedQuestionInterface::class);
}
function it_allows_access_via_properties(): void
{
$this->setCode('delivery_charges_for_orders');
$this->getCode()->shouldReturn('delivery_charges_for_orders');
$this->setPosition(2);
$this->getPosition()->shouldReturn(2);
$this->setEnabled(true);
$this->isEnabled()->shouldReturn(true);
}
function it_toggles(): void
{
$this->enable();
$this->isEnabled()->shouldReturn(true);
$this->disable();
$this->isEnabled()->shouldReturn(false);
}
function it_associates_channels(ChannelInterface $firstChannel, ChannelInterface $secondChannel): void
{
$this->addChannel($firstChannel);
$this->hasChannel($firstChannel)->shouldReturn(true);
$this->hasChannel($secondChannel)->shouldReturn(false);
$this->removeChannel($firstChannel);
$this->hasChannel($firstChannel)->shouldReturn(false);
}
}