Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue #28 license substitution in files #57

Merged
merged 4 commits into from
Jun 7, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/config/config_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ imports:
- { resource: config.yml }

services:
stats_listener:
stats_persister:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you agree with this change?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure!

class: PUGX\StatsBundle\Service\NullPersister

framework:
Expand Down
17 changes: 8 additions & 9 deletions app/config/config_test.yml
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
10 changes: 5 additions & 5 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions src/PUGX/BadgeBundle/Controller/BadgeController.php
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 <http:https://pugx.github.io/>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand All @@ -17,7 +18,7 @@
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Cache;
use PUGX\BadgeBundle\Exception\UnexpectedValueException;
use \UnexpectedValueException;

/**
* Class BadgeController.
Expand Down
5 changes: 3 additions & 2 deletions src/PUGX/BadgeBundle/Controller/PageController.php
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 <http:https://pugx.github.io/>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down
5 changes: 3 additions & 2 deletions src/PUGX/BadgeBundle/DependencyInjection/Configuration.php
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 <http:https://pugx.github.io/>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down
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 <http:https://pugx.github.io/>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down
17 changes: 0 additions & 17 deletions src/PUGX/BadgeBundle/Exception/BadMethodCallException.php

This file was deleted.

20 changes: 0 additions & 20 deletions src/PUGX/BadgeBundle/Exception/ExceptionInterface.php

This file was deleted.

22 changes: 0 additions & 22 deletions src/PUGX/BadgeBundle/Exception/InvalidArgumentException.php

This file was deleted.

22 changes: 0 additions & 22 deletions src/PUGX/BadgeBundle/Exception/UnexpectedValueException.php

This file was deleted.

5 changes: 3 additions & 2 deletions src/PUGX/BadgeBundle/PUGXBadgeBundle.php
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 <http:https://pugx.github.io/>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down
5 changes: 3 additions & 2 deletions src/PUGX/BadgeBundle/Package/ApiPackageInterface.php
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 <http:https://pugx.github.io/>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down
5 changes: 3 additions & 2 deletions src/PUGX/BadgeBundle/Package/Package.php
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 <http:https://pugx.github.io/>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down
5 changes: 3 additions & 2 deletions src/PUGX/BadgeBundle/Package/PackageInterface.php
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 <http:https://pugx.github.io/>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down
11 changes: 6 additions & 5 deletions src/PUGX/BadgeBundle/Service/ImageCreator.php
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 <http:https://pugx.github.io/>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand All @@ -11,7 +12,7 @@
namespace PUGX\BadgeBundle\Service;

use Symfony\Bridge\Monolog\Logger;
use PUGX\BadgeBundle\Exception\InvalidArgumentException;
use \InvalidArgumentException;

/**
* Class ImageCreator
Expand Down Expand Up @@ -55,7 +56,7 @@ public function __construct(Logger $logger, $fontPath, $imagePath, $defaultFont
* @param mixed $number number to be normalized
*
* @return int
* @throws \PUGX\BadgeBundle\Exception\InvalidArgumentException
* @throws \InvalidArgumentException
*/
private function normalizeNumber($number)
{
Expand Down Expand Up @@ -108,7 +109,7 @@ public function destroyImage($image)
* @param int $maxChar max characters
*
* @return string
* @throws \PUGX\BadgeBundle\Exception\InvalidArgumentException
* @throws \InvalidArgumentException
*/
public function transformNumberToReadableFormat($number, $maxChar = 6)
{
Expand Down
5 changes: 3 additions & 2 deletions src/PUGX/BadgeBundle/Service/ImageCreatorInterface.php
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 <http:https://pugx.github.io/>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down
11 changes: 10 additions & 1 deletion src/PUGX/BadgeBundle/Service/PackageManager.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
<?php

/*
* This file is part of the badge-poser package.
*
* (c) PUGX <http: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\Service;

use Packagist\Api\Client;
use Packagist\Api\Result\Package as ApiPackage;

use PUGX\BadgeBundle\Package\Package;
use PUGX\BadgeBundle\Package\PackageInterface;
use PUGX\BadgeBundle\Exception\UnexpectedValueException;
use \UnexpectedValueException;

/**
* This class is intended to load ApiPackage, create, and work with the Package object
Expand Down
19 changes: 14 additions & 5 deletions src/PUGX/BadgeBundle/Tests/Controller/BadgeControllerTest.php
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 <http:https://pugx.github.io/>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand All @@ -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()
{
Expand All @@ -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();
Expand All @@ -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()
Expand All @@ -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()
Expand All @@ -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()
Expand Down
Loading