Phalcon\Test\Unit\VersionTest::testVersionGetToGetId PHP Метод

testVersionGetToGetId() публичный Метод

Tests the get() translation to getId()
С версии: 2014-09-04
Автор: Nikolaos Dimopoulos ([email protected])
    public function testVersionGetToGetId()
    {
        $this->specify("get() to getId() does not produce the same result", function () {
            $version = Version::get();
            $chunks = explode(' ', $version);
            $special = '4';
            $specialNo = '0';
            // There are special versions
            if (count($chunks) > 1) {
                $specialNo = $chunks[2];
                $special = $this->specialToNumber($chunks[1]);
            }
            // Now the version itself
            $verChunks = explode('.', $chunks[0]);
            $major = intval($verChunks[0]);
            $med = substr("00" . intval($verChunks[1]), -2);
            $min = substr("00" . intval($verChunks[2]), -2);
            $expected = "{$major}{$med}{$min}{$special}{$specialNo}";
            $actual = Version::getId();
            expect($actual)->equals($expected);
        });
    }