mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-26 21:54:13 +01:00
- Autoloader for portal files in the itop-portal-base module - Dependencies moved to root composer.json - Add autoloader for /core and /application content
46 lines
1.3 KiB
PHP
46 lines
1.3 KiB
PHP
<?php
|
|
|
|
/*
|
|
* This file is part of the Symfony package.
|
|
*
|
|
* (c) Fabien Potencier <fabien@symfony.com>
|
|
*
|
|
* For the full copyright and license information, please view the LICENSE
|
|
* file that was distributed with this source code.
|
|
*/
|
|
|
|
namespace Symfony\Bundle\FrameworkBundle\Tests\Templating\Helper;
|
|
|
|
use PHPUnit\Framework\TestCase;
|
|
use Symfony\Bundle\FrameworkBundle\Templating\Helper\AssetsHelper;
|
|
use Symfony\Component\Asset\Package;
|
|
use Symfony\Component\Asset\Packages;
|
|
use Symfony\Component\Asset\VersionStrategy\StaticVersionStrategy;
|
|
|
|
class AssetsHelperTest extends TestCase
|
|
{
|
|
private $helper;
|
|
|
|
protected function setUp()
|
|
{
|
|
$fooPackage = new Package(new StaticVersionStrategy('42', '%s?v=%s'));
|
|
$barPackage = new Package(new StaticVersionStrategy('22', '%s?%s'));
|
|
|
|
$packages = new Packages($fooPackage, ['bar' => $barPackage]);
|
|
|
|
$this->helper = new AssetsHelper($packages);
|
|
}
|
|
|
|
public function testGetUrl()
|
|
{
|
|
$this->assertEquals('me.png?v=42', $this->helper->getUrl('me.png'));
|
|
$this->assertEquals('me.png?22', $this->helper->getUrl('me.png', 'bar'));
|
|
}
|
|
|
|
public function testGetVersion()
|
|
{
|
|
$this->assertEquals('42', $this->helper->getVersion('/'));
|
|
$this->assertEquals('22', $this->helper->getVersion('/', 'bar'));
|
|
}
|
|
}
|