diff --git a/app/config/config.yml b/app/config/config.yml index 31bb36af..d4548156 100644 --- a/app/config/config.yml +++ b/app/config/config.yml @@ -40,8 +40,8 @@ pugx_badge: - { name: 'total', label: 'Total Downloads', route: "pugx_badge_download" } - { name: 'latest_unstable_version', label: 'Latest Unstable Version', route: "pugx_badge_version_latest", latest: 'unstable'} - { name: 'license', label: 'License', route: "pugx_badge_license"} - - { name: 'monthly', label: 'Monthly Downloads', route: "pugx_badge_download_type_png", type: 'monthly'} - - { name: 'daily', label: 'Daily Downloads', route: "pugx_badge_download_type_png", type: 'daily'} + - { name: 'monthly', label: 'Monthly Downloads', route: "pugx_badge_download_type", type: 'monthly'} + - { name: 'daily', label: 'Daily Downloads', route: "pugx_badge_download_type", type: 'daily'} - { name: 'version', label: 'Version', route: "pugx_badge_version" } diff --git a/app/config/routing.yml b/app/config/routing.yml index 89c4b064..19324423 100644 --- a/app/config/routing.yml +++ b/app/config/routing.yml @@ -15,4 +15,10 @@ pugx_badge_shieldio: host: "img.shields.io" requirements: vendor: "[A-Za-z0-9_.-]+" - value: "[A-Za-z0-9_.-]+" \ No newline at end of file + value: "[A-Za-z0-9_.-]+" + +redirects: + resource: "@PUGXBadgeBundle/Resources/config/routing/routing_redirects.yml" + +aliases: + resource: "@PUGXBadgeBundle/Resources/config/routing/routing_aliases.yml" diff --git a/src/PUGX/BadgeBundle/Controller/BadgeController.php b/src/PUGX/BadgeBundle/Controller/BadgeController.php index 55013243..8c8636a7 100644 --- a/src/PUGX/BadgeBundle/Controller/BadgeController.php +++ b/src/PUGX/BadgeBundle/Controller/BadgeController.php @@ -29,6 +29,7 @@ * @author Giulio De Donato * @author Leonardo Proietti * @author Simone Fumagalli + * @author Andrea Giuliano */ class BadgeController extends Controller { @@ -64,15 +65,15 @@ public function searchPackagistAction(Request $request) * @param string $repository repository * @param string $type badge type * - * @Route("/{repository}/downloads.svg", + * @Route("/{repository}/downloads", * name = "pugx_badge_download", + * defaults = {"type" = "total"}, * requirements = { * "repository" = "[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+?" * } * ) - * @Route("/{repository}/d/{type}.svg", + * @Route("/{repository}/d/{type}", * name = "pugx_badge_download_type", - * defaults = {"type" = "total"}, * requirements = { * "type" = "total|daily|monthly", * "repository" = "[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+?" @@ -83,7 +84,7 @@ public function searchPackagistAction(Request $request) * * @return StreamedResponse */ - public function downloadsAction($repository, $type = 'total') + public function downloadsAction($repository, $type) { $imageCreator = $this->getImageCreator(); $status = 500; @@ -125,15 +126,15 @@ public function downloadsAction($repository, $type = 'total') * @param string $repository repository * @param string $latest latest * - * @Route("/{repository}/version.svg", + * @Route("/{repository}/version", * name="pugx_badge_version", + * defaults = {"latest" = "stable"}, * requirements={"repository" = "[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+?"} * ) - * @Route("/{repository}/v/{latest}.svg", + * @Route("/{repository}/v/{latest}", * name = "pugx_badge_version_latest", - * defaults = {"latest" = "stable"}, * requirements = { - * "type" = "stable|unstable", + * "latest" = "stable|unstable", * "repository" = "[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+?" * } * ) @@ -142,7 +143,7 @@ public function downloadsAction($repository, $type = 'total') * * @return StreamedResponse */ - public function versionAction($repository, $latest = 'stable') + public function versionAction($repository, $latest) { $image = null; $error = self::ERROR_TEXT_GENERIC; @@ -182,7 +183,7 @@ public function versionAction($repository, $latest = 'stable') * * @param string $repository repository * - * @Route("/{repository}/license.svg", + * @Route("/{repository}/license", * name="pugx_badge_license", * requirements={"repository" = "[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+?"} * ) diff --git a/src/PUGX/BadgeBundle/Controller/PngBadgeController.php b/src/PUGX/BadgeBundle/Controller/PngBadgeController.php deleted file mode 100644 index 1aa915d7..00000000 --- a/src/PUGX/BadgeBundle/Controller/PngBadgeController.php +++ /dev/null @@ -1,138 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace PUGX\BadgeBundle\Controller; - -use Symfony\Bundle\FrameworkBundle\Controller\Controller; -use Symfony\Component\HttpFoundation\StreamedResponse; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Cache; - -/** - * Class PngBadgeController is deprecated see BadgeController - * - * @author Giulio De Donato - * @author Leonardo Proietti - * @author Simone Fumagalli - * - * @deprecated - */ -class PngBadgeController extends Controller -{ - /** - * Png Downloads action. - * - * @param string $repository repository - * @param string $type badge type - * - * @Route("/{repository}/downloads.png", - * name = "pugx_badge_download_png", - * requirements = { - * "repository" = "[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+?" - * } - * ) - * @Method({"GET"}) - * - * @return RedirectResponse - */ - public function downloadsTotalPNGAction($repository, $type = 'total') - { - return $this->redirect($this->generateUrl('pugx_badge_download', array('repository' => $repository)), 301); - } - - /** - * Downloads action. - * - * @param $repository - * @param string $type - * - * @Route("/{repository}/d/{type}.png", - * name = "pugx_badge_download_type_png", - * defaults = {"type" = "total"}, - * requirements = { - * "type" = "total|daily|monthly", - * "repository" = "[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+?" - * } - * ) - * @Method({"GET"}) - * - * @return RedirectResponse - */ - public function downloadsPNGAction($repository, $type = 'total') - { - return $this->redirect($this->generateUrl('pugx_badge_download_type', array('repository' => $repository, 'type' => $type)), 301); - } - - /** - * Version action. - * - * @param string $repository repository - * @param string $latest latest - * - * @Route("/{repository}/version.png", - * name="pugx_badge_version_png", - * requirements={"repository" = "[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+?"} - * ) - * - * @Method({"GET"}) - * @Cache(maxage="3600", smaxage="3600", public=true) - * - * @return StreamedResponse - */ - public function versionPngAction($repository, $latest = 'stable') - { - return $this->redirect($this->generateUrl('pugx_badge_version', array('repository' => $repository)), 301); - } - /** - * Version action. - * - * @param string $repository repository - * @param string $latest latest - * - * @Route("/{repository}/v/{latest}.png", - * name = "pugx_badge_version_latest_png", - * defaults = {"latest" = "stable"}, - * requirements = { - * "type" = "stable|unstable", - * "repository" = "[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+?" - * } - * ) - * @Method({"GET"}) - * @Cache(maxage="3600", smaxage="3600", public=true) - * - * @return StreamedResponse - */ - public function versionPngLatestAction($repository, $latest = 'stable') - { - return $this->redirect($this->generateUrl('pugx_badge_version_latest', array('repository' => $repository, 'latest' => $latest)), 301); - } - - /** - * License action. - * - * @param string $repository repository - * - * @Route("/{repository}/license.png", - * name="pugx_badge_license_png", - * requirements={"repository" = "[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+?"} - * ) - * - * @Method({"GET"}) - * @Cache(maxage="3600", smaxage="3600", public=true) - * - * @return StreamedResponse - */ - public function licensePngAction($repository) - { - return $this->redirect($this->generateUrl('pugx_badge_license', array('repository'=>$repository)), 301); - } -} diff --git a/src/PUGX/BadgeBundle/Resources/config/routing/routing_aliases.yml b/src/PUGX/BadgeBundle/Resources/config/routing/routing_aliases.yml new file mode 100644 index 00000000..71b03994 --- /dev/null +++ b/src/PUGX/BadgeBundle/Resources/config/routing/routing_aliases.yml @@ -0,0 +1,45 @@ +download_svg_alias: + path: /{repository}/downloads.svg + defaults: + _controller: PUGXBadgeBundle:Badge:downloads + type: "total" + requirements: + repository: "[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+?" + methods: [GET] + +download_type_svg_alias: + path: /{repository}/d/{type}.svg + defaults: + _controller: PUGXBadgeBundle:Badge:downloads + type: "total" + requirements: + repository: "[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+?" + type: "total|daily|monthly" + methods: [GET] + +badge_version_svg_alias: + path: /{repository}/version.svg + defaults: + _controller: PUGXBadgeBundle:Badge:version + latest: "stable" + requirements: + repository: "[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+?" + methods: [GET] + +version_latest_svg_alias: + path: /{repository}/v/{latest}.svg + defaults: + _controller: PUGXBadgeBundle:Badge:version + latest: "stable" + requirements: + repository: "[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+?" + latest: "stable|unstable" + methods: [GET] + +badge_license_svg_alias: + path: /{repository}/license.svg + defaults: + _controller: PUGXBadgeBundle:Badge:license + requirements: + repository: "[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+?" + methods: [GET] \ No newline at end of file diff --git a/src/PUGX/BadgeBundle/Resources/config/routing/routing_redirects.yml b/src/PUGX/BadgeBundle/Resources/config/routing/routing_redirects.yml new file mode 100644 index 00000000..cafecc5b --- /dev/null +++ b/src/PUGX/BadgeBundle/Resources/config/routing/routing_redirects.yml @@ -0,0 +1,53 @@ +download_png_redirect: + path: /{repository}/downloads.png + defaults: + _controller: FrameworkBundle:Redirect:redirect + route: pugx_badge_download + permanent: true + requirements: + repository: "[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+?" + methods: [GET] + +download_type_png_redirect: + path: /{repository}/d/{type}.png + defaults: + _controller: FrameworkBundle:Redirect:redirect + route: pugx_badge_download_type + permanent: true + type: "total" + requirements: + repository: "[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+?" + type: "total|daily|monthly" + methods: [GET] + +badge_version_png_redirect: + path: /{repository}/version.png + defaults: + _controller: FrameworkBundle:Redirect:redirect + route: pugx_badge_version + permanent: true + requirements: + repository: "[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+?" + methods: [GET] + +version_latest_png_redirect: + path: /{repository}/v/{latest}.png + defaults: + _controller: FrameworkBundle:Redirect:redirect + route: pugx_badge_version_latest + permanent: true + latest: "stable" + requirements: + repository: "[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+?" + type: "stable|unstable" + methods: [GET] + +badge_license_png_redirect: + path: /{repository}/license.png + defaults: + _controller: FrameworkBundle:Redirect:redirect + route: pugx_badge_license + permanent: true + requirements: + repository: "[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+?" + methods: [GET] \ No newline at end of file diff --git a/src/PUGX/BadgeBundle/Tests/Controller/BadgeControllerTest.php b/src/PUGX/BadgeBundle/Tests/Controller/BadgeControllerTest.php index 68864194..7fc35179 100644 --- a/src/PUGX/BadgeBundle/Tests/Controller/BadgeControllerTest.php +++ b/src/PUGX/BadgeBundle/Tests/Controller/BadgeControllerTest.php @@ -34,7 +34,7 @@ public function testDownloadsAction() $client = static::createClient(); static::$kernel->getContainer()->set('packagist_client', $this->packagistClient); static::$kernel->getContainer()->set('image_http_client', $this->imageHttpClient); - $client->request('GET', '/pugx/badge-poser/d/total.svg'); + $client->request('GET', '/pugx/badge-poser/d/total'); $this->assertTrue($client->getResponse()->isSuccessful()); } @@ -42,7 +42,7 @@ public function testLatestStableAction() { $client = static::createClient(); static::$kernel->getContainer()->set('packagist_client', $this->packagistClient); - $client->request('GET', '/pugx/badge-poser/version.svg'); + $client->request('GET', '/pugx/badge-poser/version'); $this->assertTrue($client->getResponse()->isSuccessful()); } @@ -50,7 +50,7 @@ public function testLatestUnstableAction() { $client = static::createClient(); static::$kernel->getContainer()->set('packagist_client', $this->packagistClient); - $client->request('GET', '/pugx/badge-poser/v/unstable.svg'); + $client->request('GET', '/pugx/badge-poser/v/unstable'); $this->assertTrue($client->getResponse()->isSuccessful()); $response = $client->getResponse(); @@ -61,7 +61,7 @@ public function testLicenseAction() { $client = static::createClient(); static::$kernel->getContainer()->set('packagist_client', $this->packagistClient); - $client->request('GET', '/pugx/badge-poser/license.svg'); + $client->request('GET', '/pugx/badge-poser/license'); $this->assertTrue($client->getResponse()->isSuccessful()); } @@ -74,7 +74,7 @@ public function testIfPackageDoesntExist() $client = static::createClient(); static::$kernel->getContainer()->set('packagist_client', $packagistClient); static::$kernel->getContainer()->set('image_http_client', $this->imageHttpClient); - $client->request('GET', '/pugx/microsoft-lover/d/total.svg'); + $client->request('GET', '/pugx/microsoft-lover/d/total'); $this->assertTrue($client->getResponse()->isServerError()); } diff --git a/src/PUGX/BadgeBundle/Tests/Controller/PngBadgeControllerTest.php b/src/PUGX/BadgeBundle/Tests/Controller/PngBadgeControllerTest.php deleted file mode 100644 index a92a8aab..00000000 --- a/src/PUGX/BadgeBundle/Tests/Controller/PngBadgeControllerTest.php +++ /dev/null @@ -1,52 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace PUGX\BadgeBundle\Tests\Controller; - -use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; - -class PngBadgeControllerTest extends WebTestCase -{ - public function testDownloadsPngActionShouldRedirectToSvg() - { - $client = static::createClient(); - $client->request('GET', '/pugx/badge-poser/d/total.png'); - $this->assertTrue($client->getResponse()->isRedirect('/pugx/badge-poser/d/total.svg')); - } - - public function testLatestStableAction() - { - $client = static::createClient(); - $client->request('GET', '/pugx/badge-poser/version.png'); - $this->assertTrue($client->getResponse()->isRedirect('/pugx/badge-poser/version.svg')); - } - - public function testLatestUnstableAction() - { - $client = static::createClient(); - $client->request('GET', '/pugx/badge-poser/v/unstable.png'); - $this->assertTrue($client->getResponse()->isRedirect('/pugx/badge-poser/v/unstable.svg')); - } - - public function testLicenseAction() - { - $client = static::createClient(); - $client->request('GET', '/pugx/badge-poser/license.png'); - $this->assertTrue($client->getResponse()->isRedirect('/pugx/badge-poser/license.svg')); - } - - public function testIfPackageDoesntExist() - { - $client = static::createClient(); - $client->request('GET', '/pugx/microsoft-lover/d/total.png'); - $this->assertTrue($client->getResponse()->isRedirect('/pugx/microsoft-lover/d/total.svg')); - } -} diff --git a/src/PUGX/BadgeBundle/Tests/Controller/SnippetControllerTest.php b/src/PUGX/BadgeBundle/Tests/Controller/SnippetControllerTest.php index 7d2e3f16..43a96c7e 100644 --- a/src/PUGX/BadgeBundle/Tests/Controller/SnippetControllerTest.php +++ b/src/PUGX/BadgeBundle/Tests/Controller/SnippetControllerTest.php @@ -31,7 +31,7 @@ public function setUp() public function testAllAction() { - $expectedData = '{"clip_all":{"markdown":"[![Latest Stable Version](http:\/\/localhost\/pugx\/badge-poser\/v\/stable.svg)](https:\/\/packagist.org\/packages\/pugx\/badge-poser) [![Total Downloads](http:\/\/localhost\/pugx\/badge-poser\/downloads.svg)](https:\/\/packagist.org\/packages\/pugx\/badge-poser) [![Latest Unstable Version](http:\/\/localhost\/pugx\/badge-poser\/v\/unstable.svg)](https:\/\/packagist.org\/packages\/pugx\/badge-poser) [![License](http:\/\/localhost\/pugx\/badge-poser\/license.svg)](https:\/\/packagist.org\/packages\/pugx\/badge-poser)"},"latest_stable_version":{"markdown":"[![Latest Stable Version](http:\/\/localhost\/pugx\/badge-poser\/v\/stable.svg)](https:\/\/packagist.org\/packages\/pugx\/badge-poser)","img":"http:\/\/localhost\/pugx\/badge-poser\/v\/stable.svg"},"total":{"markdown":"[![Total Downloads](http:\/\/localhost\/pugx\/badge-poser\/downloads.svg)](https:\/\/packagist.org\/packages\/pugx\/badge-poser)","img":"http:\/\/localhost\/pugx\/badge-poser\/downloads.svg"},"latest_unstable_version":{"markdown":"[![Latest Unstable Version](http:\/\/localhost\/pugx\/badge-poser\/v\/unstable.svg)](https:\/\/packagist.org\/packages\/pugx\/badge-poser)","img":"http:\/\/localhost\/pugx\/badge-poser\/v\/unstable.svg"},"license":{"markdown":"[![License](http:\/\/localhost\/pugx\/badge-poser\/license.svg)](https:\/\/packagist.org\/packages\/pugx\/badge-poser)","img":"http:\/\/localhost\/pugx\/badge-poser\/license.svg"},"monthly":{"markdown":"[![Monthly Downloads](http:\/\/localhost\/pugx\/badge-poser\/d\/monthly.png)](https:\/\/packagist.org\/packages\/pugx\/badge-poser)","img":"http:\/\/localhost\/pugx\/badge-poser\/d\/monthly.png"},"daily":{"markdown":"[![Daily Downloads](http:\/\/localhost\/pugx\/badge-poser\/d\/daily.png)](https:\/\/packagist.org\/packages\/pugx\/badge-poser)","img":"http:\/\/localhost\/pugx\/badge-poser\/d\/daily.png"},"version":{"markdown":"[![Version](http:\/\/localhost\/pugx\/badge-poser\/version.svg)](https:\/\/packagist.org\/packages\/pugx\/badge-poser)","img":"http:\/\/localhost\/pugx\/badge-poser\/version.svg"},"repository":{"html":"pugx\/badge-poser"}}'; + $expectedData = '{"clip_all":{"markdown":"[![Latest Stable Version](http:\/\/localhost\/pugx\/badge-poser\/v\/stable)](https:\/\/packagist.org\/packages\/pugx\/badge-poser) [![Total Downloads](http:\/\/localhost\/pugx\/badge-poser\/downloads)](https:\/\/packagist.org\/packages\/pugx\/badge-poser) [![Latest Unstable Version](http:\/\/localhost\/pugx\/badge-poser\/v\/unstable)](https:\/\/packagist.org\/packages\/pugx\/badge-poser) [![License](http:\/\/localhost\/pugx\/badge-poser\/license)](https:\/\/packagist.org\/packages\/pugx\/badge-poser)"},"latest_stable_version":{"markdown":"[![Latest Stable Version](http:\/\/localhost\/pugx\/badge-poser\/v\/stable)](https:\/\/packagist.org\/packages\/pugx\/badge-poser)","img":"http:\/\/localhost\/pugx\/badge-poser\/v\/stable"},"total":{"markdown":"[![Total Downloads](http:\/\/localhost\/pugx\/badge-poser\/downloads)](https:\/\/packagist.org\/packages\/pugx\/badge-poser)","img":"http:\/\/localhost\/pugx\/badge-poser\/downloads"},"latest_unstable_version":{"markdown":"[![Latest Unstable Version](http:\/\/localhost\/pugx\/badge-poser\/v\/unstable)](https:\/\/packagist.org\/packages\/pugx\/badge-poser)","img":"http:\/\/localhost\/pugx\/badge-poser\/v\/unstable"},"license":{"markdown":"[![License](http:\/\/localhost\/pugx\/badge-poser\/license)](https:\/\/packagist.org\/packages\/pugx\/badge-poser)","img":"http:\/\/localhost\/pugx\/badge-poser\/license"},"monthly":{"markdown":"[![Monthly Downloads](http:\/\/localhost\/pugx\/badge-poser\/d\/monthly)](https:\/\/packagist.org\/packages\/pugx\/badge-poser)","img":"http:\/\/localhost\/pugx\/badge-poser\/d\/monthly"},"daily":{"markdown":"[![Daily Downloads](http:\/\/localhost\/pugx\/badge-poser\/d\/daily)](https:\/\/packagist.org\/packages\/pugx\/badge-poser)","img":"http:\/\/localhost\/pugx\/badge-poser\/d\/daily"},"version":{"markdown":"[![Version](http:\/\/localhost\/pugx\/badge-poser\/version)](https:\/\/packagist.org\/packages\/pugx\/badge-poser)","img":"http:\/\/localhost\/pugx\/badge-poser\/version"},"repository":{"html":"pugx\/badge-poser"}}'; $client = static::createClient(); static::$kernel->getContainer()->set('packagist_client', $this->packagistClient); diff --git a/src/PUGX/BadgeBundle/Tests/RedirectsTest.php b/src/PUGX/BadgeBundle/Tests/RedirectsTest.php new file mode 100644 index 00000000..8de9c61c --- /dev/null +++ b/src/PUGX/BadgeBundle/Tests/RedirectsTest.php @@ -0,0 +1,40 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace PUGX\BadgeBundle\Tests; + +use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; + +class RedirectsTest extends WebTestCase +{ + /** + * @dataProvider getUrlToVerify + */ + public function testOldPageShouldRedirectToNewOnes($oldUrl, $newUrl) + { + $client = static::createClient(); + $client->request('GET', $oldUrl); + $this->assertTrue($client->getResponse()->isRedirect($newUrl)); + $this->assertEquals(301, $client->getResponse()->getStatusCode()); + } + + public function getUrlToVerify() + { + return array( + array('/pugx/badge-poser/downloads.png', 'http://localhost/pugx/badge-poser/downloads'), + array('/pugx/badge-poser/d/total.png', 'http://localhost/pugx/badge-poser/d/total'), + array('/pugx/badge-poser/version.png', 'http://localhost/pugx/badge-poser/version'), + array('/pugx/badge-poser/v/unstable.png', 'http://localhost/pugx/badge-poser/v/unstable'), + array('/pugx/badge-poser/license.png', 'http://localhost/pugx/badge-poser/license'), + array('/pugx/microsoft-lover/d/total.png', 'http://localhost/pugx/microsoft-lover/d/total'), + ); + } +} diff --git a/src/PUGX/StatsBundle/Tests/FunctionalControllerTest.php b/src/PUGX/StatsBundle/Tests/FunctionalControllerTest.php index a007167f..025632f6 100644 --- a/src/PUGX/StatsBundle/Tests/FunctionalControllerTest.php +++ b/src/PUGX/StatsBundle/Tests/FunctionalControllerTest.php @@ -43,7 +43,7 @@ public function testOnDownloadsActionStatisticShouldBeCreated() $client = static::createClient(); static::$kernel->getContainer()->set('packagist_client', $this->packagistClient); ob_start(); - $client->request('GET', '/pugx/badge-poser/d/total.svg'); + $client->request('GET', '/pugx/badge-poser/d/total'); ob_clean(); $this->checkStatsCalls($client, 'pugx/badge-poser', 'downloadsAction'); } @@ -53,7 +53,7 @@ public function testOnLatestStableActionStatisticShouldBeCreated() $client = static::createClient(); static::$kernel->getContainer()->set('packagist_client', $this->packagistClient); ob_start(); - $client->request('GET', '/pugx/badge-poser/version.svg'); + $client->request('GET', '/pugx/badge-poser/version'); ob_clean(); $this->checkStatsCalls($client, 'pugx/badge-poser', 'versionAction'); } @@ -63,7 +63,7 @@ public function testOnLatestUnstableActionStatisticShouldBeCreated() $client = static::createClient(); static::$kernel->getContainer()->set('packagist_client', $this->packagistClient); ob_start(); - $client->request('GET', '/pugx/badge-poser/v/unstable.svg'); + $client->request('GET', '/pugx/badge-poser/v/unstable'); ob_clean(); $this->assertTrue($client->getResponse()->isSuccessful());