AttributeTranslationSpec.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. /*
  3. * This file is part of the Sylius package.
  4. *
  5. * (c) Paweł Jędrzejewski
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace spec\Sylius\Component\Attribute\Model;
  11. use PhpSpec\ObjectBehavior;
  12. use Sylius\Component\Attribute\Model\AttributeTypes;
  13. /**
  14. * @author Gonzalo Vilaseca <gvilaseca@reiss.co.uk>
  15. */
  16. class AttributeTranslationSpec extends ObjectBehavior
  17. {
  18. function it_is_initializable()
  19. {
  20. $this->shouldHaveType('Sylius\Component\Attribute\Model\AttributeTranslation');
  21. }
  22. function it_implements_Sylius_attribute_interface()
  23. {
  24. $this->shouldImplement('Sylius\Component\Attribute\Model\AttributeTranslationInterface');
  25. }
  26. function it_has_no_id_by_default()
  27. {
  28. $this->getId()->shouldReturn(null);
  29. }
  30. function it_has_no_presentation_by_default()
  31. {
  32. $this->getPresentation()->shouldReturn(null);
  33. }
  34. function its_presentation_is_mutable()
  35. {
  36. $this->setPresentation('Size');
  37. $this->getPresentation()->shouldReturn('Size');
  38. }
  39. function it_has_fluent_interface()
  40. {
  41. $date = new \DateTime();
  42. $this->setPresentation('Brand')->shouldReturn($this);
  43. }
  44. }