spec\Sylius\Bundle\CoreBundle\Fixture\GeographicalFixtureSpec::it_creates_and_persist_a_country_type_zone_and_a_zone_containing_it PHP Метод

it_creates_and_persist_a_country_type_zone_and_a_zone_containing_it() публичный Метод

public it_creates_and_persist_a_country_type_zone_and_a_zone_containing_it ( Sylius\Component\Resource\Factory\FactoryInterface $countryFactory, Doctrine\Common\Persistence\ObjectManager $countryManager, Sylius\Component\Addressing\Factory\ZoneFactoryInterface $zoneFactory, Doctrine\Common\Persistence\ObjectManager $zoneManager, Sylius\Component\Addressing\Model\CountryInterface $country, Sylius\Component\Addressing\Model\ZoneInterface $countryTypeZone, Sylius\Component\Addressing\Model\ZoneInterface $zoneTypeZone )
$countryFactory Sylius\Component\Resource\Factory\FactoryInterface
$countryManager Doctrine\Common\Persistence\ObjectManager
$zoneFactory Sylius\Component\Addressing\Factory\ZoneFactoryInterface
$zoneManager Doctrine\Common\Persistence\ObjectManager
$country Sylius\Component\Addressing\Model\CountryInterface
$countryTypeZone Sylius\Component\Addressing\Model\ZoneInterface
$zoneTypeZone Sylius\Component\Addressing\Model\ZoneInterface
    function it_creates_and_persist_a_country_type_zone_and_a_zone_containing_it(FactoryInterface $countryFactory, ObjectManager $countryManager, ZoneFactoryInterface $zoneFactory, ObjectManager $zoneManager, CountryInterface $country, ZoneInterface $countryTypeZone, ZoneInterface $zoneTypeZone)
    {
        $countryFactory->createNew()->willReturn($country);
        $country->setCode('PL')->shouldBeCalled();
        $country->enable()->shouldBeCalled();
        $zoneFactory->createWithMembers(['PL'])->willReturn($countryTypeZone);
        $countryTypeZone->setCode('POLAND')->shouldBeCalled();
        $countryTypeZone->setName('Poland')->shouldBeCalled();
        $countryTypeZone->setType(ZoneInterface::TYPE_COUNTRY)->shouldBeCalled();
        $zoneFactory->createWithMembers(['POLAND'])->willReturn($zoneTypeZone);
        $zoneTypeZone->setCode('YO-DAWG')->shouldBeCalled();
        $zoneTypeZone->setName('Yo dawg')->shouldBeCalled();
        $zoneTypeZone->setType(ZoneInterface::TYPE_ZONE)->shouldBeCalled();
        $countryManager->persist($country)->shouldBeCalled();
        $zoneManager->persist($countryTypeZone)->shouldBeCalled();
        $zoneManager->persist($zoneTypeZone)->shouldBeCalled();
        $countryManager->flush()->shouldBeCalled();
        $zoneManager->flush()->shouldBeCalled();
        $this->load(['countries' => ['PL'], 'provinces' => [], 'zones' => ['POLAND' => ['name' => 'Poland', 'countries' => ['PL'], 'provinces' => [], 'zones' => []], 'YO-DAWG' => ['name' => 'Yo dawg', 'countries' => [], 'provinces' => [], 'zones' => ['POLAND']]]]);
    }