mirror of
https://github.com/wallabag/wallabag.git
synced 2025-09-10 18:51:02 +00:00
twig implementation
This commit is contained in:
parent
2b840e0cfb
commit
4f5b44bd3b
1418 changed files with 108207 additions and 1586 deletions
111
vendor/symfony/intl/Symfony/Component/Intl/Tests/Util/IcuVersionTest.php
vendored
Normal file
111
vendor/symfony/intl/Symfony/Component/Intl/Tests/Util/IcuVersionTest.php
vendored
Normal file
|
@ -0,0 +1,111 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Intl\Tests\Util;
|
||||
|
||||
use Symfony\Component\Intl\Util\IcuVersion;
|
||||
|
||||
/**
|
||||
* @author Bernhard Schussek <bschussek@gmail.com>
|
||||
*/
|
||||
class IcuVersionTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function normalizeProvider()
|
||||
{
|
||||
return array(
|
||||
array(null, '1', '10'),
|
||||
array(null, '1.2', '12'),
|
||||
array(null, '1.2.3', '12.3'),
|
||||
array(null, '1.2.3.4', '12.3.4'),
|
||||
array(1, '1', '10'),
|
||||
array(1, '1.2', '12'),
|
||||
array(1, '1.2.3', '12'),
|
||||
array(1, '1.2.3.4', '12'),
|
||||
array(2, '1', '10'),
|
||||
array(2, '1.2', '12'),
|
||||
array(2, '1.2.3', '12.3'),
|
||||
array(2, '1.2.3.4', '12.3'),
|
||||
array(3, '1', '10'),
|
||||
array(3, '1.2', '12'),
|
||||
array(3, '1.2.3', '12.3'),
|
||||
array(3, '1.2.3.4', '12.3.4'),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider normalizeProvider
|
||||
*/
|
||||
public function testNormalize($precision, $version, $result)
|
||||
{
|
||||
$this->assertSame($result, IcuVersion::normalize($version, $precision));
|
||||
}
|
||||
|
||||
public function compareProvider()
|
||||
{
|
||||
return array(
|
||||
array(null, '1', '==', '1', true),
|
||||
array(null, '1.0', '==', '1.1', false),
|
||||
array(null, '1.0.0', '==', '1.0.1', false),
|
||||
array(null, '1.0.0.0', '==', '1.0.0.1', false),
|
||||
array(null, '1.0.0.0.0', '==', '1.0.0.0.1', false),
|
||||
|
||||
array(null, '1', '==', '10', true),
|
||||
array(null, '1.0', '==', '11', false),
|
||||
array(null, '1.0.0', '==', '10.1', false),
|
||||
array(null, '1.0.0.0', '==', '10.0.1', false),
|
||||
array(null, '1.0.0.0.0', '==', '10.0.0.1', false),
|
||||
|
||||
array(1, '1', '==', '1', true),
|
||||
array(1, '1.0', '==', '1.1', false),
|
||||
array(1, '1.0.0', '==', '1.0.1', true),
|
||||
array(1, '1.0.0.0', '==', '1.0.0.1', true),
|
||||
array(1, '1.0.0.0.0', '==', '1.0.0.0.1', true),
|
||||
|
||||
array(1, '1', '==', '10', true),
|
||||
array(1, '1.0', '==', '11', false),
|
||||
array(1, '1.0.0', '==', '10.1', true),
|
||||
array(1, '1.0.0.0', '==', '10.0.1', true),
|
||||
array(1, '1.0.0.0.0', '==', '10.0.0.1', true),
|
||||
|
||||
array(2, '1', '==', '1', true),
|
||||
array(2, '1.0', '==', '1.1', false),
|
||||
array(2, '1.0.0', '==', '1.0.1', false),
|
||||
array(2, '1.0.0.0', '==', '1.0.0.1', true),
|
||||
array(2, '1.0.0.0.0', '==', '1.0.0.0.1', true),
|
||||
|
||||
array(2, '1', '==', '10', true),
|
||||
array(2, '1.0', '==', '11', false),
|
||||
array(2, '1.0.0', '==', '10.1', false),
|
||||
array(2, '1.0.0.0', '==', '10.0.1', true),
|
||||
array(2, '1.0.0.0.0', '==', '10.0.0.1', true),
|
||||
|
||||
array(3, '1', '==', '1', true),
|
||||
array(3, '1.0', '==', '1.1', false),
|
||||
array(3, '1.0.0', '==', '1.0.1', false),
|
||||
array(3, '1.0.0.0', '==', '1.0.0.1', false),
|
||||
array(3, '1.0.0.0.0', '==', '1.0.0.0.1', true),
|
||||
|
||||
array(3, '1', '==', '10', true),
|
||||
array(3, '1.0', '==', '11', false),
|
||||
array(3, '1.0.0', '==', '10.1', false),
|
||||
array(3, '1.0.0.0', '==', '10.0.1', false),
|
||||
array(3, '1.0.0.0.0', '==', '10.0.0.1', true),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider compareProvider
|
||||
*/
|
||||
public function testCompare($precision, $version1, $operator, $version2, $result)
|
||||
{
|
||||
$this->assertSame($result, IcuVersion::compare($version1, $version2, $operator, $precision));
|
||||
}
|
||||
}
|
87
vendor/symfony/intl/Symfony/Component/Intl/Tests/Util/VersionTest.php
vendored
Normal file
87
vendor/symfony/intl/Symfony/Component/Intl/Tests/Util/VersionTest.php
vendored
Normal file
|
@ -0,0 +1,87 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Intl\Tests\Util;
|
||||
|
||||
use Symfony\Component\Intl\Util\Version;
|
||||
|
||||
/**
|
||||
* @author Bernhard Schussek <bschussek@gmail.com>
|
||||
*/
|
||||
class VersionTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function normalizeProvider()
|
||||
{
|
||||
return array(
|
||||
array(null, '1', '1'),
|
||||
array(null, '1.2', '1.2'),
|
||||
array(null, '1.2.3', '1.2.3'),
|
||||
array(null, '1.2.3.4', '1.2.3.4'),
|
||||
array(1, '1', '1'),
|
||||
array(1, '1.2', '1'),
|
||||
array(1, '1.2.3', '1'),
|
||||
array(1, '1.2.3.4', '1'),
|
||||
array(2, '1', '1'),
|
||||
array(2, '1.2', '1.2'),
|
||||
array(2, '1.2.3', '1.2'),
|
||||
array(2, '1.2.3.4', '1.2'),
|
||||
array(3, '1', '1'),
|
||||
array(3, '1.2', '1.2'),
|
||||
array(3, '1.2.3', '1.2.3'),
|
||||
array(3, '1.2.3.4', '1.2.3'),
|
||||
array(4, '1', '1'),
|
||||
array(4, '1.2', '1.2'),
|
||||
array(4, '1.2.3', '1.2.3'),
|
||||
array(4, '1.2.3.4', '1.2.3.4'),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider normalizeProvider
|
||||
*/
|
||||
public function testNormalize($precision, $version, $result)
|
||||
{
|
||||
$this->assertSame($result, Version::normalize($version, $precision));
|
||||
}
|
||||
|
||||
public function compareProvider()
|
||||
{
|
||||
return array(
|
||||
array(null, '1', '==', '1', true),
|
||||
array(null, '1.0', '==', '1.1', false),
|
||||
array(null, '1.0.0', '==', '1.0.1', false),
|
||||
array(null, '1.0.0.0', '==', '1.0.0.1', false),
|
||||
|
||||
array(1, '1', '==', '1', true),
|
||||
array(1, '1.0', '==', '1.1', true),
|
||||
array(1, '1.0.0', '==', '1.0.1', true),
|
||||
array(1, '1.0.0.0', '==', '1.0.0.1', true),
|
||||
|
||||
array(2, '1', '==', '1', true),
|
||||
array(2, '1.0', '==', '1.1', false),
|
||||
array(2, '1.0.0', '==', '1.0.1', true),
|
||||
array(2, '1.0.0.0', '==', '1.0.0.1', true),
|
||||
|
||||
array(3, '1', '==', '1', true),
|
||||
array(3, '1.0', '==', '1.1', false),
|
||||
array(3, '1.0.0', '==', '1.0.1', false),
|
||||
array(3, '1.0.0.0', '==', '1.0.0.1', true),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider compareProvider
|
||||
*/
|
||||
public function testCompare($precision, $version1, $operator, $version2, $result)
|
||||
{
|
||||
$this->assertSame($result, Version::compare($version1, $version2, $operator, $precision));
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue