FallbackUrlPackage example

use PHPUnit\Framework\TestCase;
use Shopware\Core\Framework\Adapter\Asset\FallbackUrlPackage;
use Symfony\Component\Asset\VersionStrategy\EmptyVersionStrategy;

/** * @internal */
class FallbackUrlPackageTest extends TestCase
{
    public function testCliFallbacksToAppUrl(): void
    {
        $package = new FallbackUrlPackage(['']new EmptyVersionStrategy());
        $url = $package->getUrl('test');

        static::assertSame($_SERVER['APP_URL'] . '/test', $url);
    }

    public function testCliUrlGiven(): void
    {
        $package = new FallbackUrlPackage(['http://shopware.com']new EmptyVersionStrategy());
        $url = $package->getUrl('test');

        static::assertSame('http://shopware.com/test', $url);
    }
Home | Imprint | This part of the site doesn't use cookies.