"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "public_html/lists/base/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Config/ContainerParametersResourceCheckerTest.php" between
phplist-3.4.5.tgz and phplist-3.4.6.tgz

About: phpList is a one-way email announcement delivery system for newsletters, publicity lists, notifications, and many other uses (requires PHP and MySQL).

ContainerParametersResourceCheckerTest.php  (phplist-3.4.5.tgz):ContainerParametersResourceCheckerTest.php  (phplist-3.4.6.tgz)
skipping to change at line 14 skipping to change at line 14
* This file is part of the Symfony package. * This file is part of the Symfony package.
* *
* (c) Fabien Potencier <fabien@symfony.com> * (c) Fabien Potencier <fabien@symfony.com>
* *
* For the full copyright and license information, please view the LICENSE * For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code. * file that was distributed with this source code.
*/ */
namespace Symfony\Component\DependencyInjection\Tests\Config; namespace Symfony\Component\DependencyInjection\Tests\Config;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;
use Symfony\Component\Config\ResourceCheckerInterface; use Symfony\Component\Config\ResourceCheckerInterface;
use Symfony\Component\DependencyInjection\Config\ContainerParametersResource; use Symfony\Component\DependencyInjection\Config\ContainerParametersResource;
use Symfony\Component\DependencyInjection\Config\ContainerParametersResourceChec ker; use Symfony\Component\DependencyInjection\Config\ContainerParametersResourceChec ker;
use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\ContainerInterface;
class ContainerParametersResourceCheckerTest extends TestCase class ContainerParametersResourceCheckerTest extends TestCase
{ {
/** @var ContainerParametersResource */ /** @var ContainerParametersResource */
private $resource; private $resource;
skipping to change at line 55 skipping to change at line 56
*/ */
public function testIsFresh(callable $mockContainer, $expected) public function testIsFresh(callable $mockContainer, $expected)
{ {
$mockContainer($this->container); $mockContainer($this->container);
$this->assertSame($expected, $this->resourceChecker->isFresh($this->reso urce, time())); $this->assertSame($expected, $this->resourceChecker->isFresh($this->reso urce, time()));
} }
public function isFreshProvider() public function isFreshProvider()
{ {
yield 'not fresh on missing parameter' => [function (\PHPUnit_Framework_ MockObject_MockObject $container) { yield 'not fresh on missing parameter' => [function (MockObject $contain er) {
$container->method('hasParameter')->with('locales')->willReturn(fals e); $container->method('hasParameter')->with('locales')->willReturn(fals e);
}, false]; }, false];
yield 'not fresh on different value' => [function (\PHPUnit_Framework_Mo ckObject_MockObject $container) { yield 'not fresh on different value' => [function (MockObject $container ) {
$container->method('getParameter')->with('locales')->willReturn(['nl ', 'es']); $container->method('getParameter')->with('locales')->willReturn(['nl ', 'es']);
}, false]; }, false];
yield 'fresh on every identical parameters' => [function (\PHPUnit_Frame work_MockObject_MockObject $container) { yield 'fresh on every identical parameters' => [function (MockObject $co ntainer) {
$container->expects($this->exactly(2))->method('hasParameter')->will Return(true); $container->expects($this->exactly(2))->method('hasParameter')->will Return(true);
$container->expects($this->exactly(2))->method('getParameter') $container->expects($this->exactly(2))->method('getParameter')
->withConsecutive( ->withConsecutive(
[$this->equalTo('locales')], [$this->equalTo('locales')],
[$this->equalTo('default_locale')] [$this->equalTo('default_locale')]
) )
->willReturnMap([ ->willReturnMap([
['locales', ['fr', 'en']], ['locales', ['fr', 'en']],
['default_locale', 'fr'], ['default_locale', 'fr'],
]) ])
 End of changes. 4 change blocks. 
3 lines changed or deleted 4 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)