Commit 1b2f0394 authored by Fabien Potencier's avatar Fabien Potencier

minor #1510 Fix AssetServiceProviderTest::testGenerateAssetUrl (skalpa)

This PR was merged into the 2.1.x-dev branch.

Discussion
----------

Fix AssetServiceProviderTest::testGenerateAssetUrl

The test broke when symfony/symfony#22528 got merged.

I added one check without the starting slash (the returned path should be relative to `base_path`) and modified the expectation of the check with the starting slash (the returned path should not be relative).

```
There was 1 failure:

1) Silex\Tests\Provider\AssetServiceProviderTest::testGenerateAssetUrl
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'/whatever-makes-sense/foo.css?css2'
+'/foo.css?css2'
```

Commits
-------

ce8e41b5 Fix AssetServiceProviderTest::testGenerateAssetUrl
parents 0a3b2a9d ce8e41b5
...@@ -29,7 +29,7 @@ class AssetServiceProviderTest extends \PHPUnit_Framework_TestCase ...@@ -29,7 +29,7 @@ class AssetServiceProviderTest extends \PHPUnit_Framework_TestCase
)); ));
$this->assertEquals('/foo.png?version=v1', $app['assets.packages']->getUrl('/foo.png')); $this->assertEquals('/foo.png?version=v1', $app['assets.packages']->getUrl('/foo.png'));
$this->assertEquals('/whatever-makes-sense/foo.css?css2', $app['assets.packages']->getUrl('/foo.css', 'css')); $this->assertEquals('/whatever-makes-sense/foo.css?css2', $app['assets.packages']->getUrl('foo.css', 'css'));
$this->assertEquals('https://img.example.com/foo.png', $app['assets.packages']->getUrl('/foo.png', 'images')); $this->assertEquals('https://img.example.com/foo.png', $app['assets.packages']->getUrl('/foo.png', 'images'));
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment