xref: /dokuwiki/_test/tests/InfoTest.php (revision a42c05d2dd170bfdf65b34862ce9ed085297d733)
1*a42c05d2SAndreas Gohr<?php
2*a42c05d2SAndreas Gohr
3*a42c05d2SAndreas Gohrnamespace dokuwiki\test;
4*a42c05d2SAndreas Gohr
5*a42c05d2SAndreas Gohrclass InfoTest extends \DokuWikiTest
6*a42c05d2SAndreas Gohr{
7*a42c05d2SAndreas Gohr
8*a42c05d2SAndreas Gohr    /**
9*a42c05d2SAndreas Gohr     * @see testParseVersionString
10*a42c05d2SAndreas Gohr     */
11*a42c05d2SAndreas Gohr    public function provideVersions()
12*a42c05d2SAndreas Gohr    {
13*a42c05d2SAndreas Gohr        return [
14*a42c05d2SAndreas Gohr            [
15*a42c05d2SAndreas Gohr                'rc2010-10-07 "Lazy Sunday"',
16*a42c05d2SAndreas Gohr                [
17*a42c05d2SAndreas Gohr                    'type' => 'rc',
18*a42c05d2SAndreas Gohr                    'date' => '2010-10-07',
19*a42c05d2SAndreas Gohr                    'hotfix' => '',
20*a42c05d2SAndreas Gohr                    'version' => '2010-10-07rc',
21*a42c05d2SAndreas Gohr                    'codename' => 'Lazy Sunday',
22*a42c05d2SAndreas Gohr                    'raw' => 'rc2010-10-07 "Lazy Sunday"',
23*a42c05d2SAndreas Gohr                ],
24*a42c05d2SAndreas Gohr            ],
25*a42c05d2SAndreas Gohr            [
26*a42c05d2SAndreas Gohr                '2017-02-19d "Frusterick Manners"',
27*a42c05d2SAndreas Gohr                [
28*a42c05d2SAndreas Gohr                    'type' => 'stable',
29*a42c05d2SAndreas Gohr                    'date' => '2017-02-19',
30*a42c05d2SAndreas Gohr                    'hotfix' => 'd',
31*a42c05d2SAndreas Gohr                    'version' => '2017-02-19d',
32*a42c05d2SAndreas Gohr                    'codename' => 'Frusterick Manners',
33*a42c05d2SAndreas Gohr                    'raw' => '2017-02-19d "Frusterick Manners"',
34*a42c05d2SAndreas Gohr                ],
35*a42c05d2SAndreas Gohr            ],
36*a42c05d2SAndreas Gohr            [
37*a42c05d2SAndreas Gohr                '2017-02-19 "Frusterick Manners"',
38*a42c05d2SAndreas Gohr                [
39*a42c05d2SAndreas Gohr                    'type' => 'stable',
40*a42c05d2SAndreas Gohr                    'date' => '2017-02-19',
41*a42c05d2SAndreas Gohr                    'hotfix' => '',
42*a42c05d2SAndreas Gohr                    'version' => '2017-02-19',
43*a42c05d2SAndreas Gohr                    'codename' => 'Frusterick Manners',
44*a42c05d2SAndreas Gohr                    'raw' => '2017-02-19 "Frusterick Manners"',
45*a42c05d2SAndreas Gohr                ],
46*a42c05d2SAndreas Gohr            ],
47*a42c05d2SAndreas Gohr        ];
48*a42c05d2SAndreas Gohr    }
49*a42c05d2SAndreas Gohr
50*a42c05d2SAndreas Gohr    /**
51*a42c05d2SAndreas Gohr     * @dataProvider provideVersions
52*a42c05d2SAndreas Gohr     */
53*a42c05d2SAndreas Gohr    public function testParseVersionString($version, $expected)
54*a42c05d2SAndreas Gohr    {
55*a42c05d2SAndreas Gohr        $this->assertEquals($expected, \dokuwiki\Info::parseVersionString($version));
56*a42c05d2SAndreas Gohr    }
57*a42c05d2SAndreas Gohr
58*a42c05d2SAndreas Gohr}
59