Welcome To Our Shell

Mister Spy & Souheyl Bypass Shell

Current Path : /var/www/html/store/vendor/commerceguys/addressing/tests/Zone/

Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
Upload File :
Current File : /var/www/html/store/vendor/commerceguys/addressing/tests/Zone/ZoneTest.php

<?php

namespace CommerceGuys\Addressing\Tests\Zone;

use CommerceGuys\Addressing\Address;
use CommerceGuys\Addressing\Zone\Zone;
use PHPUnit\Framework\TestCase;

/**
 * @coversDefaultClass \CommerceGuys\Addressing\Zone\Zone
 */
final class ZoneTest extends TestCase
{
    /**
     * @covers ::__construct
     *
     *
     */
    public function testMissingProperty()
    {
        $this->expectException(\InvalidArgumentException::class);
        $definition = [
            'id' => 'test',
        ];
        $zone = new Zone($definition);
    }

    /**
     * @covers ::__construct
     *
     *
     */
    public function testInvalidTerritories()
    {
        $this->expectException(\InvalidArgumentException::class);
        $definition = [
            'id' => 'test',
            'label' => 'Test',
            'territories' => 'WRONG',
        ];
        $zone = new Zone($definition);
    }

    /**
     * @covers ::__construct
     * @covers ::getId
     * @covers ::getLabel
     * @covers ::getTerritories
     * @covers ::match
     */
    public function testValid()
    {
        $definition = [
            'id' => 'de_fr',
            'label' => 'Germany and France',
            'territories' => [
                ['country_code' => 'DE'],
                ['country_code' => 'FR'],
            ],
        ];
        $zone = new Zone($definition);

        $this->assertEquals($definition['id'], $zone->getId());
        $this->assertEquals($definition['label'], $zone->getLabel());
        $this->assertCount(2, $zone->getTerritories());
        $this->assertEquals($definition['territories'][0]['country_code'], $zone->getTerritories()[0]->getCountryCode());
        $this->assertEquals($definition['territories'][1]['country_code'], $zone->getTerritories()[1]->getCountryCode());

        $german_address = new Address('DE');
        $serbian_address = new Address('RS');
        $this->assertTrue($zone->match($german_address));
        $this->assertFalse($zone->match($serbian_address));
    }
}

bypass 1.0, Devloped By El Moujahidin (the source has been moved and devloped)
Email: contact@elmoujehidin.net bypass 1.0, Devloped By El Moujahidin (the source has been moved and devloped) Email: contact@elmoujehidin.net