aboutsummaryrefslogtreecommitdiffhomepage
path: root/vendor/symfony/intl/Symfony/Component/Intl/Tests/Util/VersionTest.php
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas.loeuillet@gmail.com>2013-08-04 17:50:34 +0200
committerNicolas LÅ“uillet <nicolas.loeuillet@gmail.com>2013-08-04 17:50:34 +0200
commit46b77928f746a4231d064774b5b67fd892c7ce86 (patch)
treee3ea690b3f0def1744ddae758923cf92171ef985 /vendor/symfony/intl/Symfony/Component/Intl/Tests/Util/VersionTest.php
parent68abd9c71b1d2f7bb2e9d21819584d1d15005b25 (diff)
downloadwallabag-46b77928f746a4231d064774b5b67fd892c7ce86.tar.gz
wallabag-46b77928f746a4231d064774b5b67fd892c7ce86.tar.zst
wallabag-46b77928f746a4231d064774b5b67fd892c7ce86.zip
rm vendor
Diffstat (limited to 'vendor/symfony/intl/Symfony/Component/Intl/Tests/Util/VersionTest.php')
-rw-r--r--vendor/symfony/intl/Symfony/Component/Intl/Tests/Util/VersionTest.php87
1 files changed, 0 insertions, 87 deletions
diff --git a/vendor/symfony/intl/Symfony/Component/Intl/Tests/Util/VersionTest.php b/vendor/symfony/intl/Symfony/Component/Intl/Tests/Util/VersionTest.php
deleted file mode 100644
index 60cec6c0..00000000
--- a/vendor/symfony/intl/Symfony/Component/Intl/Tests/Util/VersionTest.php
+++ /dev/null
@@ -1,87 +0,0 @@
1<?php
2
3/*
4 * This file is part of the Symfony package.
5 *
6 * (c) Fabien Potencier <fabien@symfony.com>
7 *
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
10 */
11
12namespace Symfony\Component\Intl\Tests\Util;
13
14use Symfony\Component\Intl\Util\Version;
15
16/**
17 * @author Bernhard Schussek <bschussek@gmail.com>
18 */
19class VersionTest extends \PHPUnit_Framework_TestCase
20{
21 public function normalizeProvider()
22 {
23 return array(
24 array(null, '1', '1'),
25 array(null, '1.2', '1.2'),
26 array(null, '1.2.3', '1.2.3'),
27 array(null, '1.2.3.4', '1.2.3.4'),
28 array(1, '1', '1'),
29 array(1, '1.2', '1'),
30 array(1, '1.2.3', '1'),
31 array(1, '1.2.3.4', '1'),
32 array(2, '1', '1'),
33 array(2, '1.2', '1.2'),
34 array(2, '1.2.3', '1.2'),
35 array(2, '1.2.3.4', '1.2'),
36 array(3, '1', '1'),
37 array(3, '1.2', '1.2'),
38 array(3, '1.2.3', '1.2.3'),
39 array(3, '1.2.3.4', '1.2.3'),
40 array(4, '1', '1'),
41 array(4, '1.2', '1.2'),
42 array(4, '1.2.3', '1.2.3'),
43 array(4, '1.2.3.4', '1.2.3.4'),
44 );
45 }
46
47 /**
48 * @dataProvider normalizeProvider
49 */
50 public function testNormalize($precision, $version, $result)
51 {
52 $this->assertSame($result, Version::normalize($version, $precision));
53 }
54
55 public function compareProvider()
56 {
57 return array(
58 array(null, '1', '==', '1', true),
59 array(null, '1.0', '==', '1.1', false),
60 array(null, '1.0.0', '==', '1.0.1', false),
61 array(null, '1.0.0.0', '==', '1.0.0.1', false),
62
63 array(1, '1', '==', '1', true),
64 array(1, '1.0', '==', '1.1', true),
65 array(1, '1.0.0', '==', '1.0.1', true),
66 array(1, '1.0.0.0', '==', '1.0.0.1', true),
67
68 array(2, '1', '==', '1', true),
69 array(2, '1.0', '==', '1.1', false),
70 array(2, '1.0.0', '==', '1.0.1', true),
71 array(2, '1.0.0.0', '==', '1.0.0.1', true),
72
73 array(3, '1', '==', '1', true),
74 array(3, '1.0', '==', '1.1', false),
75 array(3, '1.0.0', '==', '1.0.1', false),
76 array(3, '1.0.0.0', '==', '1.0.0.1', true),
77 );
78 }
79
80 /**
81 * @dataProvider compareProvider
82 */
83 public function testCompare($precision, $version1, $operator, $version2, $result)
84 {
85 $this->assertSame($result, Version::compare($version1, $version2, $operator, $precision));
86 }
87}