Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ignore phpunit.xml and coverage dir report/
Integration test for GuesserCompilerPass Add tests for LocaleExtension Add tests for LocaleListener Add tests for EventListener\LocaleUpdate Add tests for LocaleType Remove unused private method getPrimaryLanguage Add argument to test docblock Add tests for LocaleGuesserManager Add tests for SessionLocaleGuesser Add tests for LocaleInformation Add LocaleSession tests Add LocaleSwitchHelper tests Add integration tests for LocaleSwitcher Add tests for LocaleAllowedValidator Add LocaleValidator tests Add LuneticsLocaleBundle test Removed refernces to the intl extension
- Loading branch information
1 parent
b22d844
commit efb497f
Showing
22 changed files
with
754 additions
and
145 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
vendor/ | ||
composer.phar | ||
composer.lock | ||
phpunit.xml | ||
report/ |
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 |
---|---|---|
|
@@ -40,6 +40,7 @@ class LocaleGuesserManager | |
* @var array | ||
*/ | ||
private $preferredLocales; | ||
|
||
/** | ||
* @var LoggerInterface | ||
*/ | ||
|
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
63 changes: 63 additions & 0 deletions
63
Tests/DependencyInjection/Compiler/GuesserCompilerPassTest.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 |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<?php | ||
/** | ||
* This file is part of the LuneticsLocaleBundle package. | ||
* | ||
* <https://github.com/lunetics/LocaleBundle/> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that is distributed with this source code. | ||
*/ | ||
namespace Lunetics\LocaleBundle\Tests\DependencyInjection\Compiler; | ||
|
||
use Lunetics\LocaleBundle\DependencyInjection\Compiler\GuesserCompilerPass; | ||
use Symfony\Component\DependencyInjection\ContainerBuilder; | ||
|
||
/** | ||
* @author Kevin Archer <ka@kevinarcher.ca> | ||
*/ | ||
class GuesserCompilerPassTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
public function testProcess() | ||
{ | ||
$container = new ContainerBuilder(); | ||
|
||
$container | ||
->register('lunetics_locale.guesser_manager') | ||
; | ||
|
||
$container | ||
->register('lunetics_locale.query_guesser') | ||
->addTag('lunetics_locale.guesser', array('alias' => 'query')) | ||
; | ||
|
||
$container | ||
->register('lunetics_locale.browser_guesser') | ||
->addTag('lunetics_locale.guesser', array('alias' => 'browser')) | ||
; | ||
|
||
$container->setParameter('lunetics_locale.guessing_order', array('query')); | ||
|
||
$this->process($container); | ||
|
||
$methodCalls = $container | ||
->getDefinition('lunetics_locale.guesser_manager') | ||
->getMethodCalls(); | ||
|
||
$this->assertCount( | ||
1, | ||
$methodCalls | ||
); | ||
|
||
$methodName = $methodCalls[0][0]; | ||
$argument = $methodCalls[0][1][1]; | ||
|
||
$this->assertEquals('addGuesser', $methodName); | ||
$this->assertEquals('query', $argument); | ||
} | ||
|
||
protected function process(ContainerBuilder $container) | ||
{ | ||
$pass = new GuesserCompilerPass(); | ||
$pass->process($container); | ||
} | ||
} |
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.