prefix stringlengths 512 512 | suffix stringlengths 256 256 | middle stringlengths 14 229 | meta dict |
|---|---|---|---|
se;
use PHPUnit\Metadata\MetadataCollection;
use PHPUnit\TextUI\Configuration\FilterDirectoryCollection;
use PHPUnit\TextUI\Configuration\FilterFileCollection;
use PHPUnit\TextUI\Configuration\Source;
use PHPUnit\TextUI\Output\Printer;
#[CoversClass(ProgressPrinter::class)]
#[Small]
final class ProgressPrinterTest ext... | gContainsString('1 / 1 (100%)', $buffer());
}
public function testPrintsErrorBeforeTestClassMethodErrored(): void
{
[$printer, $buffer] = $this->printer();
$progress = $this->progressPrinter($printer);
$progr |
$progress->testRunnerExecutionStarted($this->executionStarted(1));
$progress->testPrepared();
$progress->testFinished();
$this->assertStringStartsWith('.', $buffer());
$this->assertStrin | {
"filepath": "tests/unit/TextUI/Output/Default/ProgressPrinterTest.php",
"language": "php",
"file_size": 33817,
"cut_index": 2151,
"middle_length": 229
} |
estRunner\ErrorTriggered as TestRunnerIssueErrorTriggered;
use PHPUnit\Event\TestRunner\Issue\DeprecationTriggered as TestRunnerIssueDeprecationTriggered;
use PHPUnit\Event\TestRunner\Issue\NoticeTriggered as TestRunnerIssueNoticeTriggered;
use PHPUnit\Event\TestRunner\Issue\WarningTriggered as TestRunnerIssueWarningTr... | riggered;
use PHPUnit\Event\TestSuite\Skipped as TestSuiteSkipped;
use PHPUnit\Event\TestSuite\TestSuiteWithName;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Medium;
use PHPU | Event\TestRunner\PhpNoticeTriggered as TestRunnerIssuePhpNoticeTriggered;
use PHPUnit\Event\TestRunner\PhpWarningTriggered as TestRunnerIssuePhpWarningTriggered;
use PHPUnit\Event\TestRunner\WarningTriggered as TestRunnerWarningT | {
"filepath": "tests/unit/TextUI/Output/Default/ResultPrinterTest.php",
"language": "php",
"file_size": 42646,
"cut_index": 2151,
"middle_length": 229
} |
art of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\TextUI\Output\Default;
use const PHP_OS_FAMILY;
use PHPUnit\Framework\Attributes\CoversClass;
use P... | public function testPrintsExpectedOutputForTestResultObject(string $expectationFile, TestResult $result): void
{
$printer = $this->printer();
$summaryPrinter = new SummaryPrinter($printer, false);
$summaryPrinter->print($resu | ut\Printer;
use PHPUnit\TextUI\Output\SummaryPrinter;
#[CoversClass(SummaryPrinter::class)]
#[Medium]
final class SummaryPrinterTest extends TestCase
{
#[DataProviderExternal(ResultPrinterTest::class, 'provider', false)]
| {
"filepath": "tests/unit/TextUI/Output/Default/SummaryPrinterTest.php",
"language": "php",
"file_size": 2477,
"cut_index": 563,
"middle_length": 229
} |
art of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\TextUI\Output\Default;
use function hrtime;
use PHPUnit\Event\Facade as EventFacade;
use PHPUnit\Ev... | tCase;
use PHPUnit\TextUI\Output\Printer;
#[CoversClass(UnexpectedOutputPrinter::class)]
#[Small]
final class UnexpectedOutputPrinterTest extends TestCase
{
public function testForwardsOutputFromEventToPrinter(): void
{
$printer = $this->c | it\Event\Telemetry\MemoryUsage;
use PHPUnit\Event\Telemetry\Snapshot;
use PHPUnit\Event\Test\PrintedUnexpectedOutput;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\Tes | {
"filepath": "tests/unit/TextUI/Output/Default/UnexpectedOutputPrinterTest.php",
"language": "php",
"file_size": 2495,
"cut_index": 563,
"middle_length": 229
} |
ethod;
use PHPUnit\Event\Code\TestDoxBuilder;
use PHPUnit\Event\Code\TestMethod;
use PHPUnit\Event\Code\ThrowableBuilder;
use PHPUnit\Event\Facade as EventFacade;
use PHPUnit\Event\Telemetry\CpuTime;
use PHPUnit\Event\Telemetry\Duration;
use PHPUnit\Event\Telemetry\GarbageCollectorStatus;
use PHPUnit\Event\Telemetry\HR... | omDataProvider;
use PHPUnit\Event\TestData\TestDataCollection;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Medium;
use PHPUnit\Framework\ExpectationFailedException;
use PHPUn | \AfterLastTestMethodFailed;
use PHPUnit\Event\Test\BeforeFirstTestMethodErrored;
use PHPUnit\Event\Test\BeforeFirstTestMethodFailed;
use PHPUnit\Event\Test\Errored;
use PHPUnit\Event\Test\Failed;
use PHPUnit\Event\TestData\DataFr | {
"filepath": "tests/unit/TextUI/Output/Compact/ProgressPrinterTest.php",
"language": "php",
"file_size": 9711,
"cut_index": 921,
"middle_length": 229
} |
stRunner\Issue\DeprecationTriggered as TestRunnerIssueDeprecationTriggered;
use PHPUnit\Event\TestRunner\Issue\NoticeTriggered as TestRunnerIssueNoticeTriggered;
use PHPUnit\Event\TestRunner\Issue\WarningTriggered as TestRunnerIssueWarningTriggered;
use PHPUnit\Event\TestRunner\NoticeTriggered as TestRunnerNoticeTrigge... | ttributes\DataProvider;
use PHPUnit\Framework\Attributes\Medium;
use PHPUnit\Framework\ExpectationFailedException;
use PHPUnit\Framework\IncompleteTestError;
use PHPUnit\Framework\TestCase;
use PHPUnit\Metadata\MetadataCollection;
use PHPUnit\TestRunner\Te | HPUnit\Event\TestRunner\PhpWarningTriggered as TestRunnerIssuePhpWarningTriggered;
use PHPUnit\Event\TestRunner\WarningTriggered as TestRunnerWarningTriggered;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\A | {
"filepath": "tests/unit/TextUI/Output/Compact/ResultPrinterTest.php",
"language": "php",
"file_size": 38249,
"cut_index": 2151,
"middle_length": 229
} |
art of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Event;
use function hrtime;
use PHPUnit\Event\Code\TestCollection;
use PHPUnit\Event\Code\TestDoxBu... | rn new Telemetry\Info(
new Telemetry\Snapshot(
HRTime::fromSecondsAndNanoseconds(...hrtime(false)),
Telemetry\MemoryUsage::fromBytes(1000),
Telemetry\MemoryUsage::fromBytes(2000),
| \TestSuiteWithName;
use PHPUnit\Framework\TestCase;
use PHPUnit\Metadata\MetadataCollection;
abstract class AbstractEventTestCase extends TestCase
{
final protected function telemetryInfo(): Telemetry\Info
{
retu | {
"filepath": "tests/unit/Event/AbstractEventTestCase.php",
"language": "php",
"file_size": 2485,
"cut_index": 563,
"middle_length": 229
} |
s=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Event;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framewor... | ents);
$this->assertTrue($events->isEmpty());
$this->assertFalse($events->isNotEmpty());
$this->assertSame([], $events->asArray());
}
public function testCollectsEventObjects(): void
{
$event = $this->createStu | oup('event-system')]
#[Group('event-system/events')]
final class EventCollectionTest extends TestCase
{
public function testIsInitiallyEmpty(): void
{
$events = new EventCollection;
$this->assertEmpty($ev | {
"filepath": "tests/unit/Event/EventCollectionTest.php",
"language": "php",
"file_size": 1643,
"cut_index": 537,
"middle_length": 229
} |
e(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Event;
use PHPUnit\Event\Tracer\Tracer;
use PHPUnit\Framewor... | ade::instance()->registerSubscriber(
new class implements Subscriber
{},
);
}
public function testTracerRegistrationDoesNotWorkWhenEventFacadeIsSealed(): void
{
$this->expectException(EventFacadeIsSealed | -system')]
final class FacadeTest extends TestCase
{
public function testSubscriberRegistrationDoesNotWorkWhenEventFacadeIsSealed(): void
{
$this->expectException(EventFacadeIsSealedException::class);
Fac | {
"filepath": "tests/unit/Event/FacadeTest.php",
"language": "php",
"file_size": 1255,
"cut_index": 524,
"middle_length": 229
} |
tian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\MockObject;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\Medium;
use PHPUnit\Framework\Attributes\TestDox;
use P... | est-doubles')]
#[Group('test-doubles/creation')]
#[Group('test-doubles/test-stub')]
#[Medium]
#[TestDox('createStubForIntersectionOfInterfaces()')]
final class CreateStubForIntersectionOfInterfacesTest extends TestCase
{
public function testCreatesTest | HPUnit\TestFixture\MockObject\AnInterface;
use PHPUnit\TestFixture\MockObject\AnotherInterface;
use PHPUnit\TestFixture\MockObject\AnotherInterfaceThatDoesSomething;
use PHPUnit\TestFixture\MockObject\ExtendableClass;
#[Group('t | {
"filepath": "tests/unit/Framework/MockObject/Creation/CreateStubForIntersectionOfInterfacesTest.php",
"language": "php",
"file_size": 3378,
"cut_index": 614,
"middle_length": 229
} |
tian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\MockObject;
use function md5;
use function mt_rand;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\CoversMet... | ramework\TestCase;
use PHPUnit\TestFixture\MockObject\ExtendableClass;
use PHPUnit\TestFixture\MockObject\ExtendableClassCallingMethodInConstructor;
use PHPUnit\TestFixture\MockObject\ExtendableClassWithConstructorArguments;
use PHPUnit\TestFixture\MockObj | ion;
use PHPUnit\Framework\MockObject\Generator\InvalidClassNameException;
use PHPUnit\Framework\MockObject\Generator\InvalidMethodNameException;
use PHPUnit\Framework\MockObject\Generator\NameAlreadyInUseException;
use PHPUnit\F | {
"filepath": "tests/unit/Framework/MockObject/Creation/MockBuilderTest.php",
"language": "php",
"file_size": 4663,
"cut_index": 614,
"middle_length": 229
} |
s=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\MockObject;
use PHPUnit\Framework\Attributes\CoversClass;
use P... | public function testCanBeRepresentedAsString(): void
{
$constraint = new MethodNameConstraint('foo');
$this->assertSame('is "foo"', $constraint->toString());
}
public function testMatchesMatchingMethodNameCaseInsensitively(): | class MethodNameConstraintTest extends TestCase
{
public function testHasMethodName(): void
{
$constraint = new MethodNameConstraint('foo');
$this->assertSame('foo', $constraint->methodName());
}
| {
"filepath": "tests/unit/Framework/MockObject/Runtime/MethodNameConstraintTest.php",
"language": "php",
"file_size": 1617,
"cut_index": 537,
"middle_length": 229
} |
hp declare(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\MockObject\Runtime;
use PHPUnit\Framework... | Hook::set($propertyName);
$this->assertSame($propertyName, $propertyHook->propertyName());
}
public function testCanBeRepresentedAsString(): void
{
$propertyName = 'property';
$propertyHook = PropertyHook::set($proper | ertySetHook::class)]
#[Small]
#[Group('test-doubles')]
final class PropertySetHookTest extends TestCase
{
public function testHasPropertyName(): void
{
$propertyName = 'property';
$propertyHook = Property | {
"filepath": "tests/unit/Framework/MockObject/Runtime/PropertySetHookTest.php",
"language": "php",
"file_size": 1103,
"cut_index": 515,
"middle_length": 229
} |
art of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\MockObject\Rule;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attr... | all]
final class ParametersTest extends TestCase
{
public function testVerifyWithoutApplyThrowsException(): void
{
$rule = new Parameters([new IsEqual(1)]);
$this->expectException(ExpectationFailedException::class);
$this-> | ledException;
use PHPUnit\Framework\TestCase;
use PHPUnit\TestFixture\MockObject\AnInterface;
use PHPUnit\TestFixture\MockObject\InterfaceWithReturnTypeDeclaration;
#[CoversClass(Parameters::class)]
#[Group('test-doubles')]
#[Sm | {
"filepath": "tests/unit/Framework/MockObject/Runtime/Rule/ParametersTest.php",
"language": "php",
"file_size": 2292,
"cut_index": 563,
"middle_length": 229
} |
tian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\TextUI\Configuration;
use const BAR;
use const FOO;
use const PATH_SEPARATOR;
use const PHP_EOL;
use function getenv;
use function ini_get;
use functi... | ase
{
#[BackupGlobals(true)]
public function testPHPConfigurationIsHandledCorrectly(): void
{
$savedIniHighlightKeyword = ini_get('highlight.keyword');
$this->handle();
$path = TEST_FILES_PATH . '.' . PATH_SEPARATOR . | ributes\Medium;
use PHPUnit\Framework\TestCase;
use PHPUnit\TextUI\XmlConfiguration\Loader;
#[CoversClass(PhpHandler::class)]
#[Medium]
#[Group('textui')]
#[Group('textui/configuration')]
final class PhpHandlerTest extends TestC | {
"filepath": "tests/unit/TextUI/PhpHandlerTest.php",
"language": "php",
"file_size": 4163,
"cut_index": 614,
"middle_length": 229
} |
=> true,
],
self::createSource(
includeFiles: FilterFileCollection::fromArray([
new FilterFile(self::fixturePath('a/PrefixSuffix.php')),
]),
),
];
yield 'file included using file, but excluded using directory' => [
... | FilterFileCollection::fromArray(
[
new FilterFile(self::fixturePath('/a/PrefixSuffix.php')),
],
),
),
];
yield 'file included using file, but excl | irectory(
self::fixturePath('/a'),
'',
'.php',
),
],
),
includeFiles: | {
"filepath": "tests/unit/TextUI/SourceMapperTest.php",
"language": "php",
"file_size": 20479,
"cut_index": 1331,
"middle_length": 229
} |
i')]
#[Group('textui/configuration')]
final class ConfigurationTest extends TestCase
{
public function testTestFilesFileThrowsWhenNotConfigured(): void
{
$configuration = $this->defaultConfiguration();
$this->assertFalse($configuration->hasTestFilesFile());
$this->expectException(NoTes... | unction testBootstrapThrowsWhenNotConfigured(): void
{
$configuration = $this->defaultConfiguration();
$this->assertFalse($configuration->hasBootstrap());
$this->expectException(NoBootstrapException::class);
$configur | >defaultConfiguration();
$this->assertFalse($configuration->hasConfigurationFile());
$this->expectException(NoConfigurationFileException::class);
$configuration->configurationFile();
}
public f | {
"filepath": "tests/unit/TextUI/Configuration/ConfigurationTest.php",
"language": "php",
"file_size": 23028,
"cut_index": 1331,
"middle_length": 229
} |
s=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\TextUI\XmlConfiguration;
use PHPUnit\Framework\Attributes\CoversClass;
us... | (
'<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/X.Y/phpunit.xsd"
bootstrap="vendor/autoload.php"
cacheD | iguration')]
#[Group('textui/configuration/xml')]
final class GeneratorTest extends TestCase
{
public function testGeneratesConfigurationCorrectly(): void
{
$generator = new Generator;
$this->assertEquals | {
"filepath": "tests/unit/TextUI/Configuration/Xml/GeneratorTest.php",
"language": "php",
"file_size": 1976,
"cut_index": 537,
"middle_length": 229
} |
tian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\TextUI\XmlConfiguration;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\TestCase;
use PH... | xml',
__DIR__ . '/../../../../_files/XmlConfigurationMigration/input-9.2.xml',
],
'PHPUnit 9.5' => [
__DIR__ . '/../../../../_files/XmlConfigurationMigration/output-9.5.xml',
__DIR__ . | array<string, array{string, string}>
*/
public static function provider(): array
{
return [
'PHPUnit 9.2' => [
__DIR__ . '/../../../../_files/XmlConfigurationMigration/output-9.2. | {
"filepath": "tests/unit/TextUI/Configuration/Xml/MigratorTest.php",
"language": "php",
"file_size": 3306,
"cut_index": 614,
"middle_length": 229
} |
ew Builder)->fromParameters([]);
$this->assertFalse($configuration->hasAll());
$this->expectException(Exception::class);
$configuration->all();
}
#[TestDox('--colors')]
public function testColorsImplicitAuto(): void
{
$configuration = (new Builder)->fromParameters(['-... | }
#[TestDox('--colors=always')]
public function testColorsAlways(): void
{
$configuration = (new Builder)->fromParameters(['--colors=always']);
$this->assertTrue($configuration->hasColors());
$this->assertSame('alway | tColorsExplicitAuto(): void
{
$configuration = (new Builder)->fromParameters(['--colors=auto']);
$this->assertTrue($configuration->hasColors());
$this->assertSame('auto', $configuration->colors());
| {
"filepath": "tests/unit/TextUI/Configuration/Cli/BuilderTest.php",
"language": "php",
"file_size": 98911,
"cut_index": 3790,
"middle_length": 229
} |
s=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\TextUI\Configuration;
use PHPUnit\Framework\Attributes\CoversClass;
use P... | nds TestCase
{
public function testIsCreatedFromArray(): void
{
$element = $this->element();
$elements = ConstantCollection::fromArray([$element]);
$this->assertSame([$element], $elements->asArray());
}
public fun | ]
#[CoversClass(ConstantCollectionIterator::class)]
#[UsesClass(Constant::class)]
#[Small]
#[Group('textui')]
#[Group('textui/configuration')]
#[Group('textui/configuration/value-objects')]
final class ConstantCollectionTest exte | {
"filepath": "tests/unit/TextUI/Configuration/Value/ConstantCollectionTest.php",
"language": "php",
"file_size": 1627,
"cut_index": 537,
"middle_length": 229
} |
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\TextUI\Configuration;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\Group;
use PHPUni... |
{
public function testHasName(): void
{
$this->assertSame('name', new Constant('name', 'value')->name());
}
public function testHasValue(): void
{
$this->assertSame('value', new Constant('name', 'value')->value());
| objects')]
final class ConstantTest extends TestCase | {
"filepath": "tests/unit/TextUI/Configuration/Value/ConstantTest.php",
"language": "php",
"file_size": 965,
"cut_index": 582,
"middle_length": 52
} |
<?php declare(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\TextUI\Configuration;
use PHPUnit\Framework\Attr... | tui/configuration')]
#[Group('textui/configuration/value-objects')]
final class DirectoryTest extends TestCase
{
public function testHasPath(): void
{
$path = 'path';
$this->assertSame($path, new Directory($path)->path());
}
}
| ]
#[Group('tex | {
"filepath": "tests/unit/TextUI/Configuration/Value/DirectoryTest.php",
"language": "php",
"file_size": 782,
"cut_index": 512,
"middle_length": 14
} |
s=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\TextUI\Configuration;
use PHPUnit\Framework\Attributes\CoversClass;
use P... | public function testIsCreatedFromArray(): void
{
$element = $this->element();
$elements = FileCollection::fromArray([$element]);
$this->assertSame([$element], $elements->asArray());
}
public function testIsCountabl | CoversClass(FileCollectionIterator::class)]
#[UsesClass(File::class)]
#[Small]
#[Group('textui')]
#[Group('textui/configuration')]
#[Group('textui/configuration/value-objects')]
final class FileCollectionTest extends TestCase
{
| {
"filepath": "tests/unit/TextUI/Configuration/Value/FileCollectionTest.php",
"language": "php",
"file_size": 1632,
"cut_index": 537,
"middle_length": 229
} |
hp declare(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\MockObject;
use PHPUnit\Framework\Attribu... | oubles]
final class CreateStubWithDisabledReturnValueGenerationTest extends TestCase
{
public function testReturnValueGenerationCanBeDisabledWithAttribute(): void
{
$double = $this->createStub(AnInterface::class);
$this->expectExce | \TestCase;
use PHPUnit\TestFixture\MockObject\AnInterface;
#[Group('test-doubles')]
#[Group('test-doubles/creation')]
#[Group('test-doubles/test-stub')]
#[Medium]
#[TestDox('createStub()')]
#[DisableReturnValueGenerationForTestD | {
"filepath": "tests/unit/Framework/MockObject/Creation/CreateStubWithDisabledReturnValueGenerationTest.php",
"language": "php",
"file_size": 1090,
"cut_index": 515,
"middle_length": 229
} |
that was distributed with this source code.
*/
namespace PHPUnit\Framework\MockObject;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\MockObject\Rule\AnyInvokedCount;
use PHPUnit\Framework\MockObject\Rule\MethodName;... | lse, false);
$handler->seal(false);
$this->assertTrue($handler->isSealed());
$handler->seal(false);
$this->assertTrue($handler->isSealed());
}
public function testSealingStubDoesNotAddMatchersForUnconfiguredMeth | ss)]
#[Group('test-doubles')]
#[Small]
final class InvocationHandlerTest extends TestCase
{
public function testSealingAlreadySealedHandlerReturnsEarly(): void
{
$handler = new InvocationHandler([], 'stdClass', fa | {
"filepath": "tests/unit/Framework/MockObject/Runtime/InvocationHandlerTest.php",
"language": "php",
"file_size": 5643,
"cut_index": 716,
"middle_length": 229
} |
hp declare(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\MockObject\Runtime;
use PHPUnit\Framework... | Hook::get($propertyName);
$this->assertSame($propertyName, $propertyHook->propertyName());
}
public function testCanBeRepresentedAsString(): void
{
$propertyName = 'property';
$propertyHook = PropertyHook::get($proper | ertyGetHook::class)]
#[Small]
#[Group('test-doubles')]
final class PropertyGetHookTest extends TestCase
{
public function testHasPropertyName(): void
{
$propertyName = 'property';
$propertyHook = Property | {
"filepath": "tests/unit/Framework/MockObject/Runtime/PropertyGetHookTest.php",
"language": "php",
"file_size": 1103,
"cut_index": 515,
"middle_length": 229
} |
function provider(): array
{
return [
'file included using file' => [
[
self::fixturePath('a/PrefixSuffix.php') => true,
],
self::createSource(includeFiles: FilterFileCollection::fromArray(
[
... | new FilterFile(self::fixturePath('/a/PrefixSuffix.php')),
]),
excludeDirectories: FilterDirectoryCollection::fromArray(
[
new FilterDirectory(
| ' => [
[
self::fixturePath('a/PrefixSuffix.php') => false,
],
self::createSource(
includeFiles: FilterFileCollection::fromArray([
| {
"filepath": "tests/unit/TextUI/SourceFilterTest.php",
"language": "php",
"file_size": 27852,
"cut_index": 1331,
"middle_length": 229
} |
TestSuiteSorter;
use PHPUnit\TextUI\Configuration\Configuration;
use SebastianBergmann\CodeCoverage\Report\Html\Colors;
use SebastianBergmann\CodeCoverage\Report\Thresholds;
#[CoversNamespace('PHPUnit\TextUI\XmlConfiguration')]
#[Medium]
#[Group('textui')]
#[Group('textui/configuration')]
#[Group('textui/configuration... | , TestSuiteSorter::ORDER_RANDOMIZED],
'executionOrder reverse' => ['executionOrder', 'reverse', TestSuiteSorter::ORDER_REVERSED],
'executionOrder duration-ascending' => ['executionOrder', 'duration-ascending', TestSuite | er(): array
{
return [
'executionOrder default' => ['executionOrder', 'default', TestSuiteSorter::ORDER_DEFAULT],
'executionOrder random' => ['executionOrder', 'random' | {
"filepath": "tests/unit/TextUI/Configuration/Xml/LoaderTest.php",
"language": "php",
"file_size": 25223,
"cut_index": 1331,
"middle_length": 229
} |
s=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\TextUI\XmlConfiguration;
use function file_get_contents;
use PHPUnit\Fram... | ublic function testValidatesValidXmlFile(): void
{
$result = (new Validator)->validate(
(new Loader)->loadFile(__DIR__ . '/../../../../../phpunit.xml'),
(new SchemaFinder)->find(Version::series()),
);
$t | oader;
#[CoversClass(Validator::class)]
#[CoversClass(ValidationResult::class)]
#[Small]
#[Group('textui')]
#[Group('textui/configuration')]
#[Group('textui/configuration/xml')]
final class ValidatorTest extends TestCase
{
p | {
"filepath": "tests/unit/TextUI/Configuration/Xml/ValidatorTest.php",
"language": "php",
"file_size": 1750,
"cut_index": 537,
"middle_length": 229
} |
s=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\TextUI\Configuration;
use PHPUnit\Framework\Attributes\CoversClass;
use P... | extends TestCase
{
public function testIsCreatedFromArray(): void
{
$element = $this->element();
$elements = DirectoryCollection::fromArray([$element]);
$this->assertSame([$element], $elements->asArray());
}
publi | )]
#[CoversClass(DirectoryCollectionIterator::class)]
#[UsesClass(Directory::class)]
#[Small]
#[Group('textui')]
#[Group('textui/configuration')]
#[Group('textui/configuration/value-objects')]
final class DirectoryCollectionTest | {
"filepath": "tests/unit/TextUI/Configuration/Value/DirectoryCollectionTest.php",
"language": "php",
"file_size": 1677,
"cut_index": 537,
"middle_length": 229
} |
?php declare(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\TextUI\Configuration;
use PHPUnit\Framework\Attri... |
$this->assertSame($className, new ExtensionBootstrap($className, [])->className());
}
public function testHasParameters(): void
{
$parameters = ['foo' => 'bar'];
$this->assertSame($parameters, new ExtensionBootstrap(' | textui')]
#[Group('textui/configuration')]
#[Group('textui/configuration/value-objects')]
final class ExtensionBootstrapTest extends TestCase
{
public function testHasClassName(): void
{
$className = 'ClassName';
| {
"filepath": "tests/unit/TextUI/Configuration/Value/ExtensionBootstrapTest.php",
"language": "php",
"file_size": 1047,
"cut_index": 513,
"middle_length": 229
} |
tian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\MockObject;
use function md5;
use function mt_rand;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\CoversMet... | ration;
#[CoversClass(TestStubBuilder::class)]
#[CoversMethod(TestCase::class, 'getStubBuilder')]
#[Group('test-doubles')]
#[Group('test-doubles/creation')]
#[Group('test-doubles/test-stub')]
#[TestDox('TestStubBuilder')]
#[Medium]
final class TestStubBui | tion;
use PHPUnit\Framework\TestCase;
use PHPUnit\TestFixture\MockObject\ExtendableClass;
use PHPUnit\TestFixture\MockObject\ExtendableClassWithConstructorArguments;
use PHPUnit\TestFixture\MockObject\InterfaceWithReturnTypeDecla | {
"filepath": "tests/unit/Framework/MockObject/Creation/TestStubBuilderTest.php",
"language": "php",
"file_size": 3358,
"cut_index": 614,
"middle_length": 229
} |
s=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\TextUI\Configuration;
use const DIRECTORY_SEPARATOR;
use function ltrim;
... | ): Source {
return new Source(
null,
false,
$includeDirectories ?? FilterDirectoryCollection::fromArray([]),
$includeFiles ?? FilterFileCollection::fromArray([]),
$excludeDirectories ?? | ?FilterDirectoryCollection $includeDirectories = null,
?FilterDirectoryCollection $excludeDirectories = null,
?FilterFileCollection $includeFiles = null,
?FilterFileCollection $excludeFiles = null,
| {
"filepath": "tests/unit/TextUI/AbstractSourceFilterTestCase.php",
"language": "php",
"file_size": 1816,
"cut_index": 537,
"middle_length": 229
} |
e(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\TextUI\XmlConfiguration;
use function count;
use PHPUnit\Fra... | $schemas = (new SchemaFinder)->available();
$this->assertSame((new Version)->series(), $schemas[0]);
$this->assertSame('8.5', $schemas[count($schemas) - 1]);
}
public function testFindsExistingSchema(): void
{
$this-> | Finder::class)]
#[Small]
#[Group('textui')]
#[Group('textui/configuration')]
#[Group('textui/configuration/xml')]
final class SchemaFinderTest extends TestCase
{
public function testListsAvailableSchemas(): void
{
| {
"filepath": "tests/unit/TextUI/Configuration/Xml/SchemaFinderTest.php",
"language": "php",
"file_size": 1268,
"cut_index": 524,
"middle_length": 229
} |
e(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\TextUI\Configuration;
use PHPUnit\Framework\Attributes\Cover... | ')]
final class ExtensionBootstrapCollectionTest extends TestCase
{
public function testIsCreatedFromArray(): void
{
$element = $this->element();
$elements = ExtensionBootstrapCollection::fromArray([$element]);
$this->asse | strapCollection::class)]
#[CoversClass(ExtensionBootstrapCollectionIterator::class)]
#[UsesClass(ExtensionBootstrap::class)]
#[Small]
#[Group('textui')]
#[Group('textui/configuration')]
#[Group('textui/configuration/value-objects | {
"filepath": "tests/unit/TextUI/Configuration/Value/ExtensionBootstrapCollectionTest.php",
"language": "php",
"file_size": 1506,
"cut_index": 524,
"middle_length": 229
} |
that was distributed with this source code.
*/
namespace PHPUnit\TextUI\XmlConfiguration;
use function uniqid;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\Medium;
use PHPUnit\Framework\TestCase;
use PHPUnit\TextUI\CliArguments\Builder;
use PH... | ing()->hasTeamCity());
$this->assertTrue($fromFile->logging()->hasTestDoxHtml());
$this->assertTrue($fromFile->logging()->hasTestDoxText());
$this->assertTrue($fromFile->logging()->hasJunit());
$this->assertNotSame($junitLo | stNoLoggingShouldOnlyAffectXmlConfiguration(): void
{
$junitLog = uniqid('junit_log_');
$fromFile = (new Loader)->load(TEST_FILES_PATH . 'configuration_logging.xml');
$this->assertTrue($fromFile->logg | {
"filepath": "tests/unit/TextUI/Configuration/MergerTest.php",
"language": "php",
"file_size": 7337,
"cut_index": 716,
"middle_length": 229
} |
tian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\MockObject\Stub;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\Smal... | rnsNullWhenNoEntryMatchesArguments(): void
{
$stub = $this->createStub(AnInterface::class);
$map = new ReturnValueMap([[5, 'result']]);
$result = $map->invoke(new Invocation(AnInterface::class, 'doSomething', [99], 'bool', | e PHPUnit\Framework\TestCase;
use PHPUnit\TestFixture\MockObject\AnInterface;
#[CoversClass(ReturnValueMap::class)]
#[Group('test-doubles')]
#[Small]
final class ReturnValueMapTest extends TestCase
{
public function testRetu | {
"filepath": "tests/unit/Framework/MockObject/Runtime/Stub/ReturnValueMapTest.php",
"language": "php",
"file_size": 4423,
"cut_index": 614,
"middle_length": 229
} |
that was distributed with this source code.
*/
namespace PHPUnit\TextUI\CliArguments;
use const DIRECTORY_SEPARATOR;
use function chdir;
use function file_put_contents;
use function getcwd;
use function mkdir;
use function realpath;
use function rmdir;
use function sys_get_temp_dir;
use function uniqid;
use function... | private array $filesToRemove = [];
/**
* @var list<string>
*/
private array $directoriesToRemove = [];
private ?string $previousWorkingDirectory = null;
protected function tearDown(): void
{
if ($this->pre | urationFileFinder::class)]
#[Medium]
#[Group('textui')]
#[Group('textui/configuration')]
#[Group('textui/configuration/cli')]
final class XmlConfigurationFileFinderTest extends TestCase
{
/**
* @var list<string>
*/
| {
"filepath": "tests/unit/TextUI/Configuration/Cli/XmlConfigurationFileFinderTest.php",
"language": "php",
"file_size": 5663,
"cut_index": 716,
"middle_length": 229
} |
se PHPUnit\Metadata\MetadataCollection;
use PHPUnit\TestFixture\RecordingSubscriber;
use PHPUnit\TextUI\CliArguments\Builder;
use PHPUnit\TextUI\Configuration\Merger;
use PHPUnit\TextUI\XmlConfiguration\DefaultConfiguration;
#[CoversClass(DispatchingEmitter::class)]
#[Small]
#[Group('event-system')]
#[Group('event-sys... | {
$this->record($event);
}
};
$dispatcher = $this->dispatcherWithRegisteredSubscriber(
Application\StartedSubscriber::class,
Application\Started::class,
$subscriber,
| EmitsApplicationStartedEvent(): void
{
$subscriber = new class extends RecordingSubscriber implements Application\StartedSubscriber
{
public function notify(Application\Started $event): void
| {
"filepath": "tests/unit/Event/Emitter/DispatchingEmitterTest.php",
"language": "php",
"file_size": 129650,
"cut_index": 3790,
"middle_length": 229
} |
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Event\Code;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framewor... | etsValues(): void
{
$className = self::class;
$methodName = 'foo';
$classMethod = new ClassMethod(
$className,
$methodName,
);
$this->assertSame($className, $classMethod->className());
| ends TestCase
{
public function testConstructorS | {
"filepath": "tests/unit/Event/Value/ClassMethodTest.php",
"language": "php",
"file_size": 966,
"cut_index": 582,
"middle_length": 52
} |
e(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Event\Test;
use PHPUnit\Event\AbstractEventTestCase;
use PHP... | = 'OriginalType';
$event = new MockObjectCreated(
$telemetryInfo,
$className,
);
$this->assertSame($telemetryInfo, $event->telemetryInfo());
$this->assertSame($className, $event->className());
| )]
#[Group('event-system/events')]
final class MockObjectCreatedTest extends AbstractEventTestCase
{
public function testConstructorSetsValues(): void
{
$telemetryInfo = $this->telemetryInfo();
$className | {
"filepath": "tests/unit/Event/Events/TestDouble/MockObjectCreatedTest.php",
"language": "php",
"file_size": 1287,
"cut_index": 524,
"middle_length": 229
} |
e(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Event\Test;
use PHPUnit\Event\AbstractEventTestCase;
use PHP... | etryInfo = $this->telemetryInfo();
$interfaces = ['AnInterface', 'AnotherInterface'];
$event = new MockObjectForIntersectionOfInterfacesCreated(
$telemetryInfo,
$interfaces,
);
$this->assertSame( | all]
#[Group('event-system')]
#[Group('event-system/events')]
final class MockObjectForIntersectionOfInterfacesCreatedTest extends AbstractEventTestCase
{
public function testConstructorSetsValues(): void
{
$telem | {
"filepath": "tests/unit/Event/Events/TestDouble/MockObjectForIntersectionOfInterfacesCreatedTest.php",
"language": "php",
"file_size": 1456,
"cut_index": 524,
"middle_length": 229
} |
s=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Event\Test;
use PHPUnit\Event\AbstractEventTestCase;
use PHPUnit\Framewor... | = 'OriginalType';
$methodNames = [
'foo',
'bar',
'baz',
];
$event = new PartialMockObjectCreated(
$telemetryInfo,
$className,
...$methodNames,
) | roup('event-system/events')]
final class PartialMockObjectCreatedTest extends AbstractEventTestCase
{
public function testConstructorSetsValues(): void
{
$telemetryInfo = $this->telemetryInfo();
$className | {
"filepath": "tests/unit/Event/Events/TestDouble/PartialMockObjectCreatedTest.php",
"language": "php",
"file_size": 1511,
"cut_index": 537,
"middle_length": 229
} |
e(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Event\Test;
use PHPUnit\Event\AbstractEventTestCase;
use PHP... | = 'OriginalType';
$event = new TestStubCreated(
$telemetryInfo,
$className,
);
$this->assertSame($telemetryInfo, $event->telemetryInfo());
$this->assertSame($className, $event->className());
}
|
#[Group('event-system/events')]
final class TestStubCreatedTest extends AbstractEventTestCase
{
public function testConstructorSetsValues(): void
{
$telemetryInfo = $this->telemetryInfo();
$className | {
"filepath": "tests/unit/Event/Events/TestDouble/TestStubCreatedTest.php",
"language": "php",
"file_size": 1277,
"cut_index": 524,
"middle_length": 229
} |
e(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Event\Test;
use PHPUnit\Event\AbstractEventTestCase;
use PHP... | Info = $this->telemetryInfo();
$interfaces = ['AnInterface', 'AnotherInterface'];
$event = new TestStubForIntersectionOfInterfacesCreated(
$telemetryInfo,
$interfaces,
);
$this->assertSame($telem | l]
#[Group('event-system')]
#[Group('event-system/events')]
final class TestStubForIntersectionOfInterfacesCreatedTest extends AbstractEventTestCase
{
public function testConstructorSetsValues(): void
{
$telemetry | {
"filepath": "tests/unit/Event/Events/TestDouble/TestStubForIntersectionOfInterfacesCreatedTest.php",
"language": "php",
"file_size": 1446,
"cut_index": 524,
"middle_length": 229
} |
e(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Event\TestRunner;
use PHPUnit\Event\AbstractEventTestCase;
u... | name = 'bootstrap.php';
$event = new BootstrapFinished(
$telemetryInfo,
$filename,
);
$this->assertSame($telemetryInfo, $event->telemetryInfo());
$this->assertSame($filename, $event->filename() | ystem')]
#[Group('event-system/events')]
final class BootstrapFinishedTest extends AbstractEventTestCase
{
public function testConstructorSetsValues(): void
{
$telemetryInfo = $this->telemetryInfo();
$file | {
"filepath": "tests/unit/Event/Events/TestRunner/BootstrapFinishedTest.php",
"language": "php",
"file_size": 1292,
"cut_index": 524,
"middle_length": 229
} |
declare(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Event\TestRunner;
use PHPUnit\Event\AbstractEventTestC... | $event = new ChildProcessErrored(
$telemetryInfo,
);
$this->assertSame($telemetryInfo, $event->telemetryInfo());
}
public function testCanBeRepresentedAsString(): void
{
$event = new ChildProcessError | 'event-system')]
#[Group('event-system/events')]
final class ChildProcessErroredTest extends AbstractEventTestCase
{
public function testConstructorSetsValues(): void
{
$telemetryInfo = $this->telemetryInfo();
| {
"filepath": "tests/unit/Event/Events/TestRunner/ChildProcessErroredTest.php",
"language": "php",
"file_size": 1135,
"cut_index": 518,
"middle_length": 229
} |
e(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Event\TestRunner;
use PHPUnit\Event\AbstractEventTestCase;
u... | $stdout = 'output';
$stderr = 'error';
$event = new ChildProcessFinished(
$telemetryInfo,
$stdout,
$stderr,
);
$this->assertSame($telemetryInfo, $event->telemetryInfo());
| t-system')]
#[Group('event-system/events')]
final class ChildProcessFinishedTest extends AbstractEventTestCase
{
public function testConstructorSetsValues(): void
{
$telemetryInfo = $this->telemetryInfo();
| {
"filepath": "tests/unit/Event/Events/TestRunner/ChildProcessFinishedTest.php",
"language": "php",
"file_size": 1402,
"cut_index": 524,
"middle_length": 229
} |
declare(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Event\TestRunner;
use PHPUnit\Event\AbstractEventTestC... | $event = new ChildProcessStarted(
$telemetryInfo,
);
$this->assertSame($telemetryInfo, $event->telemetryInfo());
}
public function testCanBeRepresentedAsString(): void
{
$event = new ChildProcessStart | 'event-system')]
#[Group('event-system/events')]
final class ChildProcessStartedTest extends AbstractEventTestCase
{
public function testConstructorSetsValues(): void
{
$telemetryInfo = $this->telemetryInfo();
| {
"filepath": "tests/unit/Event/Events/TestRunner/ChildProcessStartedTest.php",
"language": "php",
"file_size": 1135,
"cut_index": 518,
"middle_length": 229
} |
s=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Event\TestRunner;
use PHPUnit\Event\AbstractEventTestCase;
use PHPUnit\Fr... | edTest extends AbstractEventTestCase
{
public function testConstructorSetsValues(): void
{
$telemetryInfo = $this->telemetryInfo();
$configuration = $this->configuration();
$event = new Configured(
$telemetryInf | uration;
use PHPUnit\TextUI\Configuration\Merger;
use PHPUnit\TextUI\XmlConfiguration\DefaultConfiguration;
#[CoversClass(Configured::class)]
#[Small]
#[Group('event-system')]
#[Group('event-system/events')]
final class Configur | {
"filepath": "tests/unit/Event/Events/TestRunner/ConfiguredTest.php",
"language": "php",
"file_size": 1672,
"cut_index": 537,
"middle_length": 229
} |
e(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Event\TestRunner;
use PHPUnit\Event\AbstractEventTestCase;
u... | $message = 'message';
$event = new DeprecationTriggered(
$telemetryInfo,
$message,
);
$this->assertSame($telemetryInfo, $event->telemetryInfo());
$this->assertSame($message, $event->message() | t-system')]
#[Group('event-system/events')]
final class DeprecationTriggeredTest extends AbstractEventTestCase
{
public function testConstructorSetsValues(): void
{
$telemetryInfo = $this->telemetryInfo();
| {
"filepath": "tests/unit/Event/Events/TestRunner/DeprecationTriggeredTest.php",
"language": "php",
"file_size": 1306,
"cut_index": 524,
"middle_length": 229
} |
hp declare(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Event\TestRunner;
use PHPUnit\Event\AbstractEventTe... | $event = new EventFacadeSealed($telemetryInfo);
$this->assertSame($telemetryInfo, $event->telemetryInfo());
}
public function testCanBeRepresentedAsString(): void
{
$event = new EventFacadeSealed($this->telemetryInfo());
| ('event-system')]
#[Group('event-system/events')]
final class EventFacadeSealedTest extends AbstractEventTestCase
{
public function testConstructorSetsValues(): void
{
$telemetryInfo = $this->telemetryInfo();
| {
"filepath": "tests/unit/Event/Events/TestRunner/EventFacadeSealedTest.php",
"language": "php",
"file_size": 1079,
"cut_index": 515,
"middle_length": 229
} |
declare(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Event\TestRunner;
use PHPUnit\Event\AbstractEventTestC... | $event = new ExecutionAborted($telemetryInfo);
$this->assertSame($telemetryInfo, $event->telemetryInfo());
}
public function testCanBeRepresentedAsString(): void
{
$telemetryInfo = $this->telemetryInfo();
$event = new | ent-system')]
#[Group('event-system/events')]
final class ExecutionAbortedTest extends AbstractEventTestCase
{
public function testConstructorSetsValues(): void
{
$telemetryInfo = $this->telemetryInfo();
| {
"filepath": "tests/unit/Event/Events/TestRunner/ExecutionAbortedTest.php",
"language": "php",
"file_size": 1127,
"cut_index": 518,
"middle_length": 229
} |
declare(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Event\TestRunner;
use PHPUnit\Event\AbstractEventTestC... | $event = new ExecutionFinished($telemetryInfo);
$this->assertSame($telemetryInfo, $event->telemetryInfo());
}
public function testCanBeRepresentedAsString(): void
{
$telemetryInfo = $this->telemetryInfo();
$event = | vent-system')]
#[Group('event-system/events')]
final class ExecutionFinishedTest extends AbstractEventTestCase
{
public function testConstructorSetsValues(): void
{
$telemetryInfo = $this->telemetryInfo();
| {
"filepath": "tests/unit/Event/Events/TestRunner/ExecutionFinishedTest.php",
"language": "php",
"file_size": 1132,
"cut_index": 518,
"middle_length": 229
} |
e(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Event\TestRunner;
use PHPUnit\Event\AbstractEventTestCase;
u... | ite = $this->testSuiteValueObject();
$event = new ExecutionStarted($telemetryInfo, $testSuite);
$this->assertSame($telemetryInfo, $event->telemetryInfo());
$this->assertSame($testSuite, $event->testSuite());
}
public | stem')]
#[Group('event-system/events')]
final class ExecutionStartedTest extends AbstractEventTestCase
{
public function testConstructorSetsValues(): void
{
$telemetryInfo = $this->telemetryInfo();
$testSu | {
"filepath": "tests/unit/Event/Events/TestRunner/ExecutionStartedTest.php",
"language": "php",
"file_size": 1336,
"cut_index": 524,
"middle_length": 229
} |
e(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Event\TestRunner;
use PHPUnit\Event\AbstractEventTestCase;
u... | $className = 'the-className';
$parameters = ['foo' => 'bar'];
$event = new ExtensionBootstrapped(
$telemetryInfo,
$className,
$parameters,
);
$this->assertSame($telemetryInfo, | nt-system')]
#[Group('event-system/events')]
final class ExtensionBootstrappedTest extends AbstractEventTestCase
{
public function testConstructorSetsValues(): void
{
$telemetryInfo = $this->telemetryInfo();
| {
"filepath": "tests/unit/Event/Events/TestRunner/ExtensionBootstrappedTest.php",
"language": "php",
"file_size": 1461,
"cut_index": 524,
"middle_length": 229
} |
s=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Event\TestRunner;
use PHPUnit\Event\AbstractEventTestCase;
use PHPUnit\Fr... | ame = 'extension.phar';
$name = 'example-extension';
$version = '1.2.3';
$event = new ExtensionLoadedFromPhar(
$telemetryInfo,
$filename,
$name,
$version,
| ]
#[Group('event-system/events')]
final class ExtensionLoadedFromPharTest extends AbstractEventTestCase
{
public function testConstructorSetsValues(): void
{
$telemetryInfo = $this->telemetryInfo();
$filen | {
"filepath": "tests/unit/Event/Events/TestRunner/ExtensionLoadedFromPharTest.php",
"language": "php",
"file_size": 1617,
"cut_index": 537,
"middle_length": 229
} |
?php declare(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Event\TestRunner;
use PHPUnit\Event\AbstractEvent... | w Finished($telemetryInfo);
$this->assertSame($telemetryInfo, $event->telemetryInfo());
}
public function testCanBeRepresentedAsString(): void
{
$event = new Finished($this->telemetryInfo());
$this->assertSame('Test R | -system')]
#[Group('event-system/events')]
final class FinishedTest extends AbstractEventTestCase
{
public function testConstructorSetsValues(): void
{
$telemetryInfo = $this->telemetryInfo();
$event = ne | {
"filepath": "tests/unit/Event/Events/TestRunner/FinishedTest.php",
"language": "php",
"file_size": 1044,
"cut_index": 513,
"middle_length": 229
} |
declare(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Event\TestRunner;
use PHPUnit\Event\AbstractEventTestC... | yInfo();
$event = new GarbageCollectionDisabled($telemetryInfo);
$this->assertSame($telemetryInfo, $event->telemetryInfo());
}
public function testCanBeRepresentedAsString(): void
{
$event = new GarbageCollectionDisab | Group('event-system')]
#[Group('event-system/events')]
final class GarbageCollectionDisabledTest extends AbstractEventTestCase
{
public function testConstructorSetsValues(): void
{
$telemetryInfo = $this->telemetr | {
"filepath": "tests/unit/Event/Events/TestRunner/GarbageCollectionDisabledTest.php",
"language": "php",
"file_size": 1131,
"cut_index": 518,
"middle_length": 229
} |
declare(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Event\TestRunner;
use PHPUnit\Event\AbstractEventTestC... | nfo();
$event = new GarbageCollectionEnabled($telemetryInfo);
$this->assertSame($telemetryInfo, $event->telemetryInfo());
}
public function testCanBeRepresentedAsString(): void
{
$event = new GarbageCollectionEnabled( | roup('event-system')]
#[Group('event-system/events')]
final class GarbageCollectionEnabledTest extends AbstractEventTestCase
{
public function testConstructorSetsValues(): void
{
$telemetryInfo = $this->telemetryI | {
"filepath": "tests/unit/Event/Events/TestRunner/GarbageCollectionEnabledTest.php",
"language": "php",
"file_size": 1126,
"cut_index": 518,
"middle_length": 229
} |
declare(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Event\TestRunner;
use PHPUnit\Event\AbstractEventTestC... | tryInfo();
$event = new GarbageCollectionTriggered($telemetryInfo);
$this->assertSame($telemetryInfo, $event->telemetryInfo());
}
public function testCanBeRepresentedAsString(): void
{
$event = new GarbageCollectionTr | [Group('event-system')]
#[Group('event-system/events')]
final class GarbageCollectionTriggeredTest extends AbstractEventTestCase
{
public function testConstructorSetsValues(): void
{
$telemetryInfo = $this->teleme | {
"filepath": "tests/unit/Event/Events/TestRunner/GarbageCollectionTriggeredTest.php",
"language": "php",
"file_size": 1136,
"cut_index": 518,
"middle_length": 229
} |
e(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Event\TestRunner;
use PHPUnit\Event\AbstractEventTestCase;
u... | = 'message';
$event = new NoticeTriggered(
$telemetryInfo,
$message,
);
$this->assertSame($telemetryInfo, $event->telemetryInfo());
$this->assertSame($message, $event->message());
}
p | tem')]
#[Group('event-system/events')]
final class NoticeTriggeredTest extends AbstractEventTestCase
{
public function testConstructorSetsValues(): void
{
$telemetryInfo = $this->telemetryInfo();
$message | {
"filepath": "tests/unit/Event/Events/TestRunner/NoticeTriggeredTest.php",
"language": "php",
"file_size": 1281,
"cut_index": 524,
"middle_length": 229
} |
?php declare(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Event\TestRunner;
use PHPUnit\Event\AbstractEvent... | Started($telemetryInfo);
$this->assertSame($telemetryInfo, $event->telemetryInfo());
}
public function testCanBeRepresentedAsString(): void
{
$event = new Started($this->telemetryInfo());
$this->assertSame('Test Runne | system')]
#[Group('event-system/events')]
final class StartedTest extends AbstractEventTestCase
{
public function testConstructorSetsValues(): void
{
$telemetryInfo = $this->telemetryInfo();
$event = new | {
"filepath": "tests/unit/Event/Events/TestRunner/StartedTest.php",
"language": "php",
"file_size": 1039,
"cut_index": 513,
"middle_length": 229
} |
s=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Event\TestRunner;
use PHPUnit\Event\AbstractEventTestCase;
use PHPUnit\Fr... | emetryInfo();
$cacheHits = 1;
$cacheMisses = 2;
$event = new StaticAnalysisForCodeCoverageFinished(
$telemetryInfo,
$cacheHits,
$cacheMisses,
);
$this->assertSame($telemetr | event-system')]
#[Group('event-system/events')]
final class StaticAnalysisForCodeCoverageFinishedTest extends AbstractEventTestCase
{
public function testConstructorSetsValues(): void
{
$telemetryInfo = $this->tel | {
"filepath": "tests/unit/Event/Events/TestRunner/StaticAnalysisForCodeCoverageFinishedTest.php",
"language": "php",
"file_size": 1519,
"cut_index": 537,
"middle_length": 229
} |
declare(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Event\TestRunner;
use PHPUnit\Event\AbstractEventTestC... | Info = $this->telemetryInfo();
$event = new StaticAnalysisForCodeCoverageStarted(
$telemetryInfo,
);
$this->assertSame($telemetryInfo, $event->telemetryInfo());
}
public function testCanBeRepresentedAsString() | #[Small]
#[Group('event-system')]
#[Group('event-system/events')]
final class StaticAnalysisForCodeCoverageStartedTest extends AbstractEventTestCase
{
public function testConstructorSetsValues(): void
{
$telemetry | {
"filepath": "tests/unit/Event/Events/TestRunner/StaticAnalysisForCodeCoverageStartedTest.php",
"language": "php",
"file_size": 1223,
"cut_index": 518,
"middle_length": 229
} |
e(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Event\TestRunner;
use PHPUnit\Event\AbstractEventTestCase;
u... | e = 'message';
$event = new WarningTriggered(
$telemetryInfo,
$message,
);
$this->assertSame($telemetryInfo, $event->telemetryInfo());
$this->assertSame($message, $event->message());
}
| stem')]
#[Group('event-system/events')]
final class WarningTriggeredTest extends AbstractEventTestCase
{
public function testConstructorSetsValues(): void
{
$telemetryInfo = $this->telemetryInfo();
$messag | {
"filepath": "tests/unit/Event/Events/TestRunner/WarningTriggeredTest.php",
"language": "php",
"file_size": 1286,
"cut_index": 524,
"middle_length": 229
} |
art of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Event\TestRunner\Issue;
use PHPUnit\Event\AbstractEventTestCase;
use PHPUnit\Event\Code\IssueTrigge... | emetryInfo();
$message = 'message';
$file = 'file';
$line = 1;
$suppressed = false;
$ignoredByBaseline = false;
$trigger = IssueTrigger::from(null, null);
| ll]
#[Group('event-system')]
#[Group('event-system/events')]
final class DeprecationTriggeredTest extends AbstractEventTestCase
{
public function testConstructorSetsValues(): void
{
$telemetryInfo = $this->tel | {
"filepath": "tests/unit/Event/Events/TestRunner/Issue/DeprecationTriggeredTest.php",
"language": "php",
"file_size": 2907,
"cut_index": 563,
"middle_length": 229
} |
s=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Event\TestRunner\Issue;
use const PHP_EOL;
use PHPUnit\Event\AbstractEven... | lemetryInfo = $this->telemetryInfo();
$message = 'message';
$file = 'file';
$line = 1;
$suppressed = false;
$event = new ErrorTriggered(
$telemetryInfo,
$message,
| lass(ErrorTriggered::class)]
#[Small]
#[Group('event-system')]
#[Group('event-system/events')]
final class ErrorTriggeredTest extends AbstractEventTestCase
{
public function testConstructorSetsValues(): void
{
$te | {
"filepath": "tests/unit/Event/Events/TestRunner/Issue/ErrorTriggeredTest.php",
"language": "php",
"file_size": 1906,
"cut_index": 537,
"middle_length": 229
} |
art of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Event\TestRunner\Issue;
use const PHP_EOL;
use PHPUnit\Event\AbstractEventTestCase;
use PHPUnit\Fra... | = 'message';
$file = 'file';
$line = 1;
$suppressed = false;
$ignoredByBaseline = false;
$event = new NoticeTriggered(
$telemetryInfo,
$message,
$ | ('event-system/events')]
final class NoticeTriggeredTest extends AbstractEventTestCase
{
public function testConstructorSetsValues(): void
{
$telemetryInfo = $this->telemetryInfo();
$message | {
"filepath": "tests/unit/Event/Events/TestRunner/Issue/NoticeTriggeredTest.php",
"language": "php",
"file_size": 2469,
"cut_index": 563,
"middle_length": 229
} |
art of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Event\TestRunner\Issue;
use PHPUnit\Event\AbstractEventTestCase;
use PHPUnit\Event\Code\IssueTrigge... | Values(): void
{
$telemetryInfo = $this->telemetryInfo();
$message = 'message';
$file = 'file';
$line = 1;
$suppressed = false;
$ignoredByBaseline = false;
| ll;
#[CoversClass(PhpDeprecationTriggered::class)]
#[Small]
#[Group('event-system')]
#[Group('event-system/events')]
final class PhpDeprecationTriggeredTest extends AbstractEventTestCase
{
public function testConstructorSets | {
"filepath": "tests/unit/Event/Events/TestRunner/Issue/PhpDeprecationTriggeredTest.php",
"language": "php",
"file_size": 2795,
"cut_index": 563,
"middle_length": 229
} |
art of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Event\TestRunner\Issue;
use const PHP_EOL;
use PHPUnit\Event\AbstractEventTestCase;
use PHPUnit\Eve... | = $this->telemetryInfo();
$message = 'message';
$file = 'file';
$line = 1;
$suppressed = false;
$ignoredByBaseline = false;
$event = new PhpNoticeTriggered(
| d::class)]
#[Small]
#[Group('event-system')]
#[Group('event-system/events')]
final class PhpNoticeTriggeredTest extends AbstractEventTestCase
{
public function testConstructorSetsValues(): void
{
$telemetryInfo | {
"filepath": "tests/unit/Event/Events/TestRunner/Issue/PhpNoticeTriggeredTest.php",
"language": "php",
"file_size": 2545,
"cut_index": 563,
"middle_length": 229
} |
art of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Event\TestRunner\Issue;
use const PHP_EOL;
use PHPUnit\Event\AbstractEventTestCase;
use PHPUnit\Eve... | = $this->telemetryInfo();
$message = 'message';
$file = 'file';
$line = 1;
$suppressed = false;
$ignoredByBaseline = false;
$event = new PhpWarningTriggered(
| red::class)]
#[Small]
#[Group('event-system')]
#[Group('event-system/events')]
final class PhpWarningTriggeredTest extends AbstractEventTestCase
{
public function testConstructorSetsValues(): void
{
$telemetryInfo | {
"filepath": "tests/unit/Event/Events/TestRunner/Issue/PhpWarningTriggeredTest.php",
"language": "php",
"file_size": 2554,
"cut_index": 563,
"middle_length": 229
} |
that was distributed with this source code.
*/
namespace PHPUnit\Event\Code;
use Exception;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\Attributes\TestDox;
use PHPUni... | */
public static function provider(): array
{
return [
'type of expected value: string, string representation of expected value: not available, type of actual value: string, string representation of actual value: not available' | ll]
#[Group('event-system')]
#[Group('event-system/value-objects')]
final class ComparisonFailureBuilderTest extends TestCase
{
/**
* @return array<string, array{string, string, string, ExpectationFailedException}>
| {
"filepath": "tests/unit/Event/Value/ComparisonFailureBuilderTest.php",
"language": "php",
"file_size": 5347,
"cut_index": 716,
"middle_length": 229
} |
art of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Event\TestSuite;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\Gro... | oversClass(TestSuiteBuilder::class)]
#[Small]
#[Group('event-system')]
#[Group('event-system/value-objects')]
final class TestSuiteBuilderTest extends TestCase
{
public function test_Builds_TestSuite_value_object_for_test_suite_loaded_from_XML_configur | ments\Builder as CliArgumentsBuilder;
use PHPUnit\TextUI\Configuration\Merger as ConfigurationMerger;
use PHPUnit\TextUI\XmlConfiguration\Loader as XmlConfigurationLoader;
use PHPUnit\TextUI\XmlConfiguration\TestSuiteMapper;
#[C | {
"filepath": "tests/unit/Event/Value/TestSuite/TestSuiteBuilderTest.php",
"language": "php",
"file_size": 3030,
"cut_index": 563,
"middle_length": 229
} |
tian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Event\TestSuite;
use PHPUnit\Event\Code\TestCollection;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\CoversClassesTh... | leTest';
$size = 0;
$tests = TestCollection::fromArray([]);
$file = 'ExampleTest.php';
$line = 1;
$testSuite = new TestSuiteForTestClass($className, $size, $tests, $file, $line);
$this->a | TestSuite::class)]
#[Small]
#[Group('event-system')]
#[Group('event-system/value-objects')]
final class TestSuiteTest extends TestCase
{
public function testCanBeTestSuiteForTestClass(): void
{
$className = 'Examp | {
"filepath": "tests/unit/Event/Value/TestSuite/TestSuiteTest.php",
"language": "php",
"file_size": 3272,
"cut_index": 614,
"middle_length": 229
} |
that was distributed with this source code.
*/
namespace PHPUnit\Event\Telemetry;
use InvalidArgumentException;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\Attributes... | '00:00:59.000000123',
59,
123,
],
'less than an hour' => [
'00:59:19.000000123',
3559,
123,
],
'more than an hour' => [
| /**
* @return array<string, array{0: int, 1: int, 2: string}>
*/
public static function provideDurationAndStringRepresentation(): array
{
return [
'less than a minute' => [
| {
"filepath": "tests/unit/Event/Value/Telemetry/DurationTest.php",
"language": "php",
"file_size": 6441,
"cut_index": 716,
"middle_length": 229
} |
tian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Event\Telemetry;
use InvalidArgumentException;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUni... | 'seconds-greater' => [
11,
1,
10,
1,
],
'seconds-and-nanoseconds-greater' => [
11,
1,
10,
0,
| ue-objects')]
final class HRTimeTest extends TestCase
{
/**
* @return array<string, array{0: int, 1: int, 2: int, 3: int}>
*/
public static function provideStartGreaterThanEnd(): array
{
return [
| {
"filepath": "tests/unit/Event/Value/Telemetry/HRTimeTest.php",
"language": "php",
"file_size": 4623,
"cut_index": 614,
"middle_length": 229
} |
s=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Event\Telemetry;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUni... |
return [
'int-less-than-zero' => [-1],
'int-zero' => [0],
'int-greater-than-zero' => [1],
];
}
#[DataProvider('provideValidBytes')]
public function testFromBytesReturnsMemory | ]
#[Group('event-system')]
#[Group('event-system/value-objects')]
final class MemoryUsageTest extends TestCase
{
/**
* @return array<string, array{int}>
*/
public static function provideValidBytes(): array
{ | {
"filepath": "tests/unit/Event/Value/Telemetry/MemoryUsageTest.php",
"language": "php",
"file_size": 1528,
"cut_index": 537,
"middle_length": 229
} |
e(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Event\Telemetry;
use PHPUnit\Framework\Attributes\CoversClas... | ->userCpuTime());
}
public function testSystemCpuTimeReturnsCpuTime(): void
{
$this->assertInstanceOf(CpuTime::class, new SystemCpuTimeMeter()->systemCpuTime());
}
public function testUserCpuTimeIsMonotonicallyNonDecreasing(): | #[Group('event-system/value-objects')]
final class SystemCpuTimeMeterTest extends TestCase
{
public function testUserCpuTimeReturnsCpuTime(): void
{
$this->assertInstanceOf(CpuTime::class, new SystemCpuTimeMeter() | {
"filepath": "tests/unit/Event/Value/Telemetry/SystemCpuTimeMeterTest.php",
"language": "php",
"file_size": 1376,
"cut_index": 524,
"middle_length": 229
} |
tian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Event\Telemetry;
use function hrtime;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attr... | ime $time;
public function __construct(HRTime $time)
{
$this->time = $time;
}
public function current(): HRTime
{
return $this->time;
}
};
| public function testSnapshotReturnsSnapshot(): void
{
$time = HRTime::fromSecondsAndNanoseconds(...hrtime(false));
$clock = new readonly class($time) implements StopWatch
{
private HRT | {
"filepath": "tests/unit/Event/Value/Telemetry/SystemTest.php",
"language": "php",
"file_size": 4011,
"cut_index": 614,
"middle_length": 229
} |
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Event\Runtime;
use const PHP_OS;
use const PHP_OS_FAMILY;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Fr... | xtends TestCase
{
public function testCanBeRepresentedAsString(): void
{
$this->assertSame(PHP_OS, (new OperatingSystem)->operatingSystem());
}
public function testHasOperatingSystemFamily(): void
{
$this->assertSame(PH | m/value-objects')]
final class OperatingSystemTest e | {
"filepath": "tests/unit/Event/Value/Runtime/OperatingSystemTest.php",
"language": "php",
"file_size": 960,
"cut_index": 582,
"middle_length": 52
} |
e(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Event\Runtime;
use PHPUnit\Framework\Attributes\CoversClass;... | asOperatingSystem(): void
{
$operatingSystem = new OperatingSystem;
$this->assertSame($operatingSystem->operatingSystem(), (new Runtime)->operatingSystem()->operatingSystem());
}
public function test_has_PHP(): void
{
| sesClass(OperatingSystem::class)]
#[UsesClass(PHP::class)]
#[UsesClass(PHPUnit::class)]
#[Small]
#[Group('event-system')]
#[Group('event-system/value-objects')]
final class RuntimeTest extends TestCase
{
public function testH | {
"filepath": "tests/unit/Event/Value/Runtime/RuntimeTest.php",
"language": "php",
"file_size": 1507,
"cut_index": 524,
"middle_length": 229
} |
$this->assertFalse($issueTrigger->isDirect());
$this->assertFalse($issueTrigger->isIndirect());
$this->assertTrue($issueTrigger->isUnknown());
$this->assertSame('unknown', $issueTrigger->callerAsString());
$this->assertSame('unknown', $issueTrigger->calleeAsString());
$thi... | t());
$this->assertFalse($issueTrigger->isIndirect());
$this->assertTrue($issueTrigger->isUnknown());
$this->assertSame('test code', $issueTrigger->callerAsString());
$this->assertSame('unknown', $issueTrigger->calleeAsStrin | ublic function testCalleeIsUnknownAndCallerIsTest(): void
{
$issueTrigger = IssueTrigger::from(null, Code::Test);
$this->assertFalse($issueTrigger->isSelf());
$this->assertFalse($issueTrigger->isDirec | {
"filepath": "tests/unit/Event/Value/Test/IssueTriggerTest.php",
"language": "php",
"file_size": 26167,
"cut_index": 1331,
"middle_length": 229
} |
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Event\Code;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framewor... | stConstructorSetsValues(): void
{
$file = 'test.phpt';
$test = new Phpt($file);
$this->assertSame($file, $test->file());
$this->assertSame($file, $test->id());
$this->assertSame($file, $test->name());
$ | s PhptTest extends TestCase
{
public function te | {
"filepath": "tests/unit/Event/Value/Test/PhptTest.php",
"language": "php",
"file_size": 984,
"cut_index": 582,
"middle_length": 52
} |
art of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Event\TestData;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\Grou... | CollectionTest extends TestCase
{
public function testMayBeEmpty(): void
{
$collection = TestDataCollection::fromArray([]);
$this->assertCount(0, $collection);
$this->assertFalse($collection->hasDataFromDataProvider());
| onIterator::class)]
#[UsesClass(TestData::class)]
#[UsesClass(DataFromDataProvider::class)]
#[UsesClass(DataFromTestDependency::class)]
#[Small]
#[Group('event-system')]
#[Group('event-system/value-objects')]
final class TestData | {
"filepath": "tests/unit/Event/Value/Test/TestData/TestDataCollectionTest.php",
"language": "php",
"file_size": 2769,
"cut_index": 563,
"middle_length": 229
} |
s=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Event\TestData;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit... | {
$name = 'data-set-name';
$dataAsString = 'data-as-string';
$dataAsStringForOutput = 'data-as-string-for-output';
$data = DataFromDataProvider::from(
$name,
$dataAsStri | ss)]
#[CoversClassesThatExtendClass(TestData::class)]
#[Small]
#[Group('event-system')]
#[Group('event-system/value-objects')]
final class TestDataTest extends TestCase
{
public function testDataCanBeFromDataProvider(): void
| {
"filepath": "tests/unit/Event/Value/Test/TestData/TestDataTest.php",
"language": "php",
"file_size": 1751,
"cut_index": 537,
"middle_length": 229
} |
e(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Event;
use PHPUnit\Framework\Attributes\CoversClass;
use PHP... | ddMapping(Test\DeprecationTriggeredSubscriber::class, Test\DeprecationTriggered::class);
$dispatcher = new CollectingDispatcher(new DirectDispatcher($typeMap));
$this->assertEmpty($dispatcher->flush());
}
public function testColl | 'event-system/dispatcher')]
final class CollectingDispatcherTest extends TestCase
{
public function testHasNoCollectedEventsWhenFlushedImmediatelyAfterCreation(): void
{
$typeMap = new TypeMap;
$typeMap->a | {
"filepath": "tests/unit/Event/Dispatcher/CollectingDispatcherTest.php",
"language": "php",
"file_size": 1451,
"cut_index": 524,
"middle_length": 229
} |
art of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Event;
use PHPUnit\Event\Tracer\Tracer;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\F... | void
{
$event = new DummyEvent;
$typeMap = $this->typeMap();
$dispatcher = new DirectDispatcher($typeMap);
$subscriber = $this->createMock(DummySubscriber::class);
$subscriber
->expects($this->o | tion;
#[CoversClass(DirectDispatcher::class)]
#[Small]
#[Group('event-system')]
#[Group('event-system/dispatcher')]
final class DirectDispatcherTest extends TestCase
{
public function testDispatchesEventToKnownSubscribers(): | {
"filepath": "tests/unit/Event/Dispatcher/DirectDispatcherTest.php",
"language": "php",
"file_size": 2508,
"cut_index": 563,
"middle_length": 229
} |
art of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Event\Code;
use Exception;
use PHPUnit\Event\NoPreviousThrowableException;
use PHPUnit\Framework\At... | d
{
$e = new Exception('message', 123, null);
$t = ThrowableBuilder::from($e);
$this->assertSame(Exception::class, $t->className());
$this->assertSame('message', $t->message());
$this->assertSame("Exception: mes |
#[CoversClass(ThrowableBuilder::class)]
#[Small]
#[Group('event-system')]
#[Group('event-system/value-objects')]
final class ThrowableTest extends TestCase
{
public function testCanBeCreatedForThrowableWithoutPrevious(): voi | {
"filepath": "tests/unit/Event/Value/ThrowableTest.php",
"language": "php",
"file_size": 2470,
"cut_index": 563,
"middle_length": 229
} |
s=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Event\Telemetry;
use function hrtime;
use PHPUnit\Framework\Attributes\Co... | $memoryUsage = MemoryUsage::fromBytes(2000);
$peakMemoryUsage = MemoryUsage::fromBytes(3000);
$garbageCollectorStatus = new GarbageCollectorStatus(0, 0, 0, 0, 0.0, 0.0, 0.0, 0.0, false, false, false, 0);
$us | Group('event-system/value-objects')]
final class SnapshotTest extends TestCase
{
public function testConstructorSetsValues(): void
{
$time = HRTime::fromSecondsAndNanoseconds(...hrtime(false));
| {
"filepath": "tests/unit/Event/Value/Telemetry/SnapshotTest.php",
"language": "php",
"file_size": 1984,
"cut_index": 537,
"middle_length": 229
} |
e(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Event\Telemetry;
use function hrtime;
use PHPUnit\Framework\... | = HRTime::fromSecondsAndNanoseconds(...hrtime(false));
$current = $clock->current();
$after = HRTime::fromSecondsAndNanoseconds(...hrtime(false));
$durationBetweenCurrentAndBefore = $current->duration($before);
$this->as | ('event-system')]
#[Group('event-system/value-objects')]
final class SystemStopWatchTest extends TestCase
{
public function testNowReturnsDateTimeImmutable(): void
{
$clock = new SystemStopWatch;
$before | {
"filepath": "tests/unit/Event/Value/Telemetry/SystemStopWatchTest.php",
"language": "php",
"file_size": 1392,
"cut_index": 524,
"middle_length": 229
} |
art of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Event\Code\IssueTrigger;
use Generator;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\F... | #[TestDox('$code is categorized')]
public function testCodeIsCategorizedAtHighLevel(Code $code): void
{
$this->assertTrue($code->isFirstPartyOrTest() || $code->isThirdPartyOrPhpunitOrPhp());
$this->assertFalse($code->isFirstPartyOr | class CodeTest extends TestCase
{
public static function enumCases(): Generator
{
foreach (Code::cases() as $code) {
yield $code->value => [$code];
}
}
#[DataProvider('enumCases')]
| {
"filepath": "tests/unit/Event/Value/Test/CodeTest.php",
"language": "php",
"file_size": 2528,
"cut_index": 563,
"middle_length": 229
} |
tian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Event\Code;
use function sprintf;
use PHPUnit\Event\TestData\DataFromDataProvider;
use PHPUnit\Event\TestData\TestDataCollection;
use PHPUnit\Framewor... | $className = 'FooTest';
$methodName = 'testBar';
$file = 'FooTest.php';
$line = 1;
$testDox = TestDoxBuilder::fromClassNameAndMethodName('Foo', 'bar');
$testData = TestDataCollection::fromAr | s(TestMethod::class)]
#[CoversClass(Test::class)]
#[Small]
#[Group('event-system')]
#[Group('event-system/value-objects')]
final class TestMethodTest extends TestCase
{
public function testConstructorSetsValues(): void
{
| {
"filepath": "tests/unit/Event/Value/Test/TestMethodTest.php",
"language": "php",
"file_size": 4798,
"cut_index": 614,
"middle_length": 229
} |
tian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Event;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Frame... | {
$subscriber = $this->createStub(DummySubscriber::class);
$subscriberType = DummySubscriber::class;
$event = new DummyEvent;
$eventType = DummyEvent::class;
$map = new TypeMap;
$this->ass | PHPUnit\TestFixture\MockObject\FinalClass;
#[CoversClass(TypeMap::class)]
#[Small]
#[Group('event-system')]
final class TypeMapTest extends TestCase
{
public function testMapsKnownSubscriberInterfaceToEventClass(): void
| {
"filepath": "tests/unit/Event/TypeMapTest.php",
"language": "php",
"file_size": 3916,
"cut_index": 614,
"middle_length": 229
} |
tian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Event\Telemetry;
use InvalidArgumentException;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Frame... |
$this->assertSame($seconds, $cpuTime->seconds());
$this->assertSame($nanoseconds, $cpuTime->nanoseconds());
}
public function testSecondsMustNotBeNegative(): void
{
$this->expectException(InvalidArgumentException::clas | TestCase
{
public function testCanBeCreatedFromSecondsAndNanoseconds(): void
{
$seconds = 123;
$nanoseconds = 999999999;
$cpuTime = CpuTime::fromSecondsAndNanoseconds($seconds, $nanoseconds);
| {
"filepath": "tests/unit/Event/Value/Telemetry/CpuTimeTest.php",
"language": "php",
"file_size": 3777,
"cut_index": 614,
"middle_length": 229
} |
art of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Event\Telemetry;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\Gro... | d
{
$this->assertSame(2, $this->garbageCollectorStatus()->collected());
}
public function testHasThreshold(): void
{
$this->assertSame(3, $this->garbageCollectorStatus()->threshold());
}
public function testHasRoot | ')]
final class GarbageCollectorStatusTest extends TestCase
{
public function testHasRuns(): void
{
$this->assertSame(1, $this->garbageCollectorStatus()->runs());
}
public function testHasCollected(): voi | {
"filepath": "tests/unit/Event/Value/Telemetry/GarbageCollectorStatusTest.php",
"language": "php",
"file_size": 2603,
"cut_index": 563,
"middle_length": 229
} |
?php declare(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Event\Code;
use PHPUnit\Framework\Attributes\Cove... | iff = 'diff';
$comparisonFailure = new ComparisonFailure($expected, $actual, $diff);
$this->assertSame($expected, $comparisonFailure->expected());
$this->assertSame($actual, $comparisonFailure->actual());
$this->assert | m')]
#[Group('event-system/value-objects')]
final class ComparisonFailureTest extends TestCase
{
public function testConstructorSetsValues(): void
{
$expected = 'expected';
$actual = 'actual';
$d | {
"filepath": "tests/unit/Event/Value/ComparisonFailureTest.php",
"language": "php",
"file_size": 1047,
"cut_index": 513,
"middle_length": 229
} |
tian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Event\Telemetry;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\Small;
use PHP... | e());
}
public function testHasPeakMemoryUsage(): void
{
$this->assertInstanceOf(MemoryUsage::class, $this->info()->peakMemoryUsage());
}
public function testHasDurationSinceStart(): void
{
$this->assertSame(0, $th | asTime(): void
{
$this->assertInstanceOf(HRTime::class, $this->info()->time());
}
public function testHasMemoryUsage(): void
{
$this->assertInstanceOf(MemoryUsage::class, $this->info()->memoryUsag | {
"filepath": "tests/unit/Event/Value/Telemetry/InfoTest.php",
"language": "php",
"file_size": 4995,
"cut_index": 614,
"middle_length": 229
} |
s=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Event\Runtime;
use const PHP_EXTRA_VERSION;
use const PHP_MAJOR_VERSION;
... | ase
{
public function testHasVersion(): void
{
$this->assertSame(PHP_VERSION, (new PHP)->version());
}
public function testHasVersionId(): void
{
$this->assertSame(PHP_VERSION_ID, (new PHP)->versionId());
}
pub | work\Attributes\Group;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\TestCase;
#[CoversClass(PHP::class)]
#[Small]
#[Group('event-system')]
#[Group('event-system/value-objects')]
final class PHPTest extends TestC | {
"filepath": "tests/unit/Event/Value/Runtime/PHPTest.php",
"language": "php",
"file_size": 1902,
"cut_index": 537,
"middle_length": 229
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.