-
-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #57 from eux/master
issue #28 license substitution in files
- Loading branch information
Showing
28 changed files
with
220 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,20 @@ | ||
imports: | ||
- { resource: config_dev.yml } | ||
|
||
|
||
# for functional test | ||
parameters: | ||
image_creator.class: PUGX\BadgeBundle\Tests\Controller\FakeImageCreator | ||
services: | ||
statistic_listener: | ||
class: PUGX\BadgeBundle\Service\Statistic\NullPersister | ||
|
||
framework: | ||
test: ~ | ||
session: | ||
storage_id: session.storage.mock_file | ||
profiler: | ||
enabled: false | ||
enabled: true | ||
|
||
web_profiler: | ||
toolbar: false | ||
intercept_redirects: false | ||
|
||
# for functional test | ||
parameters: | ||
image_creator.class: PUGX\BadgeBundle\Tests\Controller\FakeImageCreator | ||
services: | ||
stats_persister: | ||
class: PUGX\StatsBundle\Service\NullPersister |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the badge-poser package | ||
* This file is part of the badge-poser package. | ||
* | ||
* (c) Giulio De Donato <[email protected]> | ||
* (c) PUGX <https://pugx.github.io/> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the badge-poser package | ||
* This file is part of the badge-poser package. | ||
* | ||
* (c) Giulio De Donato <[email protected]> | ||
* (c) PUGX <https://pugx.github.io/> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the badge-poser package | ||
* This file is part of the badge-poser package. | ||
* | ||
* (c) Giulio De Donato <[email protected]> | ||
* (c) PUGX <https://pugx.github.io/> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
|
5 changes: 3 additions & 2 deletions
5
src/PUGX/BadgeBundle/DependencyInjection/PUGXBadgeExtension.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the badge-poser package | ||
* This file is part of the badge-poser package. | ||
* | ||
* (c) Giulio De Donato <[email protected]> | ||
* (c) PUGX <https://pugx.github.io/> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the badge-poser package | ||
* This file is part of the badge-poser package. | ||
* | ||
* (c) Giulio De Donato <[email protected]> | ||
* (c) PUGX <https://pugx.github.io/> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the badge-poser package | ||
* This file is part of the badge-poser package. | ||
* | ||
* (c) Giulio De Donato <[email protected]> | ||
* (c) PUGX <https://pugx.github.io/> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the badge-poser package | ||
* This file is part of the badge-poser package. | ||
* | ||
* (c) Giulio De Donato <[email protected]> | ||
* (c) PUGX <https://pugx.github.io/> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the badge-poser package | ||
* This file is part of the badge-poser package. | ||
* | ||
* (c) Giulio De Donato <[email protected]> | ||
* (c) PUGX <https://pugx.github.io/> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the badge-poser package | ||
* This file is part of the badge-poser package. | ||
* | ||
* (c) Giulio De Donato <[email protected]> | ||
* (c) PUGX <https://pugx.github.io/> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the badge-poser package | ||
* This file is part of the badge-poser package. | ||
* | ||
* (c) Giulio De Donato <[email protected]> | ||
* (c) PUGX <https://pugx.github.io/> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the badge-poser package | ||
* This file is part of the badge-poser package. | ||
* | ||
* (c) Giulio De Donato <[email protected]> | ||
* (c) PUGX <https://pugx.github.io/> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
|
@@ -11,10 +12,13 @@ | |
namespace PUGX\BadgeBundle\Tests\Controller; | ||
|
||
use Packagist\Api\Client; | ||
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; | ||
use PUGX\StatsBundle\Test\StatsFunctionalTest; | ||
use PUGX\StatsBundle\Service\NullPersister; | ||
|
||
class BadgeControllerTest extends WebTestCase | ||
class BadgeControllerTest extends StatsFunctionalTest | ||
{ | ||
protected $packagistClient; | ||
|
||
// this setUp fake the request/response, if you comment this function the test'd run only with internet connection | ||
public function setUp() | ||
{ | ||
|
@@ -25,7 +29,6 @@ public function setUp() | |
|
||
private function createPackagistClient($data, $status = 200) | ||
{ | ||
|
||
$packagistResponse = new \Guzzle\Http\Message\Response($status); | ||
$packagistResponse->setBody($data); | ||
$plugin = new \Guzzle\Plugin\Mock\MockPlugin(); | ||
|
@@ -42,6 +45,8 @@ public function testDownloadsAction() | |
static::$kernel->getContainer()->set('packagist_client', $this->packagistClient); | ||
$crawler = $client->request('GET', '/pugx/badge-poser/d/total.png'); | ||
$this->assertTrue($client->getResponse()->isSuccessful()); | ||
|
||
$this->checkStatsCalls($client, 'pugx/badge-poser', 'downloadsAction'); | ||
} | ||
|
||
public function testLatestStableAction() | ||
|
@@ -51,6 +56,8 @@ public function testLatestStableAction() | |
$crawler = $client->request('GET', '/pugx/badge-poser/version.png'); | ||
|
||
$this->assertTrue($client->getResponse()->isSuccessful()); | ||
|
||
$this->checkStatsCalls($client, 'pugx/badge-poser', 'versionAction'); | ||
} | ||
|
||
public function testLatestUnstableAction() | ||
|
@@ -62,6 +69,8 @@ public function testLatestUnstableAction() | |
$this->assertTrue($client->getResponse()->isSuccessful()); | ||
$response = $client->getResponse(); | ||
$this->assertRegExp('/s-maxage=3600/', $response->headers->get('Cache-Control')); | ||
|
||
$this->checkStatsCalls($client, 'pugx/badge-poser', 'versionAction'); | ||
} | ||
|
||
public function testIfPackageDoesntExist() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the badge-poser package | ||
* This file is part of the badge-poser package. | ||
* | ||
* (c) Giulio De Donato <[email protected]> | ||
* (c) PUGX <https://pugx.github.io/> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,25 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the badge-poser package | ||
* This file is part of the badge-poser package. | ||
* | ||
* (c) Giulio De Donato <[email protected]> | ||
* (c) PUGX <https://pugx.github.io/> | ||
* | ||
* 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; | ||
use PUGX\StatsBundle\Test\StatsFunctionalTest; | ||
|
||
class PageControllerTest extends WebTestCase | ||
class PageControllerTest extends StatsFunctionalTest | ||
{ | ||
public function testHomeAction() | ||
{ | ||
$client = static::createClient(); | ||
$client->enableProfiler(); | ||
|
||
$crawler = $client->request('GET', '/'); | ||
$this->assertTrue($client->getResponse()->isSuccessful()); | ||
$this->assertEquals(1, $crawler->filter('#container h1:contains("Badge Poser")')->count()); | ||
|
@@ -27,5 +29,8 @@ public function testHomeAction() | |
$this->assertEquals(1, $crawler->filter('#container h4:contains("Monthly downloads")')->count()); | ||
$this->assertEquals(1, $crawler->filter('#container h4:contains("Latest Stable Version")')->count()); | ||
$this->assertEquals(1, $crawler->filter('#container h4:contains("Latest Unstable Version")')->count()); | ||
|
||
$this->checkStatsAreNotIncremented($client); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the badge-poser package | ||
* This file is part of the badge-poser package. | ||
* | ||
* (c) Giulio De Donato <[email protected]> | ||
* (c) PUGX <https://pugx.github.io/> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the badge-poser package | ||
* This file is part of the badge-poser package. | ||
* | ||
* (c) Giulio De Donato <[email protected]> | ||
* (c) PUGX <https://pugx.github.io/> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
src/PUGX/StatsBundle/DependencyInjection/PUGXStatsExtension.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the badge-poser package | ||
* This file is part of the badge-poser package. | ||
* | ||
* (c) Giulio De Donato <[email protected]> | ||
* (c) PUGX <https://pugx.github.io/> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.