updated-packages

This commit is contained in:
RafficMohammed
2023-01-08 00:13:22 +05:30
parent 3ff7df7487
commit da241bacb6
12659 changed files with 563377 additions and 510538 deletions

View File

@@ -32,7 +32,7 @@ final class ConsoleTest extends TestCase
*/
public function testCanDetectIfStdoutIsInteractiveByDefault(): void
{
$this->assertInternalType('boolean', $this->console->isInteractive());
$this->assertIsBool($this->console->isInteractive());
}
/**
@@ -41,7 +41,7 @@ final class ConsoleTest extends TestCase
*/
public function testCanDetectIfFileDescriptorIsInteractive(): void
{
$this->assertInternalType('boolean', $this->console->isInteractive(\STDOUT));
$this->assertIsBool($this->console->isInteractive(\STDOUT));
}
/**
@@ -50,7 +50,7 @@ final class ConsoleTest extends TestCase
*/
public function testCanDetectColorSupport(): void
{
$this->assertInternalType('boolean', $this->console->hasColorSupport());
$this->assertIsBool($this->console->hasColorSupport());
}
/**
@@ -59,6 +59,6 @@ final class ConsoleTest extends TestCase
*/
public function testCanDetectNumberOfColumns(): void
{
$this->assertInternalType('integer', $this->console->getNumberOfColumns());
$this->assertIsInt($this->console->getNumberOfColumns());
}
}

View File

@@ -33,4 +33,28 @@ final class OperatingSystemTest extends TestCase
{
$this->assertEquals('Linux', $this->os->getFamily());
}
/**
* @requires OS Darwin
*/
public function testFamilyReturnsDarwinWhenRunningOnDarwin(): void
{
$this->assertEquals('Darwin', $this->os->getFamily());
}
/**
* @requires OS Windows
*/
public function testGetFamilyReturnsWindowsWhenRunningOnWindows(): void
{
$this->assertSame('Windows', $this->os->getFamily());
}
/**
* @requires PHP 7.2.0
*/
public function testGetFamilyReturnsPhpOsFamilyWhenRunningOnPhp72AndGreater(): void
{
$this->assertSame(\PHP_OS_FAMILY, $this->os->getFamily());
}
}

View File

@@ -27,83 +27,139 @@ final class RuntimeTest extends TestCase
}
/**
* @todo Now that this component is PHP 7-only and uses return type declarations
* this test makes even less sense than before
* @requires extension xdebug
*/
public function testAbilityToCollectCodeCoverageCanBeAssessed(): void
public function testCanCollectCodeCoverageWhenXdebugExtensionIsEnabled(): void
{
$this->assertInternalType('boolean', $this->env->canCollectCodeCoverage());
$this->assertTrue($this->env->canCollectCodeCoverage());
}
/**
* @todo Now that this component is PHP 7-only and uses return type declarations
* this test makes even less sense than before
* @requires extension pcov
*/
public function testCanCollectCodeCoverageWhenPcovExtensionIsEnabled(): void
{
$this->assertTrue($this->env->canCollectCodeCoverage());
}
public function testCanCollectCodeCoverageWhenRunningOnPhpdbg(): void
{
$this->markTestSkippedWhenNotRunningOnPhpdbg();
$this->assertTrue($this->env->canCollectCodeCoverage());
}
public function testBinaryCanBeRetrieved(): void
{
$this->assertInternalType('string', $this->env->getBinary());
$this->assertNotEmpty($this->env->getBinary());
}
/**
* @todo Now that this component is PHP 7-only and uses return type declarations
* this test makes even less sense than before
* @requires PHP
*/
public function testCanBeDetected(): void
public function testIsHhvmReturnsFalseWhenRunningOnPhp(): void
{
$this->assertInternalType('boolean', $this->env->isHHVM());
$this->assertFalse($this->env->isHHVM());
}
/**
* @todo Now that this component is PHP 7-only and uses return type declarations
* this test makes even less sense than before
* @requires PHP
*/
public function testCanBeDetected2(): void
public function testIsPhpReturnsTrueWhenRunningOnPhp(): void
{
$this->assertInternalType('boolean', $this->env->isPHP());
$this->markTestSkippedWhenRunningOnPhpdbg();
$this->assertTrue($this->env->isPHP());
}
/**
* @todo Now that this component is PHP 7-only and uses return type declarations
* this test makes even less sense than before
* @requires extension pcov
*/
public function testPCOVCanBeDetected(): void
{
$this->assertTrue($this->env->hasPCOV());
}
public function testPhpdbgCanBeDetected(): void
{
$this->markTestSkippedWhenNotRunningOnPhpdbg();
$this->assertTrue($this->env->hasPHPDBGCodeCoverage());
}
/**
* @requires extension xdebug
*/
public function testXdebugCanBeDetected(): void
{
$this->assertInternalType('boolean', $this->env->hasXdebug());
$this->markTestSkippedWhenRunningOnPhpdbg();
$this->assertTrue($this->env->hasXdebug());
}
/**
* @todo Now that this component is PHP 7-only and uses return type declarations
* this test makes even less sense than before
*/
public function testNameAndVersionCanBeRetrieved(): void
{
$this->assertInternalType('string', $this->env->getNameWithVersion());
$this->assertNotEmpty($this->env->getNameWithVersion());
}
public function testGetNameReturnsPhpdbgWhenRunningOnPhpdbg(): void
{
$this->markTestSkippedWhenNotRunningOnPhpdbg();
$this->assertSame('PHPDBG', $this->env->getName());
}
/**
* @todo Now that this component is PHP 7-only and uses return type declarations
* this test makes even less sense than before
* @requires PHP
*/
public function testNameCanBeRetrieved(): void
public function testGetNameReturnsPhpdbgWhenRunningOnPhp(): void
{
$this->assertInternalType('string', $this->env->getName());
$this->markTestSkippedWhenRunningOnPhpdbg();
$this->assertSame('PHP', $this->env->getName());
}
public function testNameAndCodeCoverageDriverCanBeRetrieved(): void
{
$this->assertNotEmpty($this->env->getNameWithVersionAndCodeCoverageDriver());
}
/**
* @todo Now that this component is PHP 7-only and uses return type declarations
* this test makes even less sense than before
* @requires PHP
*/
public function testVersionCanBeRetrieved(): void
public function testGetVersionReturnsPhpVersionWhenRunningPhp(): void
{
$this->assertInternalType('string', $this->env->getVersion());
$this->assertSame(\PHP_VERSION, $this->env->getVersion());
}
/**
* @todo Now that this component is PHP 7-only and uses return type declarations
* this test makes even less sense than before
* @requires PHP
*/
public function testVendorUrlCanBeRetrieved(): void
public function testGetVendorUrlReturnsPhpDotNetWhenRunningPhp(): void
{
$this->assertInternalType('string', $this->env->getVendorUrl());
$this->assertSame('https://secure.php.net/', $this->env->getVendorUrl());
}
private function markTestSkippedWhenNotRunningOnPhpdbg(): void
{
if ($this->isRunningOnPhpdbg()) {
return;
}
$this->markTestSkipped('PHPDBG is required.');
}
private function markTestSkippedWhenRunningOnPhpdbg(): void
{
if (!$this->isRunningOnPhpdbg()) {
return;
}
$this->markTestSkipped('Cannot run on PHPDBG');
}
private function isRunningOnPhpdbg(): bool
{
return \PHP_SAPI === 'phpdbg';
}
}