Skip to content

Commit

Permalink
Added: Specs
Browse files Browse the repository at this point in the history
  • Loading branch information
igormukhingmailcom committed Nov 29, 2018
1 parent e5e3821 commit ceed0dc
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/Sylius/Component/Taxonomy/spec/Model/TaxonSpec.php
Expand Up @@ -117,6 +117,29 @@ function it_returns_name_when_converted_to_string(): void
$this->__toString()->shouldReturn('T-Shirt material');
}

function its_fullname_is_null_if_unnamed(): void
{
$this->getFullname()->shouldReturn(null);
}

function its_fullname_equal_name_if_no_parent(): void
{
$this->setName('Category');
$this->getFullname()->shouldReturn('Category');
}

function its_fullname_prepends_with_parents_fullname(TaxonInterface $root): void
{
$root->getFullname()->willReturn('Category');
$this->setName('T-shirts');

$root->addChild($this)->shouldBeCalled();
$this->setParent($root);

$this->getFullname()->shouldReturn('Category / T-shirts');
$this->getFullname(' -- ')->shouldReturn('Category -- T-shirts');
}

function it_has_no_description_by_default(): void
{
$this->getDescription()->shouldReturn(null);
Expand Down

0 comments on commit ceed0dc

Please sign in to comment.