diff --git a/VERSION b/VERSION index f38e5b3..667dcb6 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.2407.311920 +0.2407.311946 diff --git a/src/Environment.php b/src/Environment.php deleted file mode 100644 index ed07b27..0000000 --- a/src/Environment.php +++ /dev/null @@ -1,340 +0,0 @@ -write($line); - $this->write(Environment::NEWLINE); + $this->write(PHP_EOL); } abstract public function writeChar(string $char): void; diff --git a/src/Index.php b/src/Index.php new file mode 100644 index 0000000..96fb448 --- /dev/null +++ b/src/Index.php @@ -0,0 +1,34 @@ +assertEmpty(Environment::getVariable($varName)); - - Environment::setVariable($varName, 'the'); - $varValue = Environment::getVariable($varName); - $this->assertEquals('the', $varValue); - - Environment::removeVariable($varName); - $this->assertEmpty(Environment::getVariable($varName)); - } - - public function testIndexVersion(): void { - $strVersion = trim(file_get_contents(__DIR__ . '/../VERSION')); - $rawVersion = explode('.', $strVersion); - $version = Environment::getIndexVersion(); - - $this->assertEquals((int)$rawVersion[0], $version->getMajor()); - $this->assertEquals((int)$rawVersion[1], $version->getMinor()); - $this->assertEquals((int)$rawVersion[2], $version->getPatch()); - $this->assertEquals($strVersion, (string)$version); - } - - public function testPHPAndExtVersion(): void { - $version = Environment::getPHPVersion(); - $extVersion = Environment::getPHPExtensionVersion('Core'); - - $this->assertEquals(PHP_MAJOR_VERSION, $version->getMajor()); - $this->assertEquals(PHP_MINOR_VERSION, $version->getMinor()); - $this->assertEquals(PHP_RELEASE_VERSION, $version->getPatch()); - $this->assertTrue($version->equals($extVersion)); - } - - // not really sure how you would test the platform and sapi functions, so i won't -} diff --git a/tests/IndexTest.php b/tests/IndexTest.php new file mode 100644 index 0000000..72c3aa1 --- /dev/null +++ b/tests/IndexTest.php @@ -0,0 +1,22 @@ +assertIsString($expectedVersion); + + $expectedVersion = trim($expectedVersion); + $this->assertEquals($expectedVersion, Index::version()); + } +}