~tcuthbert/wordpress/openstack-objectstorage

« back to all changes in this revision

Viewing changes to vendor/phpunit/phpunit/src/Runner/Version.php

  • Committer: Jacek Nykis
  • Date: 2015-02-11 15:35:31 UTC
  • Revision ID: jacek.nykis@canonical.com-20150211153531-hmy6zi0ov2qfkl0b
Initial commit

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
/*
 
3
 * This file is part of PHPUnit.
 
4
 *
 
5
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 
6
 *
 
7
 * For the full copyright and license information, please view the LICENSE
 
8
 * file that was distributed with this source code.
 
9
 */
 
10
 
 
11
/**
 
12
 * This class defines the current version of PHPUnit.
 
13
 *
 
14
 * @package    PHPUnit
 
15
 * @subpackage Runner
 
16
 * @author     Sebastian Bergmann <sebastian@phpunit.de>
 
17
 * @copyright  Sebastian Bergmann <sebastian@phpunit.de>
 
18
 * @license    http://www.opensource.org/licenses/BSD-3-Clause  The BSD 3-Clause License
 
19
 * @link       http://www.phpunit.de/
 
20
 * @since      Class available since Release 2.0.0
 
21
 */
 
22
class PHPUnit_Runner_Version
 
23
{
 
24
    private static $pharVersion;
 
25
    private static $version;
 
26
 
 
27
    /**
 
28
     * Returns the current version of PHPUnit.
 
29
     *
 
30
     * @return string
 
31
     */
 
32
    public static function id()
 
33
    {
 
34
        if (self::$pharVersion !== null) {
 
35
            return self::$pharVersion;
 
36
        }
 
37
 
 
38
        if (self::$version === null) {
 
39
            $version = new SebastianBergmann\Version('4.4.5', dirname(dirname(__DIR__)));
 
40
            self::$version = $version->getVersion();
 
41
        }
 
42
 
 
43
        return self::$version;
 
44
    }
 
45
 
 
46
    /**
 
47
     * @return string
 
48
     */
 
49
    public static function getVersionString()
 
50
    {
 
51
        return 'PHPUnit ' . self::id() . ' by Sebastian Bergmann.';
 
52
    }
 
53
 
 
54
    /**
 
55
     * @return string
 
56
     * @since  Method available since Release 4.0.0
 
57
     */
 
58
    public static function getReleaseChannel()
 
59
    {
 
60
        if (strpos(self::$pharVersion, 'alpha') !== false) {
 
61
            return '-alpha';
 
62
        }
 
63
 
 
64
        if (strpos(self::$pharVersion, 'beta') !== false) {
 
65
            return '-beta';
 
66
        }
 
67
 
 
68
        return '';
 
69
    }
 
70
}