Showing preview only (1,002K chars total). Download the full file or copy to clipboard to get everything.
Repository: pestphp/pest
Branch: 4.x
Commit: 5d42e8fe3ae1
Files: 560
Total size: 870.5 KB
Directory structure:
gitextract_nn7gly9v/
├── .editorconfig
├── .gitattributes
├── .github/
│ ├── FUNDING.yml
│ ├── ISSUE_TEMPLATE/
│ │ └── bug_report.yml
│ ├── PULL_REQUEST_TEMPLATE.md
│ └── workflows/
│ ├── static.yml
│ └── tests.yml
├── .gitignore
├── CONTRIBUTING.md
├── LICENSE.md
├── README.md
├── RELEASE.md
├── bin/
│ ├── pest
│ └── worker.php
├── composer.json
├── docker/
│ └── Dockerfile
├── extension.neon
├── overrides/
│ ├── Event/
│ │ └── Value/
│ │ └── ThrowableBuilder.php
│ ├── Logging/
│ │ └── JUnit/
│ │ └── JunitXmlLogger.php
│ ├── Runner/
│ │ ├── Filter/
│ │ │ └── NameFilterIterator.php
│ │ ├── ResultCache/
│ │ │ └── DefaultResultCache.php
│ │ └── TestSuiteLoader.php
│ └── TextUI/
│ ├── Command/
│ │ └── Commands/
│ │ └── WarmCodeCoverageCacheCommand.php
│ ├── Output/
│ │ └── Default/
│ │ └── ProgressPrinter/
│ │ └── Subscriber/
│ │ └── TestSkippedSubscriber.php
│ └── TestSuiteFilterProcessor.php
├── phpstan-baseline.neon
├── phpstan.neon
├── phpunit.xml
├── rector.php
├── resources/
│ ├── base-phpunit.xml
│ └── views/
│ ├── components/
│ │ ├── badge.php
│ │ ├── new-line.php
│ │ └── two-column-detail.php
│ ├── installers/
│ │ └── plugin-browser.php
│ ├── usage.php
│ └── version.php
├── src/
│ ├── ArchPresets/
│ │ ├── AbstractPreset.php
│ │ ├── Custom.php
│ │ ├── Laravel.php
│ │ ├── Php.php
│ │ ├── Relaxed.php
│ │ ├── Security.php
│ │ └── Strict.php
│ ├── Bootstrappers/
│ │ ├── BootExcludeList.php
│ │ ├── BootFiles.php
│ │ ├── BootKernelDump.php
│ │ ├── BootOverrides.php
│ │ ├── BootSubscribers.php
│ │ └── BootView.php
│ ├── Collision/
│ │ └── Events.php
│ ├── Concerns/
│ │ ├── Expectable.php
│ │ ├── Extendable.php
│ │ ├── Logging/
│ │ │ └── WritesToConsole.php
│ │ ├── Pipeable.php
│ │ ├── Retrievable.php
│ │ └── Testable.php
│ ├── Configuration/
│ │ ├── Presets.php
│ │ ├── Printer.php
│ │ └── Project.php
│ ├── Configuration.php
│ ├── Console/
│ │ ├── Help.php
│ │ └── Thanks.php
│ ├── Contracts/
│ │ ├── ArchPreset.php
│ │ ├── Bootstrapper.php
│ │ ├── HasPrintableTestCaseName.php
│ │ ├── Panicable.php
│ │ ├── Plugins/
│ │ │ ├── AddsOutput.php
│ │ │ ├── Bootable.php
│ │ │ ├── HandlesArguments.php
│ │ │ ├── HandlesOriginalArguments.php
│ │ │ └── Terminable.php
│ │ ├── TestCaseFilter.php
│ │ └── TestCaseMethodFilter.php
│ ├── Evaluators/
│ │ └── Attributes.php
│ ├── Exceptions/
│ │ ├── AfterAllAlreadyExist.php
│ │ ├── AfterAllWithinDescribe.php
│ │ ├── AfterBeforeTestFunction.php
│ │ ├── BeforeAllAlreadyExist.php
│ │ ├── BeforeAllWithinDescribe.php
│ │ ├── DatasetAlreadyExists.php
│ │ ├── DatasetArgumentsMismatch.php
│ │ ├── DatasetDoesNotExist.php
│ │ ├── DatasetMissing.php
│ │ ├── ExpectationNotFound.php
│ │ ├── FatalException.php
│ │ ├── FileOrFolderNotFound.php
│ │ ├── InvalidArgumentException.php
│ │ ├── InvalidExpectation.php
│ │ ├── InvalidExpectationValue.php
│ │ ├── InvalidOption.php
│ │ ├── InvalidPestCommand.php
│ │ ├── MissingDependency.php
│ │ ├── NoDirtyTestsFound.php
│ │ ├── ShouldNotHappen.php
│ │ ├── TestAlreadyExist.php
│ │ ├── TestCaseAlreadyInUse.php
│ │ ├── TestCaseClassOrTraitNotFound.php
│ │ ├── TestClosureMustNotBeStatic.php
│ │ └── TestDescriptionMissing.php
│ ├── Expectation.php
│ ├── Expectations/
│ │ ├── EachExpectation.php
│ │ ├── HigherOrderExpectation.php
│ │ └── OppositeExpectation.php
│ ├── Factories/
│ │ ├── Attribute.php
│ │ ├── Concerns/
│ │ │ └── HigherOrderable.php
│ │ ├── Covers/
│ │ │ ├── CoversClass.php
│ │ │ └── CoversFunction.php
│ │ ├── TestCaseFactory.php
│ │ └── TestCaseMethodFactory.php
│ ├── Functions.php
│ ├── Installers/
│ │ └── PluginBrowser.php
│ ├── Kernel.php
│ ├── KernelDump.php
│ ├── Logging/
│ │ ├── Converter.php
│ │ └── TeamCity/
│ │ ├── ServiceMessage.php
│ │ ├── Subscriber/
│ │ │ ├── Subscriber.php
│ │ │ ├── TestConsideredRiskySubscriber.php
│ │ │ ├── TestErroredSubscriber.php
│ │ │ ├── TestExecutionFinishedSubscriber.php
│ │ │ ├── TestFailedSubscriber.php
│ │ │ ├── TestFinishedSubscriber.php
│ │ │ ├── TestPreparedSubscriber.php
│ │ │ ├── TestSkippedSubscriber.php
│ │ │ ├── TestSuiteFinishedSubscriber.php
│ │ │ └── TestSuiteStartedSubscriber.php
│ │ └── TeamCityLogger.php
│ ├── Matchers/
│ │ └── Any.php
│ ├── Mixins/
│ │ └── Expectation.php
│ ├── Panic.php
│ ├── PendingCalls/
│ │ ├── AfterEachCall.php
│ │ ├── BeforeEachCall.php
│ │ ├── Concerns/
│ │ │ └── Describable.php
│ │ ├── DescribeCall.php
│ │ ├── TestCall.php
│ │ └── UsesCall.php
│ ├── Pest.php
│ ├── Plugin.php
│ ├── Plugins/
│ │ ├── Actions/
│ │ │ ├── CallsAddsOutput.php
│ │ │ ├── CallsBoot.php
│ │ │ ├── CallsHandleArguments.php
│ │ │ ├── CallsHandleOriginalArguments.php
│ │ │ └── CallsTerminable.php
│ │ ├── Bail.php
│ │ ├── Cache.php
│ │ ├── Concerns/
│ │ │ └── HandleArguments.php
│ │ ├── Configuration.php
│ │ ├── Coverage.php
│ │ ├── Environment.php
│ │ ├── Help.php
│ │ ├── Init.php
│ │ ├── Memory.php
│ │ ├── Only.php
│ │ ├── Parallel/
│ │ │ ├── Contracts/
│ │ │ │ └── HandlersWorkerArguments.php
│ │ │ ├── Handlers/
│ │ │ │ ├── Laravel.php
│ │ │ │ ├── Parallel.php
│ │ │ │ └── Pest.php
│ │ │ ├── Paratest/
│ │ │ │ ├── CleanConsoleOutput.php
│ │ │ │ ├── ResultPrinter.php
│ │ │ │ └── WrapperRunner.php
│ │ │ └── Support/
│ │ │ └── CompactPrinter.php
│ │ ├── Parallel.php
│ │ ├── Printer.php
│ │ ├── ProcessIsolation.php
│ │ ├── Profile.php
│ │ ├── Retry.php
│ │ ├── Shard.php
│ │ ├── Snapshot.php
│ │ ├── Verbose.php
│ │ └── Version.php
│ ├── Preset.php
│ ├── Repositories/
│ │ ├── AfterAllRepository.php
│ │ ├── AfterEachRepository.php
│ │ ├── BeforeAllRepository.php
│ │ ├── BeforeEachRepository.php
│ │ ├── DatasetsRepository.php
│ │ ├── SnapshotRepository.php
│ │ └── TestRepository.php
│ ├── Result.php
│ ├── Runner/
│ │ └── Filter/
│ │ └── EnsureTestCaseIsInitiatedFilter.php
│ ├── Subscribers/
│ │ ├── EnsureConfigurationIsAvailable.php
│ │ ├── EnsureIgnorableTestCasesAreIgnored.php
│ │ ├── EnsureKernelDumpIsFlushed.php
│ │ └── EnsureTeamCityEnabled.php
│ ├── Support/
│ │ ├── Arr.php
│ │ ├── Backtrace.php
│ │ ├── ChainableClosure.php
│ │ ├── Closure.php
│ │ ├── Container.php
│ │ ├── Coverage.php
│ │ ├── DatasetInfo.php
│ │ ├── Description.php
│ │ ├── ExceptionTrace.php
│ │ ├── ExpectationPipeline.php
│ │ ├── Exporter.php
│ │ ├── HigherOrderCallables.php
│ │ ├── HigherOrderMessage.php
│ │ ├── HigherOrderMessageCollection.php
│ │ ├── HigherOrderTapProxy.php
│ │ ├── NullClosure.php
│ │ ├── Reflection.php
│ │ ├── Shell.php
│ │ ├── StateGenerator.php
│ │ ├── Str.php
│ │ └── View.php
│ ├── TestCaseFilters/
│ │ └── GitDirtyTestCaseFilter.php
│ ├── TestCaseMethodFilters/
│ │ ├── AssigneeTestCaseFilter.php
│ │ ├── IssueTestCaseFilter.php
│ │ ├── NotesTestCaseFilter.php
│ │ ├── PrTestCaseFilter.php
│ │ └── TodoTestCaseFilter.php
│ ├── TestCases/
│ │ └── IgnorableTestCase.php
│ └── TestSuite.php
├── stubs/
│ ├── Browser.php
│ ├── Dataset.php
│ ├── Feature.php
│ ├── Unit.php
│ ├── init/
│ │ ├── Feature/
│ │ │ └── ExampleTest.php.stub
│ │ ├── Pest.php.stub
│ │ ├── TestCase.php.stub
│ │ ├── Unit/
│ │ │ └── ExampleTest.php.stub
│ │ └── phpunit.xml.stub
│ └── init-laravel/
│ ├── Feature/
│ │ └── ExampleTest.php.stub
│ ├── Pest.php.stub
│ ├── TestCase.php.stub
│ ├── Unit/
│ │ └── ExampleTest.php.stub
│ └── phpunit.xml.stub
├── tests/
│ ├── .cache/
│ │ └── test-results
│ ├── .pest/
│ │ ├── snapshots/
│ │ │ ├── Features/
│ │ │ │ └── Expect/
│ │ │ │ └── toMatchSnapshot/
│ │ │ │ ├── _describable__→_multiple_snapshot_expectations_with_describe.snap
│ │ │ │ ├── _describable__→_multiple_snapshot_expectations_with_describe__2.snap
│ │ │ │ ├── _within_describe__→_pass_with_dataset_with_data_set____my_datas_set_value___.snap
│ │ │ │ ├── failures.snap
│ │ │ │ ├── failures_with_custom_message.snap
│ │ │ │ ├── multiple_snapshot_expectations.snap
│ │ │ │ ├── multiple_snapshot_expectations__2.snap
│ │ │ │ ├── multiple_snapshot_expectations_with_datasets_with_data_set___1__.snap
│ │ │ │ ├── multiple_snapshot_expectations_with_datasets_with_data_set___1____2.snap
│ │ │ │ ├── multiple_snapshot_expectations_with_datasets_with_data_set____bar___.snap
│ │ │ │ ├── multiple_snapshot_expectations_with_datasets_with_data_set____bar_____2.snap
│ │ │ │ ├── multiple_snapshot_expectations_with_datasets_with_data_set____baz___.snap
│ │ │ │ ├── multiple_snapshot_expectations_with_datasets_with_data_set____baz_____2.snap
│ │ │ │ ├── multiple_snapshot_expectations_with_datasets_with_data_set____foo___.snap
│ │ │ │ ├── multiple_snapshot_expectations_with_datasets_with_data_set____foo_____2.snap
│ │ │ │ ├── multiple_snapshot_expectations_with_repeat_with_data_set___10__.snap
│ │ │ │ ├── multiple_snapshot_expectations_with_repeat_with_data_set___10____2.snap
│ │ │ │ ├── multiple_snapshot_expectations_with_repeat_with_data_set___1__.snap
│ │ │ │ ├── multiple_snapshot_expectations_with_repeat_with_data_set___1____2.snap
│ │ │ │ ├── multiple_snapshot_expectations_with_repeat_with_data_set___2__.snap
│ │ │ │ ├── multiple_snapshot_expectations_with_repeat_with_data_set___2____2.snap
│ │ │ │ ├── multiple_snapshot_expectations_with_repeat_with_data_set___3__.snap
│ │ │ │ ├── multiple_snapshot_expectations_with_repeat_with_data_set___3____2.snap
│ │ │ │ ├── multiple_snapshot_expectations_with_repeat_with_data_set___4__.snap
│ │ │ │ ├── multiple_snapshot_expectations_with_repeat_with_data_set___4____2.snap
│ │ │ │ ├── multiple_snapshot_expectations_with_repeat_with_data_set___5__.snap
│ │ │ │ ├── multiple_snapshot_expectations_with_repeat_with_data_set___5____2.snap
│ │ │ │ ├── multiple_snapshot_expectations_with_repeat_with_data_set___6__.snap
│ │ │ │ ├── multiple_snapshot_expectations_with_repeat_with_data_set___6____2.snap
│ │ │ │ ├── multiple_snapshot_expectations_with_repeat_with_data_set___7__.snap
│ │ │ │ ├── multiple_snapshot_expectations_with_repeat_with_data_set___7____2.snap
│ │ │ │ ├── multiple_snapshot_expectations_with_repeat_with_data_set___8__.snap
│ │ │ │ ├── multiple_snapshot_expectations_with_repeat_with_data_set___8____2.snap
│ │ │ │ ├── multiple_snapshot_expectations_with_repeat_with_data_set___9__.snap
│ │ │ │ ├── multiple_snapshot_expectations_with_repeat_with_data_set___9____2.snap
│ │ │ │ ├── not_failures.snap
│ │ │ │ ├── pass.snap
│ │ │ │ ├── pass_using_pipes.snap
│ │ │ │ ├── pass_with______toString_.snap
│ │ │ │ ├── pass_with__toArray_.snap
│ │ │ │ ├── pass_with__toSnapshot_.snap
│ │ │ │ ├── pass_with__toString_.snap
│ │ │ │ ├── pass_with_array.snap
│ │ │ │ └── pass_with_dataset_with_data_set____my_datas_set_value___.snap
│ │ │ └── Visual/
│ │ │ ├── Collision/
│ │ │ │ └── collision_with_data_set_________.snap
│ │ │ ├── Help/
│ │ │ │ └── visual_snapshot_of_help_command_output.snap
│ │ │ ├── Todo/
│ │ │ │ ├── todo.snap
│ │ │ │ ├── todo_in_parallel.snap
│ │ │ │ ├── todos.snap
│ │ │ │ └── todos_in_parallel.snap
│ │ │ └── Version/
│ │ │ └── visual_snapshot_of_help_command_output.snap
│ │ └── snapshots-external/
│ │ └── Features/
│ │ └── Expect/
│ │ └── toMatchSnapshot/
│ │ ├── _within_describe__→_pass_with_dataset___my_datas_set_value___with_data___my_datas_set_value__.snap
│ │ ├── _within_describe__→_pass_with_dataset_with_data_set_____my_datas_set_value___.snap
│ │ ├── _within_describe__→_pass_with_dataset_with_data_set____my_datas_set_value___.snap
│ │ ├── pass_with_dataset___my_datas_set_value___with_data___my_datas_set_value__.snap
│ │ ├── pass_with_dataset_with_data_set_____my_datas_set_value___.snap
│ │ └── pass_with_dataset_with_data_set____my_datas_set_value___.snap
│ ├── .snapshots/
│ │ ├── Failure.php.inc
│ │ ├── SuccessOnly.php.inc
│ │ ├── allows-to-run-a-directory.txt
│ │ ├── allows-to-run-a-single-test.txt
│ │ ├── disable-decorating-printer.txt
│ │ └── success.txt
│ ├── .tests/
│ │ ├── Failure.php
│ │ └── SuccessOnly.php
│ ├── Arch.php
│ ├── Autoload.php
│ ├── Datasets/
│ │ ├── Bound.php
│ │ └── Numbers.php
│ ├── Environments/
│ │ └── Windows.php
│ ├── Features/
│ │ ├── After.php
│ │ ├── AfterAll.php
│ │ ├── AfterEach.php
│ │ ├── Assignee.php
│ │ ├── BeforeAll.php
│ │ ├── BeforeEach.php
│ │ ├── BeforeEachProxiesToTestCallWithExpectations.php
│ │ ├── BeforeEachProxiesToTestCallWithSkip.php
│ │ ├── BeforeEachProxiesToTestCallWithTodo.php
│ │ ├── Coverage.php
│ │ ├── Covers/
│ │ │ ├── ClassCoverage.php
│ │ │ ├── ExceptionHandling.php
│ │ │ ├── FunctionCoverage.php
│ │ │ ├── GuessCoverage.php
│ │ │ └── TraitCoverage.php
│ │ ├── DatasetsTests.php
│ │ ├── Depends.php
│ │ ├── DependsInheritance.php
│ │ ├── Deprecated.php
│ │ ├── Describe.php
│ │ ├── DescriptionLess.php
│ │ ├── Done.php
│ │ ├── Exceptions.php
│ │ ├── Expect/
│ │ │ ├── HigherOrder/
│ │ │ │ ├── methods.php
│ │ │ │ ├── methodsAndProperties.php
│ │ │ │ └── properties.php
│ │ │ ├── each.php
│ │ │ ├── extend.php
│ │ │ ├── json.php
│ │ │ ├── matchExpectation.php
│ │ │ ├── not.php
│ │ │ ├── pipes.php
│ │ │ ├── ray.php
│ │ │ ├── sequence.php
│ │ │ ├── toBe.php
│ │ │ ├── toBeAlpha.php
│ │ │ ├── toBeAlphaNumeric.php
│ │ │ ├── toBeArray.php
│ │ │ ├── toBeBetween.php
│ │ │ ├── toBeBool.php
│ │ │ ├── toBeCallable.php
│ │ │ ├── toBeCamelCase.php
│ │ │ ├── toBeDigits.php
│ │ │ ├── toBeDirectory.php
│ │ │ ├── toBeEmpty.php
│ │ │ ├── toBeFalse.php
│ │ │ ├── toBeFalsy.php
│ │ │ ├── toBeFile.php
│ │ │ ├── toBeFloat.php
│ │ │ ├── toBeGreaterThan.php
│ │ │ ├── toBeGreaterThanOrEqual.php
│ │ │ ├── toBeIn.php
│ │ │ ├── toBeInfinite.php
│ │ │ ├── toBeInstanceOf.php
│ │ │ ├── toBeInt.php
│ │ │ ├── toBeIntBackedEnum.php
│ │ │ ├── toBeInvokable.php
│ │ │ ├── toBeIterable.php
│ │ │ ├── toBeJson.php
│ │ │ ├── toBeKebabCase.php
│ │ │ ├── toBeLessThan.php
│ │ │ ├── toBeLessThanOrEqual.php
│ │ │ ├── toBeList.php
│ │ │ ├── toBeLowercase.php
│ │ │ ├── toBeNAN.php
│ │ │ ├── toBeNull.php
│ │ │ ├── toBeNumeric.php
│ │ │ ├── toBeObject.php
│ │ │ ├── toBeReadableDirectory.php
│ │ │ ├── toBeReadableFile.php
│ │ │ ├── toBeResource.php
│ │ │ ├── toBeScalar.php
│ │ │ ├── toBeSlug.php
│ │ │ ├── toBeSnakeCase.php
│ │ │ ├── toBeString.php
│ │ │ ├── toBeStringBackedEnum.php
│ │ │ ├── toBeStudlyCase.php
│ │ │ ├── toBeTrue.php
│ │ │ ├── toBeTruthy.php
│ │ │ ├── toBeUppercase.php
│ │ │ ├── toBeUrl.php
│ │ │ ├── toBeUuid.php
│ │ │ ├── toBeWritableDirectory.php
│ │ │ ├── toBeWritableFile.php
│ │ │ ├── toContain.php
│ │ │ ├── toContainEqual.php
│ │ │ ├── toContainOnlyInstancesOf.php
│ │ │ ├── toEndWith.php
│ │ │ ├── toEqual.php
│ │ │ ├── toEqualCanonicalizing.php
│ │ │ ├── toEqualWithDelta.php
│ │ │ ├── toHaveAttribute.php
│ │ │ ├── toHaveCamelCaseKeys.php
│ │ │ ├── toHaveConstructor.php
│ │ │ ├── toHaveCount.php
│ │ │ ├── toHaveDestructor.php
│ │ │ ├── toHaveFileSystemPermissions.php
│ │ │ ├── toHaveKebabCaseKeys.php
│ │ │ ├── toHaveKey.php
│ │ │ ├── toHaveKeys.php
│ │ │ ├── toHaveLength.php
│ │ │ ├── toHaveLineCountLessThan.php
│ │ │ ├── toHaveMethod.php
│ │ │ ├── toHaveMethods.php
│ │ │ ├── toHaveMethodsDocumented.php
│ │ │ ├── toHavePrefix.php
│ │ │ ├── toHavePrivateMethodsBesides.php
│ │ │ ├── toHaveProperties.php
│ │ │ ├── toHavePropertiesDocumented.php
│ │ │ ├── toHaveProperty.php
│ │ │ ├── toHaveProtectedMethodsBesides.php
│ │ │ ├── toHavePublicMethodsBesides.php
│ │ │ ├── toHaveSameSize.php
│ │ │ ├── toHaveSnakeCaseKeys.php
│ │ │ ├── toHaveStudlyCaseKeys.php
│ │ │ ├── toHaveSuffix.php
│ │ │ ├── toMatch.php
│ │ │ ├── toMatchArray.php
│ │ │ ├── toMatchConstraint.php
│ │ │ ├── toMatchObject.php
│ │ │ ├── toMatchSnapshot.php
│ │ │ ├── toStartWith.php
│ │ │ ├── toThrow.php
│ │ │ ├── toUseStrictEquality.php
│ │ │ ├── toUseStrictTypes.php
│ │ │ ├── toUseTrait.php
│ │ │ ├── unless.php
│ │ │ └── when.php
│ │ ├── Fail.php
│ │ ├── Fails.php
│ │ ├── Fixture.php
│ │ ├── Helpers.php
│ │ ├── HigherOrderTests.php
│ │ ├── Incompleted.php
│ │ ├── Issue.php
│ │ ├── It.php
│ │ ├── Note.php
│ │ ├── Notices.php
│ │ ├── Pr.php
│ │ ├── References.php
│ │ ├── Repeat.php
│ │ ├── ScopedDatasets/
│ │ │ ├── Directory/
│ │ │ │ ├── Datasets/
│ │ │ │ │ └── Scoped.php
│ │ │ │ ├── NestedDirectory1/
│ │ │ │ │ ├── Datasets.php
│ │ │ │ │ └── TestFileInNestedDirectoryWithDatasetsFile.php
│ │ │ │ ├── NestedDirectory2/
│ │ │ │ │ └── TestFileInNestedDirectory.php
│ │ │ │ ├── TestFileWithLocallyDefinedDataset.php
│ │ │ │ └── TestFileWithScopedDataset.php
│ │ │ └── TestFileOutOfScope.php
│ │ ├── See.php
│ │ ├── Skip.php
│ │ ├── SkipOnPhp.php
│ │ ├── Test.php
│ │ ├── TestCycle.php
│ │ ├── ThrowsNoExceptions.php
│ │ ├── Ticket.php
│ │ ├── Todo.php
│ │ ├── Warnings.php
│ │ └── Wip.php
│ ├── Fixtures/
│ │ ├── Arch/
│ │ │ ├── ToBeIntBackedEnum/
│ │ │ │ ├── HasIntBacking/
│ │ │ │ │ └── HasIntBackingEnum.php
│ │ │ │ └── HasStringBacking/
│ │ │ │ └── HasStringBackingEnum.php
│ │ │ ├── ToBeInvokable/
│ │ │ │ ├── IsInvokable/
│ │ │ │ │ ├── InvokableClass.php
│ │ │ │ │ ├── InvokableClassViaParent.php
│ │ │ │ │ ├── InvokableClassViaTrait.php
│ │ │ │ │ ├── InvokableTrait.php
│ │ │ │ │ └── ParentInvokableClass.php
│ │ │ │ └── IsNotInvokable/
│ │ │ │ └── IsNotInvokableClass.php
│ │ │ ├── ToBeStringBackedEnum/
│ │ │ │ ├── HasIntBacking/
│ │ │ │ │ └── HasIntBackingEnum.php
│ │ │ │ └── HasStringBacking/
│ │ │ │ └── HasStringBackingEnum.php
│ │ │ ├── ToHaveAttribute/
│ │ │ │ ├── Attributes/
│ │ │ │ │ └── AsAttribute.php
│ │ │ │ ├── HaveAttribute/
│ │ │ │ │ └── HaveAttributeClass.php
│ │ │ │ └── NotHaveAttribute/
│ │ │ │ └── NotHaveAttributeClass.php
│ │ │ ├── ToHaveConstructor/
│ │ │ │ ├── HasConstructor/
│ │ │ │ │ └── HasConstructor.php
│ │ │ │ └── HasNoConstructor/
│ │ │ │ └── HasNoConstructor.php
│ │ │ ├── ToHaveDestructor/
│ │ │ │ ├── HasDestructor/
│ │ │ │ │ └── HasDestructor.php
│ │ │ │ └── HasNoDestructor/
│ │ │ │ └── HasNoDestructor.php
│ │ │ ├── ToHaveMethod/
│ │ │ │ ├── HasMethod/
│ │ │ │ │ ├── HasMethod.php
│ │ │ │ │ ├── HasMethodTrait.php
│ │ │ │ │ ├── HasMethodViaParent.php
│ │ │ │ │ ├── HasMethodViaTrait.php
│ │ │ │ │ └── ParentHasMethodClass.php
│ │ │ │ └── HasNoMethod/
│ │ │ │ └── HasNoMethodClass.php
│ │ │ ├── ToHavePrefix/
│ │ │ │ ├── HasNoPrefix/
│ │ │ │ │ └── ClassWithout.php
│ │ │ │ └── HasPrefix/
│ │ │ │ └── PrefixClassWith.php
│ │ │ ├── ToHavePublicMethodsBesides/
│ │ │ │ └── UserController.php
│ │ │ ├── ToHaveSuffix/
│ │ │ │ ├── HasNoSuffix/
│ │ │ │ │ └── ClassWithout.php
│ │ │ │ └── HasSuffix/
│ │ │ │ └── ClassWithSuffix.php
│ │ │ ├── ToUseStrictEquality/
│ │ │ │ ├── NotStrictEquality.php
│ │ │ │ └── StrictEquality.php
│ │ │ └── ToUseStrictTypes/
│ │ │ ├── HasNoStrictType.php
│ │ │ ├── HasStrictType.php
│ │ │ └── HasStrictTypeWithCommentsAbove.php
│ │ ├── CollisionTest.php
│ │ ├── Covers/
│ │ │ ├── CoversClass1.php
│ │ │ ├── CoversClass2.php
│ │ │ ├── CoversClass3.php
│ │ │ └── CoversTrait.php
│ │ ├── DirectoryWithTests/
│ │ │ └── ExampleTest.php
│ │ ├── ExampleTest.php
│ │ ├── Inheritance/
│ │ │ ├── Base/
│ │ │ │ └── ExampleTest.php
│ │ │ └── ExampleTest.php
│ │ ├── UnexpectedOutput.php
│ │ ├── phpunit-in-isolation.xml
│ │ └── phpunit-not-in-isolation.xml
│ ├── Helpers/
│ │ ├── Helper.php
│ │ └── TestInHelpers.php
│ ├── Helpers.php
│ ├── Hooks/
│ │ ├── AfterEachTest.php
│ │ ├── BeforeAllTest.php
│ │ └── BeforeEachTest.php
│ ├── PHPUnit/
│ │ ├── CustomAffixes/
│ │ │ ├── @#$%^&()-_=+.php
│ │ │ ├── A Test With Spaces.php
│ │ │ ├── AdditionalFileExtension.spec.php
│ │ │ ├── FolderWithAn@/
│ │ │ │ └── ExampleTest.php
│ │ │ ├── ManyExtensions.class.test.php
│ │ │ ├── Test 'Case' With Quotes.php
│ │ │ ├── kebab-case-spec.php
│ │ │ └── snake_case_spec.php
│ │ ├── CustomTestCase/
│ │ │ ├── ChildTest.php
│ │ │ ├── CustomTestCase.php
│ │ │ ├── ExecutedTest.php
│ │ │ ├── ParentTest.php
│ │ │ └── UsesPerDirectory.php
│ │ ├── CustomTestCaseInSubFolders/
│ │ │ ├── SubFolder/
│ │ │ │ └── SubFolder/
│ │ │ │ ├── CustomTestCaseInSubFolder.php
│ │ │ │ └── UsesPerSubDirectory.php
│ │ │ └── SubFolder2/
│ │ │ └── UsesPerFile.php
│ │ ├── GlobPatternTests/
│ │ │ ├── SubFolder/
│ │ │ │ └── InnerFolder/
│ │ │ │ └── UsesPerDirectoryAsPattern.php
│ │ │ └── SubFolder2/
│ │ │ └── UsesPerFileAsPattern.php
│ │ └── IgnorableTest.php
│ ├── Pest.php
│ ├── Playground.php
│ ├── Plugins/
│ │ ├── Coverage.php
│ │ └── Traits.php
│ ├── Unit/
│ │ ├── Configuration/
│ │ │ ├── In.php
│ │ │ └── Theme.php
│ │ ├── Console/
│ │ │ └── Help.php
│ │ ├── DatasetsTests.php
│ │ ├── Expectations/
│ │ │ └── OppositeExpectation.php
│ │ ├── Overrides/
│ │ │ └── ThrowableBuilder.php
│ │ ├── Plugins/
│ │ │ ├── Concerns/
│ │ │ │ └── HandleArguments.php
│ │ │ ├── Environment.php
│ │ │ └── Retry.php
│ │ ├── Preset.php
│ │ ├── Support/
│ │ │ ├── Arr.php
│ │ │ ├── Backtrace.php
│ │ │ ├── Container.php
│ │ │ ├── DatasetInfo.php
│ │ │ ├── ExceptionTrace.php
│ │ │ ├── HigherOrderMessage.php
│ │ │ ├── Reflection.php
│ │ │ └── Str.php
│ │ ├── TestName.php
│ │ └── TestSuite.php
│ └── Visual/
│ ├── BeforeEachTestName.php
│ ├── Collision.php
│ ├── Help.php
│ ├── JUnit.php
│ ├── Parallel.php
│ ├── SingleTestOrDirectory.php
│ ├── Success.php
│ ├── TeamCity.php
│ ├── Todo.php
│ └── Version.php
└── tests-external/
└── Features/
└── Expect/
└── toMatchSnapshot.php
================================================
FILE CONTENTS
================================================
================================================
FILE: .editorconfig
================================================
; This file is for unifying the coding style for different editors and IDEs.
; More information at http://editorconfig.org
root = true
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
[*.md]
trim_trailing_whitespace = false
[*.{yml,yaml}]
indent_size = 2
================================================
FILE: .gitattributes
================================================
/docker export-ignore
/docs export-ignore
/tests export-ignore
/scripts export-ignore
/.github export-ignore
.editorconfig export-ignore
.gitattributes export-ignore
.gitignore export-ignore
/phpstan.neon export-ignore
/phpunit.xml export-ignore
/CHANGELOG.md export-ignore
/CONTRIBUTING.md export-ignore
/docker-compose.yml export-ignore
/Makefile export-ignore
/rector.php export-ignore
/README.md export-ignore
/RELEASE.md export-ignore
================================================
FILE: .github/FUNDING.yml
================================================
# These are supported funding model platforms
github: [nunomaduro]
custom: https://www.paypal.com/paypalme/enunomaduro
================================================
FILE: .github/ISSUE_TEMPLATE/bug_report.yml
================================================
name: Bug Report
description: Report an Issue or Bug with the Pest
title: "[Bug]: "
labels: ["bug"]
body:
- type: markdown
attributes:
value: |
We're sorry to hear you have a problem. Can you help us solve it by providing the following details.
- type: textarea
id: what-happened
attributes:
label: What Happened
description: What did you expect to happen?
placeholder: When I use expect()->toBeTrue() in my tests, I get an error
validations:
required: true
- type: textarea
id: how-to-reproduce
attributes:
label: How to Reproduce
description: How did this occur, please add any config values used and provide a set of reliable steps if possible.
placeholder: Install a fresh Laravel app, add Pest, add a test that uses expect()->toBeTrue()
validations:
required: true
- type: input
id: repository-sample
attributes:
label: Sample Repository
description: If possible, please provide a sample repository that reproduces the issue.
placeholder: https://github.com.br/your-username/your-repository
- type: input
id: pest-version
attributes:
label: Pest Version
description: What version of our Package are you running? Please be as specific as possible
placeholder: 2.14.1
validations:
required: true
- type: input
id: php-version
attributes:
label: PHP Version
description: What version of PHP are you running? Please be as specific as possible
placeholder: 8.1.20
validations:
required: true
- type: dropdown
id: operating-systems
attributes:
label: Operation System
description: On which operating systems does the problem occur? You can select more than one.
multiple: true
options:
- macOS
- Windows
- Linux
validations:
required: true
- type: textarea
id: notes
attributes:
label: Notes
description: Use this field to provide any other notes that you feel might be relevant to the issue.
validations:
required: false
================================================
FILE: .github/PULL_REQUEST_TEMPLATE.md
================================================
<!--
- Fill in the form below correctly. This will help the Pest team to understand the PR and also work on it.
-->
### What:
- [ ] Bug Fix
- [ ] New Feature
### Description:
<!-- describe what your PR is solving -->
### Related:
<!-- link to the issue(s) your PR is solving. If it doesn't exist, remove the "Related" section. -->
================================================
FILE: .github/workflows/static.yml
================================================
name: Static Analysis
on:
push:
branches: [4.x]
pull_request:
schedule:
- cron: '0 0 * * *'
concurrency:
group: static-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
static:
if: github.event_name != 'schedule' || github.repository == 'pestphp/pest'
name: Static Tests
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
dependency-version: [prefer-lowest, prefer-stable]
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
tools: composer:v2
coverage: none
extensions: sockets
- name: Get Composer cache directory
id: composer-cache
shell: bash
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache Composer dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: static-php-8.3-${{ matrix.dependency-version }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: |
static-php-8.3-${{ matrix.dependency-version }}-composer-
static-php-8.3-composer-
- name: Install Dependencies
run: composer update --${{ matrix.dependency-version }} --no-interaction --no-progress --ansi
- name: Profanity Check
run: composer test:profanity
- name: Type Check
run: composer test:type:check
- name: Type Coverage
run: composer test:type:coverage
- name: Refacto
run: composer test:refacto
- name: Style
run: composer test:lint
================================================
FILE: .github/workflows/tests.yml
================================================
name: Tests
on:
push:
branches: [4.x]
pull_request:
concurrency:
group: tests-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
tests:
if: github.event_name != 'schedule' || github.repository == 'pestphp/pest'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest, macos-latest] # windows-latest
symfony: ['7.4', '8.0']
php: ['8.3', '8.4', '8.5']
dependency_version: [prefer-stable]
exclude:
- php: '8.3'
symfony: '8.0'
name: PHP ${{ matrix.php }} - Symfony ^${{ matrix.symfony }} - ${{ matrix.os }} - ${{ matrix.dependency_version }}
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: composer:v2
coverage: none
extensions: sockets
- name: Get Composer cache directory
id: composer-cache
shell: bash
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache Composer dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ matrix.os }}-php-${{ matrix.php }}-symfony-${{ matrix.symfony }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: |
${{ matrix.os }}-php-${{ matrix.php }}-symfony-${{ matrix.symfony }}-composer-
${{ matrix.os }}-php-${{ matrix.php }}-composer-
- name: Setup Problem Matches
run: |
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Install PHP dependencies
shell: bash
run: composer update --${{ matrix.dependency_version }} --no-interaction --no-progress --ansi --with="symfony/console:^${{ matrix.symfony }}"
- name: Unit Tests
run: composer test:unit
- name: Parallel Tests
run: composer test:parallel
- name: Integration Tests
run: composer test:integration
================================================
FILE: .gitignore
================================================
.idea/*
.idea/codeStyleSettings.xml
.temp/*
composer.lock
/vendor/
coverage.xml
.phpunit.result.cache
.phpunit.cache
/.php-cs-fixer.php
.php-cs-fixer.cache
.temp/coverage.php
*.swp
*.swo
.vscode/
.STREAM.md
================================================
FILE: CONTRIBUTING.md
================================================
# CONTRIBUTING
Contributions are welcome, and are accepted via pull requests.
Please review these guidelines before submitting any pull requests.
## Process
1. Fork the project
1. Create a new branch
1. Code, test, commit and push
1. Open a pull request detailing your changes. Make sure to follow the [template](.github/PULL_REQUEST_TEMPLATE.md)
## Guidelines
* Please ensure the coding style running `composer lint`.
* Send a coherent commit history, making sure each individual commit in your pull request is meaningful.
* You may need to [rebase](https://git-scm.com/book/en/v2/Git-Branching-Rebasing) to avoid merge conflicts.
* Please remember that we follow [SemVer](http://semver.org/).
## Setup
Clone your fork, then install the dev dependencies:
```bash
composer install
```
## Lint
Lint your code:
```bash
composer lint
```
## Tests
Update the snapshots:
```bash
composer update:snapshots
```
Run all tests:
```bash
composer test
```
Check types:
```bash
composer test:type:check
```
Unit tests:
```bash
composer test:unit
```
Integration tests:
```bash
composer test:integration
```
## Simplified setup using Docker
If you have Docker installed, you can quickly get all dependencies for Pest in place using
our Docker files. Assuming you have the repository cloned, you may run the following
commands:
1. `make build` to build the Docker image
2. `make install` to install Composer dependencies
3. `make test` to run the project tests and analysis tools
If you want to check things work against a specific version of PHP, you may include
the `PHP` build argument when building the image:
```bash
make build ARGS="--build-arg PHP=8.3"
```
The default PHP version will always be the lowest version of PHP supported by Pest.
================================================
FILE: LICENSE.md
================================================
The MIT License (MIT)
Copyright (c) Nuno Maduro <enunomaduro@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
================================================
FILE: README.md
================================================
<p align="center">
<img src="https://raw.githubusercontent.com/pestphp/art/master/v4/social.png" width="600" alt="PEST">
<p align="center">
<a href="https://github.com/pestphp/pest/actions"><img alt="GitHub Workflow Status (master)" src="https://img.shields.io/github/actions/workflow/status/pestphp/pest/tests.yml?branch=4.x&label=Tests%204.x"></a>
<a href="https://packagist.org/packages/pestphp/pest"><img alt="Total Downloads" src="https://img.shields.io/packagist/dt/pestphp/pest"></a>
<a href="https://packagist.org/packages/pestphp/pest"><img alt="Latest Version" src="https://img.shields.io/packagist/v/pestphp/pest"></a>
<a href="https://packagist.org/packages/pestphp/pest"><img alt="License" src="https://img.shields.io/packagist/l/pestphp/pest"></a>
<a href="https://whyphp.dev"><img src="https://img.shields.io/badge/Why_PHP-in_2026-7A86E8?style=flat-square&labelColor=18181b" alt="Why PHP in 2026"></a>
</p>
</p>
------
> Pest v4 Now Available: **[Read the announcement »](https://pestphp.com/docs/pest-v4-is-here-now-with-browser-testing)**.
**Pest** is an elegant PHP testing Framework with a focus on simplicity, meticulously designed to bring back the joy of testing in PHP.
- Explore our docs at **[pestphp.com »](https://pestphp.com)**
- Follow the creator Nuno Maduro:
- YouTube: **[youtube.com/@nunomaduro](https://youtube.com/@nunomaduro)** — Videos every week
- Twitch: **[twitch.tv/nunomaduro](https://twitch.tv/nunomaduro)** — Live coding on Mondays, Wednesdays, and Fridays at 9PM UTC
- Twitter / X: **[x.com/enunomaduro](https://x.com/enunomaduro)**
- LinkedIn: **[linkedin.com/in/nunomaduro](https://www.linkedin.com/in/nunomaduro)**
- Instagram: **[instagram.com/enunomaduro](https://www.instagram.com/enunomaduro)**
- Tiktok: **[tiktok.com/@enunomaduro](https://www.tiktok.com/@enunomaduro)**
## Sponsors
We cannot thank our sponsors enough for their incredible support in funding Pest's development. Their contributions have been instrumental in making Pest the best it can be. For those who are interested in becoming a sponsor, please visit Nuno Maduro's Sponsor page at **[github.com/sponsors/nunomaduro](https://github.com/sponsors/nunomaduro)**.
### Platinum Sponsors
- **[CodeRabbit](https://coderabbit.ai/?ref=pestphp)**
- **[Mailtrap](https://l.rw.rw/pestphp)**
- **[SerpApi](https://serpapi.com/?ref=nunomaduro)**
- **[Tighten](https://tighten.com/?ref=nunomaduro)**
- **[Redberry](https://redberry.international/laravel-development/?utm_source=pest&utm_medium=banner&utm_campaign=pest_sponsorship)**
### Gold Sponsors
- **[CMS Max](https://cmsmax.com/?ref=pestphp)**
### Premium Sponsors
- [Zapiet](https://zapiet.com/?ref=pestphp)
- [Load Forge](https://loadforge.com/?ref=pestphp)
- [Route4Me](https://route4me.com/pt?ref=pestphp)
- [Nerdify](https://getnerdify.com/?ref=pestphp)
- [Akaunting](https://akaunting.com/?ref=pestphp)
- [TestMu AI](https://www.testmuai.com/?utm_medium=sponsor&utm_source=pest)
Pest is an open-sourced software licensed under the **[MIT license](https://opensource.org/licenses/MIT)**.
================================================
FILE: RELEASE.md
================================================
# Release process
When releasing a new version of Pest there are some checks and updates that need to be done:
> **For Pest v3 you should use the `3.x` branch instead.**
- Clear your local repository with: `git add . && git reset --hard && git checkout 4.x`
- On the GitHub repository, check the contents of [github.com/pestphp/pest/compare/{latest_version}...4.x](https://github.com/pestphp/pest/compare/{latest_version}...4.x)
- Update the version number in [src/Pest.php](src/Pest.php)
- Run the tests locally using: `composer test`
- Commit the Pest file with the message: `git commit -m "release: vX.X.X"`
- Push the changes to GitHub
- Check that the CI is passing as expected: [github.com/pestphp/pest/actions](https://github.com/pestphp/pest/actions)
- Tag and push the tag with `git tag vX.X.X && git push --tags`
- Publish release here: [github.com/pestphp/pest/releases/new](https://github.com/pestphp/pest/releases/new).
### Plugins
Plugins should be versioned using the same major (or minor for `0.x` releases) version as Pest core.
================================================
FILE: bin/pest
================================================
#!/usr/bin/env php
<?php
declare(strict_types=1);
use Pest\Kernel;
use Pest\Panic;
use Pest\TestCaseFilters\GitDirtyTestCaseFilter;
use Pest\TestCaseMethodFilters\AssigneeTestCaseFilter;
use Pest\TestCaseMethodFilters\IssueTestCaseFilter;
use Pest\TestCaseMethodFilters\NotesTestCaseFilter;
use Pest\TestCaseMethodFilters\PrTestCaseFilter;
use Pest\TestCaseMethodFilters\TodoTestCaseFilter;
use Pest\TestSuite;
use Symfony\Component\Console\Input\ArgvInput;
use Symfony\Component\Console\Output\ConsoleOutput;
(static function () {
// Ensures Collision's Printer is registered.
$_SERVER['COLLISION_PRINTER'] = 'DefaultPrinter';
$arguments = $originalArguments = $_SERVER['argv'];
$dirty = false;
$todo = false;
$notes = false;
foreach ($arguments as $key => $value) {
if ($value === '--compact') {
$_SERVER['COLLISION_PRINTER_COMPACT'] = 'true';
unset($arguments[$key]);
}
if ($value === '--profile') {
$_SERVER['COLLISION_PRINTER_PROFILE'] = 'true';
unset($arguments[$key]);
}
if (str_contains($value, '--test-directory=')) {
unset($arguments[$key]);
} elseif ($value === '--test-directory') {
unset($arguments[$key]);
if (isset($arguments[$key + 1])) {
unset($arguments[$key + 1]);
}
}
if ($value === '--dirty') {
$dirty = true;
unset($arguments[$key]);
}
if (in_array($value, ['--todo', '--todos'], true)) {
$todo = true;
unset($arguments[$key]);
}
if ($value === '--notes') {
$notes = true;
unset($arguments[$key]);
}
if (str_contains($value, '--assignee=')) {
unset($arguments[$key]);
} elseif ($value === '--assignee') {
unset($arguments[$key]);
if (isset($arguments[$key + 1])) {
unset($arguments[$key + 1]);
}
}
if (str_contains($value, '--issue=')) {
unset($arguments[$key]);
} elseif ($value === '--issue') {
unset($arguments[$key]);
if (isset($arguments[$key + 1])) {
unset($arguments[$key + 1]);
}
}
if (str_contains($value, '--ticket=')) {
unset($arguments[$key]);
} elseif ($value === '--ticket') {
unset($arguments[$key]);
if (isset($arguments[$key + 1])) {
unset($arguments[$key + 1]);
}
}
if (str_contains($value, '--pr=')) {
unset($arguments[$key]);
} elseif ($value === '--pr') {
unset($arguments[$key]);
if (isset($arguments[$key + 1])) {
unset($arguments[$key + 1]);
}
}
if (str_contains($value, '--pull-request=')) {
unset($arguments[$key]);
} elseif ($value === '--pull-request') {
unset($arguments[$key]);
if (isset($arguments[$key + 1])) {
unset($arguments[$key + 1]);
}
}
if (str_contains($value, '--teamcity')) {
unset($arguments[$key]);
$arguments[] = '--no-output';
unset($_SERVER['COLLISION_PRINTER']);
}
}
// Used when Pest is required using composer.
$vendorPath = dirname(__DIR__, 4).'/vendor/autoload.php';
// Used when Pest maintainers are running Pest tests.
$localPath = dirname(__DIR__).'/vendor/autoload.php';
if (file_exists($vendorPath)) {
include_once $vendorPath;
$autoloadPath = $vendorPath;
} else {
include_once $localPath;
$autoloadPath = $localPath;
}
// Get $rootPath based on $autoloadPath
$rootPath = dirname($autoloadPath, 2);
$input = new ArgvInput;
$testSuite = TestSuite::getInstance(
$rootPath,
$input->getParameterOption('--test-directory', 'tests'),
);
if ($dirty) {
$testSuite->tests->addTestCaseFilter(new GitDirtyTestCaseFilter($rootPath));
}
if ($todo) {
$testSuite->tests->addTestCaseMethodFilter(new TodoTestCaseFilter);
}
if ($notes) {
$testSuite->tests->addTestCaseMethodFilter(new NotesTestCaseFilter);
}
if ($assignee = $input->getParameterOption('--assignee')) {
$testSuite->tests->addTestCaseMethodFilter(new AssigneeTestCaseFilter((string) $assignee));
}
if ($issue = $input->getParameterOption('--issue')) {
$testSuite->tests->addTestCaseMethodFilter(new IssueTestCaseFilter((int) $issue));
}
if ($issue = $input->getParameterOption('--ticket')) {
$testSuite->tests->addTestCaseMethodFilter(new IssueTestCaseFilter((int) $issue));
}
if ($pr = $input->getParameterOption('--pr')) {
$testSuite->tests->addTestCaseMethodFilter(new PrTestCaseFilter((int) $pr));
}
if ($pr = $input->getParameterOption('--pull-request')) {
$testSuite->tests->addTestCaseMethodFilter(new PrTestCaseFilter((int) $pr));
}
$isDecorated = $input->getParameterOption('--colors', 'always') !== 'never';
$output = new ConsoleOutput(ConsoleOutput::VERBOSITY_NORMAL, $isDecorated);
try {
$kernel = Kernel::boot($testSuite, $input, $output);
$result = $kernel->handle($originalArguments, $arguments);
$kernel->terminate();
} catch (Throwable|Error $e) {
Panic::with($e);
}
exit($result);
})();
================================================
FILE: bin/worker.php
================================================
<?php
declare(strict_types=1);
use ParaTest\WrapperRunner\ApplicationForWrapperWorker;
use ParaTest\WrapperRunner\WrapperWorker;
use Pest\Kernel;
use Pest\Plugins\Actions\CallsHandleArguments;
use Pest\TestSuite;
use Symfony\Component\Console\Input\ArgvInput;
use Symfony\Component\Console\Output\ConsoleOutput;
use Symfony\Component\Console\Output\OutputInterface;
$bootPest = (static function (): void {
$workerArgv = new ArgvInput;
$rootPath = dirname(PHPUNIT_COMPOSER_INSTALL, 2);
$testSuite = TestSuite::getInstance($rootPath, $workerArgv->getParameterOption(
'--test-directory',
'tests'
));
$input = new ArgvInput;
$output = new ConsoleOutput(OutputInterface::VERBOSITY_NORMAL, true);
Kernel::boot($testSuite, $input, $output);
});
(static function () use ($bootPest): void {
$getopt = getopt('', [
'status-file:',
'progress-file:',
'unexpected-output-file:',
'test-result-file:',
'result-cache-file:',
'teamcity-file:',
'testdox-file:',
'testdox-color',
'testdox-columns:',
'testdox-summary',
'phpunit-argv:',
]);
$composerAutoloadFiles = [
dirname(__DIR__, 3).DIRECTORY_SEPARATOR.'autoload.php',
dirname(__DIR__, 2).DIRECTORY_SEPARATOR.'vendor'.DIRECTORY_SEPARATOR.'autoload.php',
dirname(__DIR__).DIRECTORY_SEPARATOR.'vendor'.DIRECTORY_SEPARATOR.'autoload.php',
];
foreach ($composerAutoloadFiles as $file) {
if (file_exists($file)) {
require_once $file;
define('PHPUNIT_COMPOSER_INSTALL', $file);
break;
}
}
assert(isset($getopt['status-file']) && is_string($getopt['status-file']));
$statusFile = fopen($getopt['status-file'], 'wb');
assert(is_resource($statusFile));
assert(isset($getopt['progress-file']) && is_string($getopt['progress-file']));
assert(isset($getopt['unexpected-output-file']) && is_string($getopt['unexpected-output-file']));
assert(isset($getopt['test-result-file']) && is_string($getopt['test-result-file']));
assert(! isset($getopt['result-cache-file']) || is_string($getopt['result-cache-file']));
assert(! isset($getopt['teamcity-file']) || is_string($getopt['teamcity-file']));
assert(! isset($getopt['testdox-file']) || is_string($getopt['testdox-file']));
assert(isset($getopt['phpunit-argv']) && is_string($getopt['phpunit-argv']));
$phpunitArgv = unserialize($getopt['phpunit-argv'], ['allowed_classes' => false]);
assert(is_array($phpunitArgv));
$bootPest();
$phpunitArgv = CallsHandleArguments::execute($phpunitArgv);
$application = new ApplicationForWrapperWorker(
$phpunitArgv,
$getopt['progress-file'],
$getopt['unexpected-output-file'],
$getopt['test-result-file'],
$getopt['result-cache-file'] ?? null,
$getopt['teamcity-file'] ?? null,
$getopt['testdox-file'] ?? null,
isset($getopt['testdox-color']),
(int) ($getopt['testdox-columns'] ?? null),
);
while (true) {
if (feof(STDIN)) {
$application->end();
exit;
}
$testPath = fgets(STDIN);
if ($testPath === false || $testPath === WrapperWorker::COMMAND_EXIT) {
$application->end();
exit;
}
// It must be a 1 byte string to ensure filesize() is equal to the number of tests executed
$exitCode = $application->runTest(realpath(trim($testPath)));
fwrite($statusFile, (string) $exitCode);
fflush($statusFile);
}
})();
================================================
FILE: composer.json
================================================
{
"name": "pestphp/pest",
"description": "The elegant PHP Testing Framework.",
"keywords": [
"php",
"framework",
"pest",
"unit",
"test",
"testing"
],
"license": "MIT",
"authors": [
{
"name": "Nuno Maduro",
"email": "enunomaduro@gmail.com"
}
],
"require": {
"php": "^8.3.0",
"brianium/paratest": "^7.19.0",
"nunomaduro/collision": "^8.9.1",
"nunomaduro/termwind": "^2.4.0",
"pestphp/pest-plugin": "^4.0.0",
"pestphp/pest-plugin-arch": "^4.0.0",
"pestphp/pest-plugin-mutate": "^4.0.1",
"pestphp/pest-plugin-profanity": "^4.2.1",
"phpunit/phpunit": "^12.5.12",
"symfony/process": "^7.4.5|^8.0.5"
},
"conflict": {
"filp/whoops": "<2.18.3",
"phpunit/phpunit": ">12.5.12",
"sebastian/exporter": "<7.0.0",
"webmozart/assert": "<1.11.0"
},
"autoload": {
"psr-4": {
"Pest\\": "src/"
},
"files": [
"src/Functions.php",
"src/Pest.php"
]
},
"autoload-dev": {
"psr-4": {
"Tests\\Fixtures\\Covers\\": "tests/Fixtures/Covers",
"Tests\\Fixtures\\Inheritance\\": "tests/Fixtures/Inheritance",
"Tests\\Fixtures\\Arch\\": "tests/Fixtures/Arch",
"Tests\\": "tests/PHPUnit/"
},
"files": [
"tests/Autoload.php"
]
},
"require-dev": {
"pestphp/pest-dev-tools": "^4.1.0",
"pestphp/pest-plugin-browser": "^4.3.0",
"pestphp/pest-plugin-type-coverage": "^4.0.3",
"psy/psysh": "^0.12.21"
},
"minimum-stability": "dev",
"prefer-stable": true,
"config": {
"sort-packages": true,
"preferred-install": "dist",
"allow-plugins": {
"pestphp/pest-plugin": true
}
},
"bin": [
"bin/pest"
],
"scripts": {
"refacto": "rector",
"lint": "pint --parallel",
"test:refacto": "rector --dry-run",
"test:lint": "pint --parallel --test",
"test:profanity": "php bin/pest --profanity --compact",
"test:type:check": "phpstan analyse --ansi --memory-limit=-1 --debug",
"test:type:coverage": "php -d memory_limit=-1 bin/pest --type-coverage --min=100",
"test:unit": "php bin/pest --exclude-group=integration --compact",
"test:inline": "php bin/pest --configuration=phpunit.inline.xml",
"test:parallel": "php bin/pest --exclude-group=integration --parallel --processes=3",
"test:integration": "php bin/pest --group=integration -v",
"update:snapshots": "REBUILD_SNAPSHOTS=true php bin/pest --update-snapshots",
"test": [
"@test:refacto",
"@test:lint",
"@test:type:check",
"@test:type:coverage",
"@test:unit",
"@test:parallel",
"@test:integration"
]
},
"extra": {
"pest": {
"plugins": [
"Pest\\Mutate\\Plugins\\Mutate",
"Pest\\Plugins\\Configuration",
"Pest\\Plugins\\Bail",
"Pest\\Plugins\\Cache",
"Pest\\Plugins\\Coverage",
"Pest\\Plugins\\Init",
"Pest\\Plugins\\Environment",
"Pest\\Plugins\\Help",
"Pest\\Plugins\\Memory",
"Pest\\Plugins\\Only",
"Pest\\Plugins\\Printer",
"Pest\\Plugins\\ProcessIsolation",
"Pest\\Plugins\\Profile",
"Pest\\Plugins\\Retry",
"Pest\\Plugins\\Snapshot",
"Pest\\Plugins\\Verbose",
"Pest\\Plugins\\Version",
"Pest\\Plugins\\Shard",
"Pest\\Plugins\\Parallel"
]
},
"phpstan": {
"includes": [
"extension.neon"
]
}
}
}
================================================
FILE: docker/Dockerfile
================================================
ARG PHP=8.1
FROM php:${PHP}-cli-alpine
RUN apk update && apk add \
zip libzip-dev icu-dev git
RUN docker-php-ext-install zip intl
RUN apk add --no-cache linux-headers autoconf build-base
RUN pecl install xdebug
RUN docker-php-ext-enable xdebug
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
WORKDIR /var/www/html
ENTRYPOINT ["php"]
================================================
FILE: extension.neon
================================================
parameters:
universalObjectCratesClasses:
- Pest\Support\HigherOrderTapProxy
- Pest\Expectation
================================================
FILE: overrides/Event/Value/ThrowableBuilder.php
================================================
<?php
/*
* BSD 3-Clause License
*
* Copyright (c) 2001-2023, Sebastian Bergmann
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
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 NunoMaduro\Collision\Contracts\RenderableOnCollisionEditor;
use PHPUnit\Event\NoPreviousThrowableException;
use PHPUnit\Framework\Exception;
use PHPUnit\Util\Filter;
use PHPUnit\Util\ThrowableToStringMapper;
/**
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*/
final readonly class ThrowableBuilder
{
/**
* @throws Exception
* @throws NoPreviousThrowableException
*/
public static function from(\Throwable $t): Throwable
{
$previous = $t->getPrevious();
if ($previous !== null) {
$previous = self::from($previous);
}
$trace = Filter::stackTraceFromThrowableAsString($t);
if ($t instanceof RenderableOnCollisionEditor && $frame = $t->toCollisionEditor()) {
$file = $frame->getFile();
$line = $frame->getLine();
$trace = "$file:$line\n$trace";
}
return new Throwable(
$t::class,
$t->getMessage(),
ThrowableToStringMapper::map($t),
$trace,
$previous,
);
}
}
================================================
FILE: overrides/Logging/JUnit/JunitXmlLogger.php
================================================
<?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\Logging\JUnit;
use DOMDocument;
use DOMElement;
use Pest\Logging\Converter;
use Pest\Support\Container;
use Pest\TestSuite;
use PHPUnit\Event\Code\Test;
use PHPUnit\Event\Code\TestMethod;
use PHPUnit\Event\EventFacadeIsSealedException;
use PHPUnit\Event\Facade;
use PHPUnit\Event\InvalidArgumentException;
use PHPUnit\Event\Telemetry\HRTime;
use PHPUnit\Event\Telemetry\Info;
use PHPUnit\Event\Test\Errored;
use PHPUnit\Event\Test\Failed;
use PHPUnit\Event\Test\Finished;
use PHPUnit\Event\Test\MarkedIncomplete;
use PHPUnit\Event\Test\PreparationStarted;
use PHPUnit\Event\Test\Prepared;
use PHPUnit\Event\Test\PrintedUnexpectedOutput;
use PHPUnit\Event\Test\Skipped;
use PHPUnit\Event\TestSuite\Started;
use PHPUnit\Event\UnknownSubscriberTypeException;
use PHPUnit\TextUI\Output\Printer;
use PHPUnit\Util\Xml;
use function assert;
use function basename;
use function is_int;
use function sprintf;
use function str_replace;
use function trim;
/**
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*/
final class JunitXmlLogger
{
private readonly Printer $printer;
private readonly Converter $converter; // pest-added
private DOMDocument $document;
private DOMElement $root;
/**
* @var DOMElement[]
*/
private array $testSuites = [];
/**
* @var array<int,int>
*/
private array $testSuiteTests = [0];
/**
* @var array<int,int>
*/
private array $testSuiteAssertions = [0];
/**
* @var array<int,int>
*/
private array $testSuiteErrors = [0];
/**
* @var array<int,int>
*/
private array $testSuiteFailures = [0];
/**
* @var array<int,int>
*/
private array $testSuiteSkipped = [0];
/**
* @var array<int,int>
*/
private array $testSuiteTimes = [0];
private int $testSuiteLevel = 0;
private ?DOMElement $currentTestCase = null;
private ?HRTime $time = null;
private bool $prepared = false;
private bool $preparationFailed = false;
/**
* @throws EventFacadeIsSealedException
* @throws UnknownSubscriberTypeException
*/
public function __construct(Printer $printer, Facade $facade)
{
$this->printer = $printer;
$this->converter = new Converter(Container::getInstance()->get(TestSuite::class)->rootPath); // pest-added
$this->registerSubscribers($facade);
$this->createDocument();
}
public function flush(): void
{
$this->printer->print($this->document->saveXML() ?: '');
$this->printer->flush();
}
public function testSuiteStarted(Started $event): void
{
$testSuite = $this->document->createElement('testsuite');
$testSuite->setAttribute('name', $this->converter->getTestSuiteName($event->testSuite())); // pest-changed
if ($event->testSuite()->isForTestClass()) {
$testSuite->setAttribute('file', $this->converter->getTestSuiteLocation($event->testSuite()) ?? ''); // pest-changed
}
if ($this->testSuiteLevel > 0) {
$this->testSuites[$this->testSuiteLevel]->appendChild($testSuite);
} else {
$this->root->appendChild($testSuite);
}
$this->testSuiteLevel++;
$this->testSuites[$this->testSuiteLevel] = $testSuite;
$this->testSuiteTests[$this->testSuiteLevel] = 0;
$this->testSuiteAssertions[$this->testSuiteLevel] = 0;
$this->testSuiteErrors[$this->testSuiteLevel] = 0;
$this->testSuiteFailures[$this->testSuiteLevel] = 0;
$this->testSuiteSkipped[$this->testSuiteLevel] = 0;
$this->testSuiteTimes[$this->testSuiteLevel] = 0;
}
public function testSuiteFinished(): void
{
$this->testSuites[$this->testSuiteLevel]->setAttribute(
'tests',
(string) $this->testSuiteTests[$this->testSuiteLevel],
);
$this->testSuites[$this->testSuiteLevel]->setAttribute(
'assertions',
(string) $this->testSuiteAssertions[$this->testSuiteLevel],
);
$this->testSuites[$this->testSuiteLevel]->setAttribute(
'errors',
(string) $this->testSuiteErrors[$this->testSuiteLevel],
);
$this->testSuites[$this->testSuiteLevel]->setAttribute(
'failures',
(string) $this->testSuiteFailures[$this->testSuiteLevel],
);
$this->testSuites[$this->testSuiteLevel]->setAttribute(
'skipped',
(string) $this->testSuiteSkipped[$this->testSuiteLevel],
);
$this->testSuites[$this->testSuiteLevel]->setAttribute(
'time',
sprintf('%F', $this->testSuiteTimes[$this->testSuiteLevel]),
);
if ($this->testSuiteLevel > 1) {
$this->testSuiteTests[$this->testSuiteLevel - 1] += $this->testSuiteTests[$this->testSuiteLevel];
$this->testSuiteAssertions[$this->testSuiteLevel - 1] += $this->testSuiteAssertions[$this->testSuiteLevel];
$this->testSuiteErrors[$this->testSuiteLevel - 1] += $this->testSuiteErrors[$this->testSuiteLevel];
$this->testSuiteFailures[$this->testSuiteLevel - 1] += $this->testSuiteFailures[$this->testSuiteLevel];
$this->testSuiteSkipped[$this->testSuiteLevel - 1] += $this->testSuiteSkipped[$this->testSuiteLevel];
$this->testSuiteTimes[$this->testSuiteLevel - 1] += $this->testSuiteTimes[$this->testSuiteLevel];
}
$this->testSuiteLevel--;
}
/**
* @throws InvalidArgumentException
*/
public function testPreparationStarted(PreparationStarted $event): void
{
$this->createTestCase($event);
}
public function testPreparationFailed(): void
{
$this->preparationFailed = true;
}
public function testPrepared(): void
{
$this->prepared = true;
}
public function testPrintedUnexpectedOutput(PrintedUnexpectedOutput $event): void
{
assert($this->currentTestCase !== null);
$systemOut = $this->document->createElement(
'system-out',
Xml::prepareString($event->output()),
);
$this->currentTestCase->appendChild($systemOut);
}
/**
* @throws InvalidArgumentException
*/
public function testFinished(Finished $event): void
{
if (! $this->prepared || $this->preparationFailed) {
return;
}
$this->handleFinish($event->telemetryInfo(), $event->numberOfAssertionsPerformed());
}
/**
* @throws InvalidArgumentException
*/
public function testMarkedIncomplete(MarkedIncomplete $event): void
{
$this->handleIncompleteOrSkipped($event);
}
/**
* @throws InvalidArgumentException
*/
public function testSkipped(Skipped $event): void
{
$this->handleIncompleteOrSkipped($event);
}
/**
* @throws InvalidArgumentException
*/
public function testErrored(Errored $event): void
{
$this->handleFault($event, 'error');
$this->testSuiteErrors[$this->testSuiteLevel]++;
}
/**
* @throws InvalidArgumentException
*/
public function testFailed(Failed $event): void
{
$this->handleFault($event, 'failure');
$this->testSuiteFailures[$this->testSuiteLevel]++;
}
/**
* @throws InvalidArgumentException
*/
private function handleFinish(Info $telemetryInfo, int $numberOfAssertionsPerformed): void
{
assert($this->currentTestCase !== null);
assert($this->time !== null);
$time = $telemetryInfo->time()->duration($this->time)->asFloat();
$this->testSuiteAssertions[$this->testSuiteLevel] += $numberOfAssertionsPerformed;
$this->currentTestCase->setAttribute(
'assertions',
(string) $numberOfAssertionsPerformed,
);
$this->currentTestCase->setAttribute(
'time',
sprintf('%F', $time),
);
$this->testSuites[$this->testSuiteLevel]->appendChild(
$this->currentTestCase,
);
$this->testSuiteTests[$this->testSuiteLevel]++;
$this->testSuiteTimes[$this->testSuiteLevel] += $time;
$this->currentTestCase = null;
$this->time = null;
$this->prepared = false;
}
/**
* @throws EventFacadeIsSealedException
* @throws UnknownSubscriberTypeException
*/
private function registerSubscribers(Facade $facade): void
{
$facade->registerSubscribers(
new TestSuiteStartedSubscriber($this),
new TestSuiteFinishedSubscriber($this),
new TestPreparationStartedSubscriber($this),
new TestPreparationFailedSubscriber($this),
new TestPreparedSubscriber($this),
new TestPrintedUnexpectedOutputSubscriber($this),
new TestFinishedSubscriber($this),
new TestErroredSubscriber($this),
new TestFailedSubscriber($this),
new TestMarkedIncompleteSubscriber($this),
new TestSkippedSubscriber($this),
new TestRunnerExecutionFinishedSubscriber($this),
);
}
private function createDocument(): void
{
$this->document = new DOMDocument('1.0', 'UTF-8');
$this->document->formatOutput = true;
$this->root = $this->document->createElement('testsuites');
$this->document->appendChild($this->root);
}
/**
* @throws InvalidArgumentException
*/
private function handleFault(Errored|Failed $event, string $type): void
{
if (! $this->prepared) {
$this->createTestCase($event);
}
assert($this->currentTestCase !== null);
$buffer = $this->converter->getTestCaseMethodName($event->test()); // pest-changed
$throwable = $event->throwable();
$buffer .= trim(
$this->converter->getExceptionMessage($throwable).PHP_EOL. // pest-changed
$this->converter->getExceptionDetails($throwable), // pest-changed
);
$fault = $this->document->createElement(
$type,
Xml::prepareString($buffer),
);
$fault->setAttribute('type', $throwable->className());
$this->currentTestCase->appendChild($fault);
if (! $this->prepared) {
$this->handleFinish($event->telemetryInfo(), 0);
}
}
/**
* @throws InvalidArgumentException
*/
private function handleIncompleteOrSkipped(MarkedIncomplete|Skipped $event): void
{
if (! $this->prepared) {
$this->createTestCase($event);
}
assert($this->currentTestCase !== null);
$skipped = $this->document->createElement('skipped');
$this->currentTestCase->appendChild($skipped);
$this->testSuiteSkipped[$this->testSuiteLevel]++;
if (! $this->prepared) {
$this->handleFinish($event->telemetryInfo(), 0);
}
}
/**
* @throws InvalidArgumentException
*/
private function testAsString(Test $test): string
{
if ($test->isPhpt()) {
return basename($test->file());
}
assert($test instanceof TestMethod);
return sprintf(
'%s::%s%s',
$test->className(),
$this->name($test),
PHP_EOL,
);
}
/**
* @throws InvalidArgumentException
*/
private function name(Test $test): string
{
if ($test->isPhpt()) {
return basename($test->file());
}
assert($test instanceof TestMethod);
if (! $test->testData()->hasDataFromDataProvider()) {
return $test->methodName();
}
$dataSetName = $test->testData()->dataFromDataProvider()->dataSetName();
if (is_int($dataSetName)) {
return sprintf(
'%s with data set #%d',
$test->methodName(),
$dataSetName,
);
}
return sprintf(
'%s with data set "%s"',
$test->methodName(),
$dataSetName,
);
}
/**
* @throws InvalidArgumentException
*
* @phpstan-assert !null $this->currentTestCase
*/
private function createTestCase(Errored|Failed|MarkedIncomplete|PreparationStarted|Prepared|Skipped $event): void
{
$testCase = $this->document->createElement('testcase');
$test = $event->test();
$file = $this->converter->getTestCaseLocation($test); // pest-added
$testCase->setAttribute('name', $this->converter->getTestCaseMethodName($test)); // pest-changed
$testCase->setAttribute('file', $file); // pest-changed
if ($test->isTestMethod()) {
assert($test instanceof TestMethod);
// $testCase->setAttribute('line', (string) $test->line()); // pest-removed
$className = $this->converter->getTrimmedTestClassName($test); // pest-added
$testCase->setAttribute('class', $className); // pest-changed
$testCase->setAttribute('classname', str_replace('\\', '.', $className)); // pest-changed
}
$this->currentTestCase = $testCase;
$this->time = $event->telemetryInfo()->time();
}
}
================================================
FILE: overrides/Runner/Filter/NameFilterIterator.php
================================================
<?php
/*
* BSD 3-Clause License
*
* Copyright (c) 2001-2023, Sebastian Bergmann
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
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\Runner\Filter;
use Pest\Contracts\HasPrintableTestCaseName;
use PHPUnit\Framework\Test;
use PHPUnit\Framework\TestSuite;
use PHPUnit\Runner\PhptTestCase;
use RecursiveFilterIterator;
use RecursiveIterator;
use function end;
use function preg_match;
use function sprintf;
use function str_replace;
/**
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*/
abstract class NameFilterIterator extends RecursiveFilterIterator
{
/**
* @psalm-var non-empty-string
*/
private readonly string $regularExpression;
private readonly ?int $dataSetMinimum;
private readonly ?int $dataSetMaximum;
/**
* @psalm-param RecursiveIterator<int, Test> $iterator
* @psalm-param non-empty-string $filter
*/
public function __construct(RecursiveIterator $iterator, string $filter)
{
parent::__construct($iterator);
$preparedFilter = $this->prepareFilter($filter);
$this->regularExpression = $preparedFilter['regularExpression'];
$this->dataSetMinimum = $preparedFilter['dataSetMinimum'];
$this->dataSetMaximum = $preparedFilter['dataSetMaximum'];
}
public function accept(): bool
{
$test = $this->getInnerIterator()->current();
if ($test instanceof TestSuite) {
return true;
}
if ($test instanceof PhptTestCase) {
return false;
}
if ($test instanceof HasPrintableTestCaseName) {
$name = trim(
$test::getPrintableTestCaseName().'::'.$test->getPrintableTestCaseMethodName().$test->dataSetAsString()
);
} else {
$name = $test::class.'::'.$test->nameWithDataSet();
}
$accepted = @preg_match($this->regularExpression, $name, $matches) === 1;
if ($accepted && isset($this->dataSetMaximum)) {
$set = end($matches);
$accepted = $set >= $this->dataSetMinimum && $set <= $this->dataSetMaximum;
}
return $this->doAccept($accepted);
}
abstract protected function doAccept(bool $result): bool;
/**
* @psalm-param non-empty-string $filter
*
* @psalm-return array{regularExpression: non-empty-string, dataSetMinimum: ?int, dataSetMaximum: ?int}
*/
private function prepareFilter(string $filter): array
{
$dataSetMinimum = null;
$dataSetMaximum = null;
if (@preg_match($filter, '') === false) {
// Handles:
// * testAssertEqualsSucceeds#4
// * testAssertEqualsSucceeds#4-8
if (preg_match('/^(.*?)#(\d+)(?:-(\d+))?$/', $filter, $matches)) {
if (isset($matches[3]) && $matches[2] < $matches[3]) {
$filter = sprintf(
'%s.*with data set #(\d+)$',
$matches[1],
);
$dataSetMinimum = (int) $matches[2];
$dataSetMaximum = (int) $matches[3];
} else {
$filter = sprintf(
'%s.*with data set #%s$',
$matches[1],
$matches[2],
);
}
} // Handles:
// * testDetermineJsonError@JSON_ERROR_NONE
// * testDetermineJsonError@JSON.*
elseif (preg_match('/^(.*?)@(.+)$/', $filter, $matches)) {
$filter = sprintf(
'%s.*with data set "%s"$',
$matches[1],
$matches[2],
);
}
// Escape delimiters in regular expression. Do NOT use preg_quote,
// to keep magic characters.
$filter = sprintf(
'/%s/i',
str_replace(
'/',
'\\/',
$filter,
),
);
}
return [
'regularExpression' => $filter,
'dataSetMinimum' => $dataSetMinimum,
'dataSetMaximum' => $dataSetMaximum,
];
}
}
================================================
FILE: overrides/Runner/ResultCache/DefaultResultCache.php
================================================
<?php
/*
* BSD 3-Clause License
*
* Copyright (c) 2001-2023, Sebastian Bergmann
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
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\Runner\ResultCache;
use const DIRECTORY_SEPARATOR;
use const LOCK_EX;
use PHPUnit\Framework\TestStatus\TestStatus;
use PHPUnit\Runner\DirectoryDoesNotExistException;
use PHPUnit\Runner\Exception;
use PHPUnit\Util\Filesystem;
use function array_keys;
use function assert;
use function dirname;
use function file_get_contents;
use function file_put_contents;
use function is_array;
use function is_dir;
use function is_file;
use function json_decode;
use function json_encode;
use function Pest\version;
/**
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*/
final class DefaultResultCache implements ResultCache
{
private const string DEFAULT_RESULT_CACHE_FILENAME = '.phpunit.result.cache';
private readonly string $cacheFilename;
/**
* @var array<string, TestStatus>
*/
private array $defects = [];
/**
* @var array<string, float>
*/
private array $times = [];
public function __construct(?string $filepath = null)
{
if ($filepath !== null && is_dir($filepath)) {
$filepath .= DIRECTORY_SEPARATOR.self::DEFAULT_RESULT_CACHE_FILENAME;
}
$this->cacheFilename = $filepath ?? $_ENV['PHPUNIT_RESULT_CACHE'] ?? self::DEFAULT_RESULT_CACHE_FILENAME;
}
public function setStatus(ResultCacheId $id, TestStatus $status): void
{
if ($status->isSuccess()) {
return;
}
$this->defects[$id->asString()] = $status;
}
public function status(ResultCacheId $id): TestStatus
{
return $this->defects[$id->asString()] ?? TestStatus::unknown();
}
public function setTime(ResultCacheId $id, float $time): void
{
$this->times[$id->asString()] = $time;
}
public function time(ResultCacheId $id): float
{
return $this->times[$id->asString()] ?? 0.0;
}
public function mergeWith(self $other): void
{
foreach ($other->defects as $id => $defect) {
$this->defects[$id] = $defect;
}
foreach ($other->times as $id => $time) {
$this->times[$id] = $time;
}
}
public function load(): void
{
if (! is_file($this->cacheFilename)) {
return;
}
$contents = file_get_contents($this->cacheFilename);
if ($contents === false) {
return;
}
$data = json_decode(
$contents,
true,
);
if ($data === null) {
return;
}
if (! isset($data['version'])) {
return;
}
if ($data['version'] !== $this->cacheVersion()) {
return;
}
assert(isset($data['defects']) && is_array($data['defects']));
assert(isset($data['times']) && is_array($data['times']));
foreach (array_keys($data['defects']) as $test) {
$data['defects'][$test] = TestStatus::from($data['defects'][$test]);
}
$this->defects = $data['defects'];
$this->times = $data['times'];
}
/**
* @throws Exception
*/
public function persist(): void
{
if (! Filesystem::createDirectory(dirname($this->cacheFilename))) {
throw new DirectoryDoesNotExistException(dirname($this->cacheFilename));
}
$data = [
'version' => $this->cacheVersion(),
'defects' => [],
'times' => $this->times,
];
foreach ($this->defects as $test => $status) {
$data['defects'][$test] = $status->asInt();
}
file_put_contents(
$this->cacheFilename,
json_encode($data),
LOCK_EX,
);
}
/**
* Returns the cache version.
*/
private function cacheVersion(): string
{
return 'pest_'.version();
}
}
================================================
FILE: overrides/Runner/TestSuiteLoader.php
================================================
<?php
/*
* BSD 3-Clause License
*
* Copyright (c) 2001-2023, Sebastian Bergmann
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
declare(strict_types=1);
namespace PHPUnit\Runner;
use Exception;
use Pest\Contracts\HasPrintableTestCaseName;
use Pest\Panic;
use Pest\TestCases\IgnorableTestCase;
use Pest\TestSuite;
use PHPUnit\Framework\TestCase;
use ReflectionClass;
use ReflectionException;
use Throwable;
use function array_diff;
use function array_values;
use function basename;
use function class_exists;
use function get_declared_classes;
use function substr;
/**
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*/
final class TestSuiteLoader
{
/**
* @psalm-var list<class-string>
*/
private static array $loadedClasses = [];
/**
* @psalm-var array<string, array<class-string>>
*/
private static array $loadedClassesByFilename = [];
/**
* @psalm-var list<class-string>
*/
private static array $declaredClasses = [];
public function __construct()
{
if (empty(self::$declaredClasses)) {
self::$declaredClasses = get_declared_classes();
}
}
/**
* @throws Exception
*/
public function load(string $suiteClassFile): ReflectionClass
{
$suiteClassName = $this->classNameFromFileName($suiteClassFile);
(static function () use ($suiteClassFile) {
try {
include_once $suiteClassFile;
} catch (Throwable $e) {
Panic::with($e);
}
TestSuite::getInstance()->tests->makeIfNeeded($suiteClassFile);
})();
$loadedClasses = array_values(
array_diff(
get_declared_classes(),
array_merge(
self::$declaredClasses,
self::$loadedClasses
)
)
);
self::$loadedClasses = array_merge($loadedClasses, self::$loadedClasses);
foreach ($loadedClasses as $loadedClass) {
$reflection = new ReflectionClass($loadedClass);
$filename = $reflection->getFileName();
self::$loadedClassesByFilename[$filename] = [
$loadedClass,
...self::$loadedClassesByFilename[$filename] ?? [],
];
}
$loadedClasses = array_merge(self::$loadedClassesByFilename[$suiteClassFile] ?? [], $loadedClasses);
if (empty($loadedClasses)) {
return $this->exceptionFor($suiteClassName, $suiteClassFile);
}
$testCaseFound = false;
$class = false;
foreach (array_reverse($loadedClasses) as $loadedClass) {
if (
is_subclass_of($loadedClass, HasPrintableTestCaseName::class)
|| is_subclass_of($loadedClass, TestCase::class)) {
try {
$class = new ReflectionClass($loadedClass);
// @codeCoverageIgnoreStart
} catch (ReflectionException) {
continue;
}
if ($class->isAbstract() || ($suiteClassFile !== $class->getFileName())) {
if (! str_contains($class->getFileName(), 'TestCaseFactory.php')) {
continue;
}
}
$suiteClassName = $loadedClass;
$testCaseFound = true;
break;
}
}
if (! $testCaseFound) {
foreach (array_reverse($loadedClasses) as $loadedClass) {
$offset = 0 - strlen($suiteClassName);
if (stripos(substr($loadedClass, $offset - 1), '\\'.$suiteClassName) === 0 ||
stripos(substr($loadedClass, $offset - 1), '_'.$suiteClassName) === 0) {
try {
$class = new ReflectionClass($loadedClass);
// @codeCoverageIgnoreStart
} catch (ReflectionException) {
continue;
}
$suiteClassName = $loadedClass;
$testCaseFound = true;
break;
}
}
}
if (! $testCaseFound) {
return $this->exceptionFor($suiteClassName, $suiteClassFile);
}
if (! class_exists($suiteClassName, false)) {
return $this->exceptionFor($suiteClassName, $suiteClassFile);
}
// @codeCoverageIgnoreEnd
if ($class->isSubclassOf(TestCase::class) && ! $class->isAbstract()) {
return $class;
}
if ($class->hasMethod('suite')) {
try {
$method = $class->getMethod('suite');
// @codeCoverageIgnoreStart
} catch (ReflectionException $e) {
throw new Exception($e->getMessage(), (int) $e->getCode(), $e);
}
// @codeCoverageIgnoreEnd
if (! $method->isAbstract() && $method->isPublic() && $method->isStatic()) {
return $class;
}
}
return $this->exceptionFor($suiteClassName, $suiteClassFile);
}
public function reload(ReflectionClass $aClass): ReflectionClass
{
return $aClass;
}
private function classNameFromFileName(string $suiteClassFile): string
{
$className = basename($suiteClassFile, '.php');
$dotPos = strpos($className, '.');
if ($dotPos !== false) {
$className = substr($className, 0, $dotPos);
}
return $className;
}
private function exceptionFor(string $className, string $filename): ReflectionClass
{
return new ReflectionClass(IgnorableTestCase::class);
}
}
================================================
FILE: overrides/TextUI/Command/Commands/WarmCodeCoverageCacheCommand.php
================================================
<?php
/*
* BSD 3-Clause License
*
* Copyright (c) 2001-2023, Sebastian Bergmann
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
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\Command;
use const PHP_EOL;
use PHPUnit\TextUI\Configuration\CodeCoverageFilterRegistry;
use PHPUnit\TextUI\Configuration\Configuration;
use PHPUnit\TextUI\Configuration\NoCoverageCacheDirectoryException;
use SebastianBergmann\CodeCoverage\StaticAnalysis\CacheWarmer;
use SebastianBergmann\Timer\NoActiveTimerException;
use SebastianBergmann\Timer\Timer;
/**
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*/
final readonly class WarmCodeCoverageCacheCommand implements Command
{
private Configuration $configuration;
private CodeCoverageFilterRegistry $codeCoverageFilterRegistry;
public function __construct(Configuration $configuration, CodeCoverageFilterRegistry $codeCoverageFilterRegistry)
{
$this->configuration = $configuration;
$this->codeCoverageFilterRegistry = $codeCoverageFilterRegistry;
}
/**
* @throws NoActiveTimerException
* @throws NoCoverageCacheDirectoryException
*/
public function execute(): Result
{
if (! $this->configuration->hasCoverageCacheDirectory()) {
return Result::from(
'Cache for static analysis has not been configured'.PHP_EOL,
Result::FAILURE,
);
}
$this->codeCoverageFilterRegistry->init($this->configuration, true);
if (! $this->codeCoverageFilterRegistry->configured()) {
return Result::from(
'Filter for code coverage has not been configured'.PHP_EOL,
Result::FAILURE,
);
}
$timer = new Timer;
$timer->start();
(new CacheWarmer)->warmCache(
$this->configuration->coverageCacheDirectory(),
! $this->configuration->disableCodeCoverageIgnore(),
$this->configuration->ignoreDeprecatedCodeUnitsFromCodeCoverage(),
$this->codeCoverageFilterRegistry->get(),
);
return Result::from();
}
}
================================================
FILE: overrides/TextUI/Output/Default/ProgressPrinter/Subscriber/TestSkippedSubscriber.php
================================================
<?php
/*
* BSD 3-Clause License
*
* Copyright (c) 2001-2023, Sebastian Bergmann
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
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 Pest\Logging\TeamCity\Subscriber;
use PHPUnit\Event\Test\Skipped;
use PHPUnit\Event\Test\SkippedSubscriber;
use ReflectionClass;
/**
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*/
final class TestSkippedSubscriber extends Subscriber implements SkippedSubscriber
{
public function notify(Skipped $event): void
{
if (str_contains($event->message(), '__TODO__')) {
$this->printTodoItem();
}
$this->logger()->testSkipped($event);
}
/**
* Prints a "T" to the standard PHPUnit output to indicate a todo item.
*/
private function printTodoItem(): void
{
$mirror = new ReflectionClass($this->printer());
$printerMirror = $mirror->getMethod('printProgress');
$printerMirror->invoke($this->printer(), 'T');
}
}
================================================
FILE: overrides/TextUI/TestSuiteFilterProcessor.php
================================================
<?php
/*
* BSD 3-Clause License
*
* Copyright (c) 2001-2023, Sebastian Bergmann
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
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;
use Pest\Plugins\Only;
use Pest\Runner\Filter\EnsureTestCaseIsInitiatedFilter;
use PHPUnit\Event;
use PHPUnit\Framework\TestSuite;
use PHPUnit\Runner\Filter\Factory;
use PHPUnit\TextUI\Configuration\Configuration;
use PHPUnit\TextUI\Configuration\FilterNotConfiguredException;
use function array_map;
/**
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*/
final readonly class TestSuiteFilterProcessor
{
/**
* @throws Event\RuntimeException
* @throws FilterNotConfiguredException
*/
public function process(Configuration $configuration, TestSuite $suite): void
{
$factory = new Factory;
// @phpstan-ignore-next-line
(fn () => $this->filters[] = [
'className' => EnsureTestCaseIsInitiatedFilter::class,
'argument' => '',
])->call($factory);
if (! $configuration->hasFilter() &&
! $configuration->hasGroups() &&
! $configuration->hasExcludeGroups() &&
! $configuration->hasExcludeFilter() &&
! $configuration->hasTestsCovering() &&
! $configuration->hasTestsUsing() &&
! Only::isEnabled()) {
$suite->injectFilter($factory);
return;
}
if ($configuration->hasExcludeGroups()) {
$factory->addExcludeGroupFilter(
$configuration->excludeGroups(),
);
}
if (Only::isEnabled()) {
$factory->addIncludeGroupFilter([Only::group()]);
} elseif ($configuration->hasGroups()) {
$factory->addIncludeGroupFilter(
$configuration->groups(),
);
}
if ($configuration->hasTestsCovering()) {
$factory->addIncludeGroupFilter(
array_map(
static fn (string $name): string => '__phpunit_covers_'.$name,
$configuration->testsCovering(),
),
);
}
if ($configuration->hasTestsUsing()) {
$factory->addIncludeGroupFilter(
array_map(
static fn (string $name): string => '__phpunit_uses_'.$name,
$configuration->testsUsing(),
),
);
}
if ($configuration->hasExcludeFilter()) {
$factory->addExcludeNameFilter(
$configuration->excludeFilter(),
);
}
if ($configuration->hasFilter()) {
$factory->addIncludeNameFilter(
$configuration->filter(),
);
}
$suite->injectFilter($factory);
Event\Facade::emitter()->testSuiteFiltered(
Event\TestSuite\TestSuiteBuilder::from($suite),
);
}
}
================================================
FILE: phpstan-baseline.neon
================================================
parameters:
ignoreErrors:
-
message: '#^Parameter \#1 of callable callable\(Pest\\Expectation\<string\|null\>\)\: Pest\\Arch\\Contracts\\ArchExpectation expects Pest\\Expectation\<string\|null\>, Pest\\Expectation\<string\|null\> given\.$#'
identifier: argument.type
count: 1
path: src/ArchPresets/AbstractPreset.php
-
message: '#^Trait Pest\\Concerns\\Expectable is used zero times and is not analysed\.$#'
identifier: trait.unused
count: 1
path: src/Concerns/Expectable.php
-
message: '#^Trait Pest\\Concerns\\Logging\\WritesToConsole is used zero times and is not analysed\.$#'
identifier: trait.unused
count: 1
path: src/Concerns/Logging/WritesToConsole.php
-
message: '#^Trait Pest\\Concerns\\Testable is used zero times and is not analysed\.$#'
identifier: trait.unused
count: 1
path: src/Concerns/Testable.php
-
message: '#^Loose comparison using \!\= between \(Closure\|null\) and false will always evaluate to false\.$#'
identifier: notEqual.alwaysFalse
count: 1
path: src/Expectation.php
-
message: '#^Method Pest\\Expectation\:\:and\(\) should return Pest\\Expectation\<TAndValue\> but returns \(Pest\\Expectation&TAndValue\)\|Pest\\Expectation\<TAndValue of mixed\>\.$#'
identifier: return.type
count: 1
path: src/Expectation.php
-
message: '#^PHPDoc tag @property for property Pest\\Expectation\:\:\$each contains generic class Pest\\Expectations\\EachExpectation but does not specify its types\: TValue$#'
identifier: missingType.generics
count: 1
path: src/Expectation.php
-
message: '#^PHPDoc tag @property for property Pest\\Expectation\:\:\$not contains generic class Pest\\Expectations\\OppositeExpectation but does not specify its types\: TValue$#'
identifier: missingType.generics
count: 1
path: src/Expectation.php
-
message: '#^Parameter \#2 \$newScope of method Closure\:\:bindTo\(\) expects ''static''\|class\-string\|object\|null, string given\.$#'
identifier: argument.type
count: 1
path: src/Expectation.php
-
message: '#^Function expect\(\) should return Pest\\Expectation\<TValue\|null\> but returns Pest\\Expectation\<TValue\|null\>\.$#'
identifier: return.type
count: 1
path: src/Functions.php
-
message: '#^Parameter \#1 \$argv of method PHPUnit\\TextUI\\Application\:\:run\(\) expects list\<string\>, array\<int, string\> given\.$#'
identifier: argument.type
count: 1
path: src/Kernel.php
-
message: '#^Call to an undefined method object&TValue of mixed\:\:__toString\(\)\.$#'
identifier: method.notFound
count: 1
path: src/Mixins/Expectation.php
-
message: '#^Call to an undefined method object&TValue of mixed\:\:toArray\(\)\.$#'
identifier: method.notFound
count: 4
path: src/Mixins/Expectation.php
-
message: '#^Call to an undefined method object&TValue of mixed\:\:toSnapshot\(\)\.$#'
identifier: method.notFound
count: 1
path: src/Mixins/Expectation.php
-
message: '#^Call to an undefined method object&TValue of mixed\:\:toString\(\)\.$#'
identifier: method.notFound
count: 1
path: src/Mixins/Expectation.php
-
message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertTrue\(\) with true will always evaluate to true\.$#'
identifier: staticMethod.alreadyNarrowedType
count: 2
path: src/Mixins/Expectation.php
-
message: '#^PHPDoc tag @var with type callable\(\)\: bool is not subtype of native type Closure\|null\.$#'
identifier: varTag.nativeType
count: 1
path: src/PendingCalls/TestCall.php
-
message: '#^Parameter \#1 \$argv of class Symfony\\Component\\Console\\Input\\ArgvInput constructor expects list\<string\>\|null, array\<int, string\> given\.$#'
identifier: argument.type
count: 1
path: src/Plugins/Parallel.php
-
message: '#^Parameter \#13 \$testRunnerTriggeredDeprecationEvents of class PHPUnit\\TestRunner\\TestResult\\TestResult constructor expects list\<PHPUnit\\Event\\TestRunner\\DeprecationTriggered\>, array given\.$#'
identifier: argument.type
count: 1
path: src/Plugins/Parallel/Paratest/WrapperRunner.php
-
message: '#^Parameter \#14 \$testRunnerTriggeredWarningEvents of class PHPUnit\\TestRunner\\TestResult\\TestResult constructor expects list\<PHPUnit\\Event\\TestRunner\\WarningTriggered\>, array given\.$#'
identifier: argument.type
count: 1
path: src/Plugins/Parallel/Paratest/WrapperRunner.php
-
message: '#^Parameter \#15 \$errors of class PHPUnit\\TestRunner\\TestResult\\TestResult constructor expects list\<PHPUnit\\TestRunner\\TestResult\\Issues\\Issue\>, array given\.$#'
identifier: argument.type
count: 1
path: src/Plugins/Parallel/Paratest/WrapperRunner.php
-
message: '#^Parameter \#16 \$deprecations of class PHPUnit\\TestRunner\\TestResult\\TestResult constructor expects list\<PHPUnit\\TestRunner\\TestResult\\Issues\\Issue\>, array given\.$#'
identifier: argument.type
count: 1
path: src/Plugins/Parallel/Paratest/WrapperRunner.php
-
message: '#^Parameter \#17 \$notices of class PHPUnit\\TestRunner\\TestResult\\TestResult constructor expects list\<PHPUnit\\TestRunner\\TestResult\\Issues\\Issue\>, array given\.$#'
identifier: argument.type
count: 1
path: src/Plugins/Parallel/Paratest/WrapperRunner.php
-
message: '#^Parameter \#18 \$warnings of class PHPUnit\\TestRunner\\TestResult\\TestResult constructor expects list\<PHPUnit\\TestRunner\\TestResult\\Issues\\Issue\>, array given\.$#'
identifier: argument.type
count: 1
path: src/Plugins/Parallel/Paratest/WrapperRunner.php
-
message: '#^Parameter \#19 \$phpDeprecations of class PHPUnit\\TestRunner\\TestResult\\TestResult constructor expects list\<PHPUnit\\TestRunner\\TestResult\\Issues\\Issue\>, array given\.$#'
identifier: argument.type
count: 1
path: src/Plugins/Parallel/Paratest/WrapperRunner.php
-
message: '#^Parameter \#20 \$phpNotices of class PHPUnit\\TestRunner\\TestResult\\TestResult constructor expects list\<PHPUnit\\TestRunner\\TestResult\\Issues\\Issue\>, array given\.$#'
identifier: argument.type
count: 1
path: src/Plugins/Parallel/Paratest/WrapperRunner.php
-
message: '#^Parameter \#21 \$phpWarnings of class PHPUnit\\TestRunner\\TestResult\\TestResult constructor expects list\<PHPUnit\\TestRunner\\TestResult\\Issues\\Issue\>, array given\.$#'
identifier: argument.type
count: 1
path: src/Plugins/Parallel/Paratest/WrapperRunner.php
-
message: '#^Parameter \#4 \$testErroredEvents of class PHPUnit\\TestRunner\\TestResult\\TestResult constructor expects list\<PHPUnit\\Event\\Test\\AfterLastTestMethodErrored\|PHPUnit\\Event\\Test\\BeforeFirstTestMethodErrored\|PHPUnit\\Event\\Test\\Errored\>, array given\.$#'
identifier: argument.type
count: 1
path: src/Plugins/Parallel/Paratest/WrapperRunner.php
-
message: '#^Parameter \#5 \$testFailedEvents of class PHPUnit\\TestRunner\\TestResult\\TestResult constructor expects list\<PHPUnit\\Event\\Test\\Failed\>, array given\.$#'
identifier: argument.type
count: 1
path: src/Plugins/Parallel/Paratest/WrapperRunner.php
-
message: '#^Parameter \#7 \$testSuiteSkippedEvents of class PHPUnit\\TestRunner\\TestResult\\TestResult constructor expects list\<PHPUnit\\Event\\TestSuite\\Skipped\>, array given\.$#'
identifier: argument.type
count: 1
path: src/Plugins/Parallel/Paratest/WrapperRunner.php
-
message: '#^Parameter \#8 \$testSkippedEvents of class PHPUnit\\TestRunner\\TestResult\\TestResult constructor expects list\<PHPUnit\\Event\\Test\\Skipped\>, array given\.$#'
identifier: argument.type
count: 1
path: src/Plugins/Parallel/Paratest/WrapperRunner.php
-
message: '#^Parameter \#9 \$testMarkedIncompleteEvents of class PHPUnit\\TestRunner\\TestResult\\TestResult constructor expects list\<PHPUnit\\Event\\Test\\MarkedIncomplete\>, array given\.$#'
identifier: argument.type
count: 1
path: src/Plugins/Parallel/Paratest/WrapperRunner.php
-
message: '#^Property Pest\\Plugins\\Parallel\\Paratest\\WrapperRunner\:\:\$pending \(list\<non\-empty\-string\>\) does not accept array\<int, non\-empty\-string\>\.$#'
identifier: assign.propertyType
count: 1
path: src/Plugins/Parallel/Paratest/WrapperRunner.php
================================================
FILE: phpstan.neon
================================================
includes:
- phpstan-baseline.neon
parameters:
level: 7
paths:
- src
reportUnmatchedIgnoredErrors: false
ignoreErrors:
- "#type mixed is not subtype of native#"
================================================
FILE: phpunit.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.0/phpunit.xsd"
backupGlobals="false"
beStrictAboutTestsThatDoNotTestAnything="true"
beStrictAboutOutputDuringTests="true"
bootstrap="vendor/autoload.php"
colors="true"
failOnRisky="true"
failOnWarning="false"
processIsolation="false"
stopOnError="false"
stopOnFailure="false"
backupStaticProperties="false"
>
<testsuites>
<testsuite name="default">
<directory suffix=".php">./tests</directory>
<directory suffix=".php">./tests-external</directory>
<exclude>./tests/.snapshots</exclude>
<exclude>./tests/.tests</exclude>
<exclude>./tests/Fixtures/Inheritance</exclude>
</testsuite>
</testsuites>
<source>
<include>
<directory suffix=".php">./src</directory>
</include>
</source>
</phpunit>
================================================
FILE: rector.php
================================================
<?php
declare(strict_types=1);
use Rector\CodingStyle\Rector\ArrowFunction\ArrowFunctionDelegatingCallToFirstClassCallableRector;
use Rector\Config\RectorConfig;
use Rector\DeadCode\Rector\ClassMethod\RemoveParentDelegatingConstructorRector;
use Rector\TypeDeclaration\Rector\ClassMethod\NarrowObjectReturnTypeRector;
use Rector\TypeDeclaration\Rector\ClassMethod\ReturnNeverTypeRector;
return RectorConfig::configure()
->withPaths([
__DIR__.'/src',
])
->withSkip([
__DIR__.'/src/Plugins/Parallel/Paratest/WrapperRunner.php',
ReturnNeverTypeRector::class,
ArrowFunctionDelegatingCallToFirstClassCallableRector::class,
NarrowObjectReturnTypeRector::class,
RemoveParentDelegatingConstructorRector::class,
])
->withPreparedSets(
deadCode: true,
codeQuality: true,
typeDeclarations: true,
privatization: true,
earlyReturn: true,
)
->withPhpSets();
================================================
FILE: resources/base-phpunit.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true"
>
<testsuites>
<testsuite name="Default">
<directory>tests/</directory>
</testsuite>
</testsuites>
<source>
<include>
<directory>app</directory>
<directory>src</directory>
</include>
</source>
<php>
<env name="APP_ENV" value="testing"/>
<env name="APP_MAINTENANCE_DRIVER" value="file"/>
<env name="BCRYPT_ROUNDS" value="4"/>
<env name="CACHE_STORE" value="array"/>
<!-- <env name="DB_CONNECTION" value="sqlite"/> -->
<!-- <env name="DB_DATABASE" value=":memory:"/> -->
<env name="MAIL_MAILER" value="array"/>
<env name="PULSE_ENABLED" value="false"/>
<env name="QUEUE_CONNECTION" value="sync"/>
<env name="SESSION_DRIVER" value="array"/>
<env name="TELESCOPE_ENABLED" value="false"/>
</php>
</phpunit>
================================================
FILE: resources/views/components/badge.php
================================================
<?php
/** @var string $type */
/** @var string $content */
[$bgBadgeColor, $bgBadgeText] = match ($type) {
'INFO' => ['blue', 'INFO'],
'ERROR' => ['red', 'ERROR'],
};
?>
<div class="my-1">
<span class="ml-2 px-1 bg-<?php echo $bgBadgeColor ?> font-bold"><?php echo htmlspecialchars($bgBadgeText) ?></span>
<span class="ml-1">
<?php echo htmlspecialchars($content) ?>
</span>
</div>
================================================
FILE: resources/views/components/new-line.php
================================================
<div></div>
================================================
FILE: resources/views/components/two-column-detail.php
================================================
<div class="flex mx-2 max-w-150">
<span>
<?php echo htmlspecialchars($left) ?>
</span>
<span class="flex-1 content-repeat-[.] text-gray ml-1"></span>
<?php if ($right !== '') { ?>
<span class="ml-1 text-gray">
<?php echo htmlspecialchars($right) ?>
</span>
<?php } ?>
</div>
================================================
FILE: resources/views/installers/plugin-browser.php
================================================
<div class="mx-2 mb-1">
<p>
<span>Using the <span class="text-yellow font-bold">visit()</span> function requires the Pest Plugin Browser to be installed.</span>
<span class="ml-1 text-yellow font-bold">Run:</span>
</p>
<div>
<span class="text-gray mr-1">- </span>
<span>composer require pestphp/pest-plugin-browser:^4.0 --dev</span>
</div>
<div>
<span class="text-gray mr-1">- </span>
<span>npm install playwright@latest</span>
</div>
<div>
<span class="text-gray mr-1">- </span>
<span>npx playwright install</span>
</div>
</div>
================================================
FILE: resources/views/usage.php
================================================
<div class="mx-2">
<span class="text-yellow font-bold">USAGE:</span><span class="ml-1">pest</span><span class="ml-1 text-gray"><?php echo htmlspecialchars('<file>') ?> [options]</span>
</div>
================================================
FILE: resources/views/version.php
================================================
<div class="my-1 mx-2">
<span>Pest Testing Framework</span><span class="ml-1 text-blue font-bold"><?php echo htmlspecialchars($version) ?></span><span>.</span>
</div>
================================================
FILE: src/ArchPresets/AbstractPreset.php
================================================
<?php
declare(strict_types=1);
namespace Pest\ArchPresets;
use Pest\Arch\Contracts\ArchExpectation;
use Pest\Expectation;
/**
* @internal
*/
abstract class AbstractPreset // @pest-arch-ignore-line
{
/**
* The expectations.
*
* @var array<int, Expectation<mixed>|ArchExpectation>
*/
protected array $expectations = [];
/**
* Creates a new preset instance.
*
* @param array<int, string> $userNamespaces
*/
public function __construct(
private readonly array $userNamespaces,
) {
//
}
/**
* Executes the arch preset.
*
* @internal
*/
abstract public function execute(): void;
/**
* Ignores the given "targets" or "dependencies".
*
* @param array<int, string>|string $targetsOrDependencies
*/
final public function ignoring(array|string $targetsOrDependencies): void
{
$this->expectations = array_map(
fn (ArchExpectation|Expectation $expectation): Expectation|ArchExpectation => $expectation instanceof ArchExpectation ? $expectation->ignoring($targetsOrDependencies) : $expectation,
$this->expectations,
);
}
/**
* Runs the given callback for each namespace.
*
* @param callable(Expectation<string|null>): ArchExpectation ...$callbacks
*/
final public function eachUserNamespace(callable ...$callbacks): void
{
foreach ($this->userNamespaces as $namespace) {
foreach ($callbacks as $callback) {
$this->expectations[] = $callback(expect($namespace));
}
}
}
/**
* Flushes the expectations.
*/
final public function flush(): void
{
$this->expectations = [];
}
}
================================================
FILE: src/ArchPresets/Custom.php
================================================
<?php
declare(strict_types=1);
namespace Pest\ArchPresets;
use Closure;
use Pest\Arch\Contracts\ArchExpectation;
use Pest\Expectation;
/**
* @internal
*/
final class Custom extends AbstractPreset
{
/**
* Creates a new preset instance.
*
* @param array<int, string> $userNamespaces
* @param Closure(array<int, string>): array<Expectation<mixed>|ArchExpectation> $execute
*/
public function __construct(
private readonly array $userNamespaces,
private readonly string $name,
private readonly Closure $execute,
) {
parent::__construct($userNamespaces);
}
/**
* Returns the name of the preset.
*/
public function name(): string
{
return $this->name;
}
/**
* Executes the arch preset.
*/
public function execute(): void
{
$this->expectations = ($this->execute)($this->userNamespaces);
}
}
================================================
FILE: src/ArchPresets/Laravel.php
================================================
<?php
declare(strict_types=1);
namespace Pest\ArchPresets;
use Throwable;
/**
* @internal
*/
final class Laravel extends AbstractPreset
{
/**
* Executes the arch preset.
*/
public function execute(): void
{
$this->expectations[] = expect('App\Traits')
->toBeTraits();
$this->expectations[] = expect('App\Concerns')
->toBeTraits();
$this->expectations[] = expect('App')
->not->toBeEnums()
->ignoring('App\Enums');
$this->expectations[] = expect('App\Enums')
->toBeEnums()
->ignoring('App\Enums\Concerns');
$this->expectations[] = expect('App\Features')
->toBeClasses()
->ignoring('App\Features\Concerns');
$this->expectations[] = expect('App\Features')
->toHaveMethod('resolve')
->ignoring('App\Features\Concerns');
$this->expectations[] = expect('App\Exceptions')
->classes()
->toImplement('Throwable')
->ignoring('App\Exceptions\Handler');
$this->expectations[] = expect('App')
->not->toImplement(Throwable::class)
->ignoring('App\Exceptions');
$this->expectations[] = expect('App\Http\Middleware')
->classes()
->toHaveMethod('handle');
$this->expectations[] = expect('App\Models')
->classes()
->toExtend('Illuminate\Database\Eloquent\Model')
->ignoring('App\Models\Scopes');
$this->expectations[] = expect('App\Models')
->classes()
->not->toHaveSuffix('Model');
$this->expectations[] = expect('App')
->not->toExtend('Illuminate\Database\Eloquent\Model')
->ignoring('App\Models');
$this->expectations[] = expect('App\Http\Requests')
->classes()
->toHaveSuffix('Request');
$this->expectations[] = expect('App\Http\Requests')
->toExtend('Illuminate\Foundation\Http\FormRequest');
$this->expectations[] = expect('App\Http\Requests')
->toHaveMethod('rules');
$this->expectations[] = expect('App')
->not->toExtend('Illuminate\Foundation\Http\FormRequest')
->ignoring('App\Http\Requests');
$this->expectations[] = expect('App\Console\Commands')
->classes()
->toHaveSuffix('Command');
$this->expectations[] = expect('App\Console\Commands')
->classes()
->toExtend('Illuminate\Console\Command');
$this->expectations[] = expect('App\Console\Commands')
->classes()
->toHaveMethod('handle');
$this->expectations[] = expect('App')
->not->toExtend('Illuminate\Console\Command')
->ignoring('App\Console\Commands');
$this->expectations[] = expect('App\Mail')
->classes()
->toExtend('Illuminate\Mail\Mailable');
$this->expectations[] = expect('App\Mail')
->classes()
->toImplement('Illuminate\Contracts\Queue\ShouldQueue');
$this->expectations[] = expect('App')
->not->toExtend('Illuminate\Mail\Mailable')
->ignoring('App\Mail');
$this->expectations[] = expect('App\Jobs')
->classes()
->toImplement('Illuminate\Contracts\Queue\ShouldQueue');
$this->expectations[] = expect('App\Jobs')
->classes()
->toHaveMethod('handle');
$this->expectations[] = expect('App\Listeners')
->toHaveMethod('handle');
$this->expectations[] = expect('App\Notifications')
->toExtend('Illuminate\Notifications\Notification');
$this->expectations[] = expect('App')
->not->toExtend('Illuminate\Notifications\Notification')
->ignoring('App\Notifications');
$this->expectations[] = expect('App\Providers')
->toHaveSuffix('ServiceProvider');
$this->expectations[] = expect('App\Providers')
->toExtend('Illuminate\Support\ServiceProvider');
$this->expectations[] = expect('App\Providers')
->not->toBeUsed();
$this->expectations[] = expect('App')
->not->toExtend('Illuminate\Support\ServiceProvider')
->ignoring('App\Providers');
$this->expectations[] = expect('App')
->not->toHaveSuffix('ServiceProvider')
->ignoring('App\Providers');
$this->expectations[] = expect('App')
->not->toHaveSuffix('Controller')
->ignoring('App\Http\Controllers');
$this->expectations[] = expect('App\Http\Controllers')
->classes()
->toHaveSuffix('Controller');
$this->expectations[] = expect('App\Http')
->toOnlyBeUsedIn(['App\Http', 'App\Providers']);
$this->expectations[] = expect('App\Http\Controllers')
->not->toHavePublicMethodsBesides(['__construct', '__invoke', 'index', 'show', 'create', 'store', 'edit', 'update', 'destroy', 'middleware']);
$this->expectations[] = expect([
'dd',
'ddd',
'dump',
'env',
'exit',
'ray',
])->not->toBeUsed();
$this->expectations[] = expect('App\Policies')
->classes()
->toHaveSuffix('Policy');
$this->expectations[] = expect('App\Attributes')
->classes()
->toImplement('Illuminate\Contracts\Container\ContextualAttribute')
->toHaveAttribute('Attribute')
->toHaveMethod('resolve');
}
}
================================================
FILE: src/ArchPresets/Php.php
================================================
<?php
declare(strict_types=1);
namespace Pest\ArchPresets;
/**
* @internal
*/
final class Php extends AbstractPreset
{
/**
* Executes the arch preset.
*/
public function execute(): void
{
$this->expectations[] = expect([
'debug_zval_dump',
'debug_backtrace',
'debug_print_backtrace',
'dump',
'ray',
'ds',
'die',
'goto',
'global',
'var_dump',
'phpinfo',
'echo',
'ereg',
'eregi',
'mysql_connect',
'mysql_pconnect',
'mysql_query',
'mysql_select_db',
'mysql_fetch_array',
'mysql_fetch_assoc',
'mysql_fetch_object',
'mysql_fetch_row',
'mysql_num_rows',
'mysql_affected_rows',
'mysql_free_result',
'mysql_insert_id',
'mysql_error',
'mysql_real_escape_string',
'print',
'print_r',
'var_export',
'xdebug_break',
'xdebug_call_class',
'xdebug_call_file',
'xdebug_call_int',
'xdebug_call_line',
'xdebug_code_coverage_started',
'xdebug_connect_to_client',
'xdebug_debug_zval',
'xdebug_debug_zval_stdout',
'xdebug_dump_superglobals',
'xdebug_get_code_coverage',
'xdebug_get_collected_errors',
'xdebug_get_function_count',
'xdebug_get_function_stack',
'xdebug_get_gc_run_count',
'xdebug_get_gc_total_collected_roots',
'xdebug_get_gcstats_filename',
'xdebug_get_headers',
'xdebug_get_monitored_functions',
'xdebug_get_profiler_filename',
'xdebug_get_stack_depth',
'xdebug_get_tracefile_name',
'xdebug_info',
'xdebug_is_debugger_active',
'xdebug_memory_usage',
'xdebug_notify',
'xdebug_peak_memory_usage',
'xdebug_print_function_stack',
'xdebug_set_filter',
'xdebug_start_code_coverage',
'xdebug_start_error_collection',
'xdebug_start_function_monitor',
'xdebug_start_gcstats',
'xdebug_start_trace',
'xdebug_stop_code_coverage',
'xdebug_stop_error_collection',
'xdebug_stop_function_monitor',
'xdebug_stop_gcstats',
'xdebug_stop_trace',
'xdebug_time_index',
'xdebug_var_dump',
'trap',
])->not->toBeUsed();
}
}
================================================
FILE: src/ArchPresets/Relaxed.php
================================================
<?php
declare(strict_types=1);
namespace Pest\ArchPresets;
use Pest\Arch\Contracts\ArchExpectation;
use Pest\Expectation;
/**
* @internal
*/
final class Relaxed extends AbstractPreset
{
/**
* Executes the arch preset.
*/
public function execute(): void
{
$this->eachUserNamespace(
fn (Expectation $namespace): ArchExpectation => $namespace->not->toUseStrictTypes(),
fn (Expectation $namespace): ArchExpectation => $namespace->classes()->not->toBeFinal(),
fn (Expectation $namespace): ArchExpectation => $namespace->classes()->not->toHavePrivateMethods(),
);
}
}
================================================
FILE: src/ArchPresets/Security.php
================================================
<?php
declare(strict_types=1);
namespace Pest\ArchPresets;
/**
* @internal
*/
final class Security extends AbstractPreset
{
/**
* Executes the arch preset.
*/
public function execute(): void
{
$this->expectations[] = expect([
'md5',
'sha1',
'uniqid',
'rand',
'mt_rand',
'tempnam',
'str_shuffle',
'shuffle',
'array_rand',
'eval',
'exec',
'shell_exec',
'system',
'passthru',
'create_function',
'unserialize',
'extract',
'mb_parse_str',
'dl',
'assert',
])->not->toBeUsed();
}
}
================================================
FILE: src/ArchPresets/Strict.php
================================================
<?php
declare(strict_types=1);
namespace Pest\ArchPresets;
use Pest\Arch\Contracts\ArchExpectation;
use Pest\Expectation;
/**
* @internal
*/
final class Strict extends AbstractPreset
{
/**
* Executes the arch preset.
*/
public function execute(): void
{
$this->eachUserNamespace(
fn (Expectation $namespace): ArchExpectation => $namespace->classes()->not->toHaveProtectedMethods(),
fn (Expectation $namespace): ArchExpectation => $namespace->classes()->not->toBeAbstract(),
fn (Expectation $namespace): ArchExpectation => $namespace->toUseStrictTypes(),
fn (Expectation $namespace): ArchExpectation => $namespace->toUseStrictEquality(),
fn (Expectation $namespace): ArchExpectation => $namespace->classes()->toBeFinal(),
);
$this->expectations[] = expect([
'sleep',
'usleep',
])->not->toBeUsed();
}
}
================================================
FILE: src/Bootstrappers/BootExcludeList.php
================================================
<?php
declare(strict_types=1);
namespace Pest\Bootstrappers;
use Pest\Contracts\Bootstrapper;
use PHPUnit\Util\ExcludeList;
/**
* @internal
*/
final class BootExcludeList implements Bootstrapper
{
/**
* The directories to exclude.
*
* @var array<int, non-empty-string>
*/
private const array EXCLUDE_LIST = [
'bin',
'overrides',
'resources',
'src',
'stubs',
];
/**
* Boots the "exclude list" for PHPUnit to ignore Pest files.
*/
public function boot(): void
{
$baseDirectory = dirname(__DIR__, 2);
foreach (self::EXCLUDE_LIST as $directory) {
ExcludeList::addDirectory($baseDirectory.DIRECTORY_SEPARATOR.$directory);
}
}
}
================================================
FILE: src/Bootstrappers/BootFiles.php
================================================
<?php
declare(strict_types=1);
namespace Pest\Bootstrappers;
use Pest\Contracts\Bootstrapper;
use Pest\Exceptions\FatalException;
use Pest\Support\DatasetInfo;
use Pest\Support\Str;
use Pest\TestSuite;
use RecursiveDirectoryIterator;
use RecursiveIteratorIterator;
use SebastianBergmann\FileIterator\Facade as PhpUnitFileIterator;
use function Pest\testDirectory;
/**
* @internal
*/
final class BootFiles implements Bootstrapper
{
/**
* The structure of the tests directory.
*
* @var array<int, string>
*/
private const array STRUCTURE = [
'Expectations',
'Expectations.php',
'Helpers',
'Helpers.php',
'Pest.php',
];
/**
* Boots the structure of the tests directory.
*/
public function boot(): void
{
$rootPath = TestSuite::getInstance()->rootPath;
$testsPath = $rootPath.DIRECTORY_SEPARATOR.testDirectory();
if (! is_dir($testsPath)) {
throw new FatalException(sprintf('The test directory [%s] does not exist.', $testsPath));
}
foreach (self::STRUCTURE as $filename) {
$filename = sprintf('%s%s%s', $testsPath, DIRECTORY_SEPARATOR, $filename);
if (! file_exists($filename)) {
continue;
}
if (is_dir($filename)) {
$directory = new RecursiveDirectoryIterator($filename);
$iterator = new RecursiveIteratorIterator($directory);
/** @var \DirectoryIterator $file */
foreach ($iterator as $file) {
$this->load($file->__toString());
}
} else {
$this->load($filename);
}
}
$this->bootDatasets($testsPath);
}
/**
* Loads, if possible, the given file.
*/
private function load(string $filename): void
{
if (! Str::endsWith($filename, '.php')) {
return;
}
if (! file_exists($filename)) {
return;
}
include_once $filename;
}
private function bootDatasets(string $testsPath): void
{
assert($testsPath !== '');
$files = (new PhpUnitFileIterator)->getFilesAsArray($testsPath, '.php');
foreach ($files as $file) {
if (DatasetInfo::isADatasetsFile($file) || DatasetInfo::isInsideADatasetsDirectory($file)) {
$this->load($file);
}
}
}
}
================================================
FILE: src/Bootstrappers/BootKernelDump.php
================================================
<?php
declare(strict_types=1);
namespace Pest\Bootstrappers;
use Pest\Contracts\Bootstrapper;
use Pest\KernelDump;
use Pest\Support\Container;
use Symfony\Component\Console\Output\OutputInterface;
/**
* @internal
*/
final readonly class BootKernelDump implements Bootstrapper
{
/**
* Creates a new Boot Kernel Dump instance.
*/
public function __construct(
private OutputInterface $output,
) {
// ...
}
/**
* Boots the kernel dump.
*/
public function boot(): void
{
Container::getInstance()->add(KernelDump::class, $kernelDump = new KernelDump(
$this->output,
));
$kernelDump->enable();
}
}
================================================
FILE: src/Bootstrappers/BootOverrides.php
================================================
<?php
declare(strict_types=1);
namespace Pest\Bootstrappers;
use Pest\Contracts\Bootstrapper;
use Pest\Exceptions\ShouldNotHappen;
/**
* @internal
*/
final class BootOverrides implements Bootstrapper
{
/**
* The list of files to be overridden.
*
* @var array<int, string>
*/
public const array FILES = [
'Runner/Filter/NameFilterIterator.php',
'Runner/ResultCache/DefaultResultCache.php',
'Runner/TestSuiteLoader.php',
'TextUI/Command/Commands/WarmCodeCoverageCacheCommand.php',
'TextUI/Output/Default/ProgressPrinter/Subscriber/TestSkippedSubscriber.php',
'TextUI/TestSuiteFilterProcessor.php',
'Event/Value/ThrowableBuilder.php',
'Logging/JUnit/JunitXmlLogger.php',
];
/**
* Boots the list of files to be overridden.
*/
public function boot(): void
{
foreach (self::FILES as $file) {
$file = __DIR__."/../../overrides/$file";
if (! file_exists($file)) {
throw ShouldNotHappen::fromMessage(sprintf('File [%s] does not exist.', $file));
}
require_once $file;
}
}
}
================================================
FILE: src/Bootstrappers/BootSubscribers.php
================================================
<?php
declare(strict_types=1);
namespace Pest\Bootstrappers;
use Pest\Contracts\Bootstrapper;
use Pest\Subscribers;
use Pest\Support\Container;
use PHPUnit\Event;
use PHPUnit\Event\Subscriber;
/**
* @internal
*/
final readonly class BootSubscribers implements Bootstrapper
{
/**
* The list of Subscribers.
*
* @var array<int, class-string<Subscriber>>
*/
private const array SUBSCRIBERS = [
Subscribers\EnsureConfigurationIsAvailable::class,
Subscribers\EnsureIgnorableTestCasesAreIgnored::class,
Subscribers\EnsureKernelDumpIsFlushed::class,
Subscribers\EnsureTeamCityEnabled::class,
];
/**
* Creates a new instance of the Boot Subscribers.
*/
public function __construct(
private Container $container,
) {}
/**
* Boots the list of Subscribers.
*/
public function boot(): void
{
foreach (self::SUBSCRIBERS as $subscriber) {
$instance = $this->container->get($subscriber);
assert($instance instanceof Subscriber);
Event\Facade::instance()->registerSubscriber($instance);
}
}
}
================================================
FILE: src/Bootstrappers/BootView.php
================================================
<?php
declare(strict_types=1);
namespace Pest\Bootstrappers;
use Pest\Contracts\Bootstrapper;
use Pest\Support\View;
use Symfony\Component\Console\Output\OutputInterface;
/**
* @internal
*/
final readonly class BootView implements Bootstrapper
{
/**
* Creates a new instance of the Boot View.
*/
public function __construct(
private OutputInterface $output
) {
// ..
}
/**
* Boots the view renderer.
*/
public function boot(): void
{
View::renderUsing($this->output);
}
}
================================================
FILE: src/Collision/Events.php
================================================
<?php
declare(strict_types=1);
namespace Pest\Collision;
use NunoMaduro\Collision\Adapters\Phpunit\TestResult;
use Pest\Configuration\Project;
use Symfony\Component\Console\Output\OutputInterface;
use function Termwind\render;
use function Termwind\renderUsing;
/**
* @internal
*/
final class Events
{
/**
* Sets the output.
*/
private static ?OutputInterface $output = null;
/**
* Sets the output.
*/
public static function setOutput(OutputInterface $output): void
{
self::$output = $output;
}
/**
* Fires before the test method description is printed.
*/
public static function beforeTestMethodDescription(TestResult $result, string $description): string
{
if (($context = $result->context) === []) {
return $description;
}
renderUsing(self::$output);
[
'assignees' => $assignees,
'issues' => $issues,
'prs' => $prs,
] = $context;
if (($link = Project::getInstance()->issues) !== '') {
$issuesDescription = array_map(fn (int $issue): string => sprintf('<a href="%s">#%s</a>', sprintf($link, $issue), $issue), $issues);
}
if (($link = Project::getInstance()->prs) !== '') {
$prsDescription = array_map(fn (int $pr): string => sprintf('<a href="%s">#%s</a>', sprintf($link, $pr), $pr), $prs);
}
if (($link = Project::getInstance()->assignees) !== '' && count($assignees) > 0) {
$assigneesDescription = array_map(fn (string $assignee): string => sprintf(
'<a href="%s">@%s</a>',
sprintf($link, $assignee),
$assignee,
), $assignees);
}
if (count($assignees) > 0 || count($issues) > 0 || count($prs) > 0) {
$description .= ' '.implode(', ', array_merge(
$issuesDescription ?? [],
$prsDescription ?? [],
isset($assigneesDescription) ? ['['.implode(', ', $assigneesDescription).']'] : [],
));
}
return $description;
}
/**
* Fires after the test method description is printed.
*/
public static function afterTestMethodDescription(TestResult $result): void
{
if (($context = $result->context) === []) {
return;
}
renderUsing(self::$output);
[
'notes' => $notes,
] = $context;
foreach ($notes as $note) {
render(sprintf(<<<'HTML'
<div class="ml-2">
<span class="text-gray"> // %s</span>
</div>
HTML, $note,
));
}
}
}
================================================
FILE: src/Concerns/Expectable.php
================================================
<?php
declare(strict_types=1);
namespace Pest\Concerns;
use Pest\Expectation;
/**
* @internal
*/
trait Expectable
{
/**
* @template TValue
*
* Creates a new Expectation.
*
* @param TValue $value
* @return Expectation<TValue>
*/
public function expect(mixed $value): Expectation
{
return new Expectation($value);
}
}
================================================
FILE: src/Concerns/Extendable.php
================================================
<?php
declare(strict_types=1);
namespace Pest\Concerns;
use Closure;
/**
* @internal
*
* @template T of object
*/
trait Extendable
{
/**
* The list of extends.
*
* @var array<string, Closure>
*/
private static array $extends = [];
/**
* Register a new extend.
*
* @param-closure-this T $extend
*/
public function extend(string $name, Closure $extend): void
{
static::$extends[$name] = $extend;
}
/**
* Checks if given extend name is registered.
*/
public static function hasExtend(string $name): bool
{
return array_key_exists($name, static::$extends);
}
}
================================================
FILE: src/Concerns/Logging/WritesToConsole.php
================================================
<?php
declare(strict_types=1);
namespace Pest\Concerns\Logging;
/**
* @internal
*/
trait WritesToConsole
{
/**
* Writes the given success message to the console.
*/
private function writeSuccess(string $message): void
{
$this->writePestTestOutput($message, 'fg-green, bold', '✓');
}
/**
* Writes the given error message to the console.
*/
private function writeError(string $message): void
{
$this->writePestTestOutput($message, 'fg-red, bold', '⨯');
}
/**
* Writes the given warning message to the console.
*/
private function writeWarning(string $message): void
{
$this->writePestTestOutput($message, 'fg-yellow, bold', '-');
}
/**
* Writes the give message to the console.
*/
private function writePestTestOutput(string $message, string $color, string $symbol): void
{
$this->writeWithColor($color, "$symbol ", false);
$this->write($message);
$this->writeNewLine();
}
}
================================================
FILE: src/Concerns/Pipeable.php
================================================
<?php
declare(strict_types=1);
namespace Pest\Concerns;
use Closure;
/**
* @internal
*/
trait Pipeable
{
/**
* The list of pipes.
*
* @var array<string, array<Closure(Closure, mixed ...$arguments): void>>
*/
private static array $pipes = [];
/**
* The list of interceptors.
*
* @var array<string, array<Closure(Closure, mixed ...$arguments): void>>
*/
private static array $interceptors = [];
/**
* Register a pipe to be applied before an expectation is checked.
*/
public function pipe(string $name, Closure $pipe): void
{
self::$pipes[$name][] = $pipe;
}
/**
* Register an interceptor that should replace an existing expectation.
*
* @param string|Closure(mixed $value, mixed ...$arguments):bool $filter
*/
public function intercept(string $name, string|Closure $filter, Closure $handler): void
{
if (is_string($filter)) {
$filter = fn ($value): bool => $value instanceof $filter;
}
self::$interceptors[$name][] = $handler;
$this->pipe($name, function ($next, ...$arguments) use ($handler, $filter): void {
/* @phpstan-ignore-next-line */
if ($filter($this->value, ...$arguments)) {
// @phpstan-ignore-next-line
$handler->bindTo($this, $this::class)(...$arguments);
return;
}
$next();
});
}
/**
* Get the list of pipes by the given name.
*
* @return array<int, Closure>
*/
private function pipes(string $name, object $context, string $scope): array
{
return array_map(fn (Closure $pipe): Closure => $pipe->bindTo($context, $scope), self::$pipes[$name] ?? []);
}
}
================================================
FILE: src/Concerns/Retrievable.php
================================================
<?php
declare(strict_types=1);
namespace Pest\Concerns;
/**
* @internal
*/
trait Retrievable
{
/**
* @template TRetrievableValue
*
* Safely retrieve the value at the given key from an object or array.
* @template TRetrievableValue
*
* @param array<string, TRetrievableValue>|object $value
* @param TRetrievableValue|null $default
* @return TRetrievableValue|null
*/
private function retrieve(string $key, mixed $value, mixed $default = null): mixed
{
if (is_array($value)) {
return $value[$key] ?? $default;
}
// @phpstan-ignore-next-line
return $value->$key ?? $default;
}
}
================================================
FILE: src/Concerns/Testable.php
================================================
<?php
declare(strict_types=1);
namespace Pest\Concerns;
use Closure;
use Pest\Exceptions\DatasetArgumentsMismatch;
use Pest\Panic;
use Pest\Preset;
use Pest\Support\ChainableClosure;
use Pest\Support\ExceptionTrace;
use Pest\Support\Reflection;
use Pest\Support\Shell;
use Pest\TestSuite;
use PHPUnit\Framework\Attributes\PostCondition;
use PHPUnit\Framework\TestCase;
use ReflectionException;
use ReflectionFunction;
use ReflectionParameter;
use Throwable;
/**
* @internal
*
* @mixin TestCase
*/
trait Testable
{
/**
* The test's description.
*/
private string $__description;
/**
* The test's latest description.
*/
private static string $__latestDescription;
/**
* The test's assignees.
*/
private static array $__latestAssignees = [];
/**
* The test's notes.
*/
private static array $__latestNotes = [];
/**
* The test's issues.
*
* @var array<int, int>
*/
private static array $__latestIssues = [];
/**
* The test's PRs.
*
* @var array<int, int>
*/
private static array $__latestPrs = [];
/**
* The test's describing, if any.
*
* @var array<int, string>
*/
public array $__describing = [];
/**
* Whether the test has ran or not.
*/
public bool $__ran = false;
/**
* The test's test closure.
*/
private Closure $__test;
/**
* The test's before each closure.
*/
private ?Closure $__beforeEach = null;
/**
* The test's after each closure.
*/
private ?Closure $__afterEach = null;
/**
* The test's before all closure.
*/
private static ?Closure $__beforeAll = null;
/**
* The test's after all closure.
*/
private static ?Closure $__afterAll = null;
/**
* The list of snapshot changes, if any.
*/
private array $__snapshotChanges = [];
/**
* Resets the test case static properties.
*/
public static function flush(): void
{
self::$__beforeAll = null;
self::$__afterAll = null;
}
/**
* Adds a new "note" to the Test Case.
*/
public function note(array|string $note): self
{
$note = is_array($note) ? $note : [$note];
self::$__latestNotes = array_merge(self::$__latestNotes, $note);
return $this;
}
/**
* Adds a new "setUpBeforeClass" to the Test Case.
*/
public function __addBeforeAll(?Closure $hook): void
{
if (! $hook instanceof Closure) {
return;
}
self::$__beforeAll = (self::$__beforeAll instanceof Closure)
? ChainableClosure::boundStatically(self::$__beforeAll, $hook)
: $hook;
}
/**
* Adds a new "tearDownAfterClass" to the Test Case.
*/
public function __addAfterAll(?Closure $hook): void
{
if (! $hook instanceof Closure) {
return;
}
self::$__afterAll = (self::$__afterAll instanceof Closure)
? ChainableClosure::boundStatically(self::$__afterAll, $hook)
: $hook;
}
/**
* Adds a new "setUp" to the Test Case.
*/
public function __addBeforeEach(?Closure $hook): void
{
$this->__addHook('__beforeEach', $hook);
}
/**
* Adds a new "tearDown" to the Test Case.
*/
public function __addAfterEach(?Closure $hook): void
{
$this->__addHook('__afterEach', $hook);
}
/**
* Adds a new "hook" to the Test Case.
*/
private function __addHook(string $property, ?Closure $hook): void
{
if (! $hook instanceof Closure) {
return;
}
$this->{$property} = ($this->{$property} instanceof Closure)
? ChainableClosure::bound($this->{$property}, $hook)
: $hook;
}
/**
* This method is called before the first test of this Test Case is run.
*/
public static function setUpBeforeClass(): void
{
parent::setUpBeforeClass();
$beforeAll = TestSuite::getInstance()->beforeAll->get(self::$__filename);
if (self::$__beforeAll instanceof Closure) {
$beforeAll = ChainableClosure::boundStatically(self::$__beforeAll, $beforeAll);
}
try {
call_user_func(Closure::bind($beforeAll, null, self::class));
} catch (Throwable $e) {
Panic::with($e);
}
}
/**
* This method is called after the last test of this Test Case is run.
*/
public static function tearDownAfterClass(): void
{
$afterAll = TestSuite::getInstance()->afterAll->get(self::$__filename);
if (self::$__afterAll instanceof Closure) {
$afterAll = ChainableClosure::boundStatically(self::$__afterAll, $afterAll);
}
call_user_func(Closure::bind($afterAll, null, self::class));
parent::tearDownAfterClass();
}
/**
* Gets executed before the Test Case.
*/
protected function setUp(...$arguments): void
{
TestSuite::getInstance()->test = $this;
$method = TestSuite::getInstance()->tests->get(self::$__filename)->getMethod($this->name());
$description = $method->description;
if ($this->dataName()) {
$description = str_contains((string) $description, ':dataset')
? str_replace(':dataset', str_replace('dataset ', '', $this->dataName()), (string) $description)
: $description.' with '.$this->dataName();
}
$description = htmlspecialchars(html_entity_decode((string) $description), ENT_NOQUOTES);
if ($method->repetitions > 1) {
$matches = [];
preg_match('/\((.*?)\)/', $description, $matches);
if (count($matches) > 1) {
if (str_contains($description, 'with '.$matches[0].' /')) {
$description = str_replace('with '.$matches[0].' /', '', $description);
} else {
$description = str_replace('with '.$matches[0], '', $description);
}
}
$description .= ' @ repetition '.($matches[1].' of '.$method->repetitions);
}
$this->__description = self::$__latestDescription = $description;
self::$__latestAssignees = $method->assignees;
self::$__latestNotes = $method->notes;
self::$__latestIssues = $method->issues;
self::$__latestPrs = $method->prs;
parent::setUp();
$beforeEach = TestSuite::getInstance()->beforeEach->get(self::$__filename)[1];
if ($this->__beforeEach instanceof Closure) {
$beforeEach = ChainableClosure::bound($this->__beforeEach, $beforeEach);
}
$this->__callClosure($beforeEach, $arguments);
}
/**
* Initialize test case properties from TestSuite.
*/
public function __initializeTestCase(): void
{
// Return if the test case has already been initialized
if (isset($this->__test)) {
return;
}
$name = $this->name();
$test = TestSuite::getInstance()->tests->get(self::$__filename);
if ($test->hasMethod($name)) {
$method = $test->getMethod($name);
$this->__description = self::$__latestDescription = $method->description;
self::$__latestAssignees = $method->assignees;
self::$__latestNotes = $method->notes;
self::$__latestIssues = $method->issues;
self::$__latestPrs = $method->prs;
$this->__describing = $method->describing;
$this->__test = $method->getClosure();
$method->setUp($this);
}
}
/**
* Gets executed after the Test Case.
*/
protected function tearDown(...$arguments): void
{
$afterEach = TestSuite::getInstance()->afterEach->get(self::$__filename);
if ($this->__afterEach instanceof Closure) {
$afterEach = ChainableClosure::bound($this->__afterEach, $afterEach);
}
try {
$this->__callClosure($afterEach, func_get_args());
} finally {
parent::tearDown();
TestSuite::getInstance()->test = null;
$method = TestSuite::getInstance()->tests->get(self::$__filename)->getMethod($this->name());
$method->tearDown($this);
}
}
/**
* Executes the Test Case current test.
*
* @throws Throwable
*/
private function __runTest(Closure $closure, ...$args): mixed
{
$arguments = $this->__resolveTestArguments($args);
$this->__ensureDatasetArgumentNameAndNumberMatches($arguments);
return $this->__callClosure($closure, $arguments);
}
/**
* Resolve the passed arguments. Any Closures will be bound to the testcase and resolved.
*
* @throws Throwable
*/
private function __resolveTestArguments(array $arguments): array
{
$method = TestSuite::getInstance()->tests->get(self::$__filename)->getMethod($this->name());
if ($method->repetitions > 1) {
// If the test is repeated, the first argument is the iteration number
// we need to move it to the end of the arguments list
// so that the datasets are the first n arguments
// and the iteration number is the last argument
$firstArgument = array_shift($arguments);
$arguments[] = $firstArgument;
}
$underlyingTest = Reflection::getFunctionVariable($this->__test, 'closure');
$testParameterTypes = array_values(Reflection::getFunctionArguments($underlyingTest));
if (count($arguments) !== 1) {
foreach ($arguments as $argumentIndex => $argumentValue) {
if (! $argumentValue instanceof Closure) {
continue;
}
if (in_array($testParameterTypes[$argumentIndex], [Closure::class, 'callable', 'mixed'])) {
continue;
}
$arguments[$argumentIndex] = $this->__callClosure($argumentValue, []);
}
return $arguments;
}
if (! isset($arguments[0]) || ! $arguments[0] instanceof Closure) {
return $arguments;
}
if (isset($testParameterTypes[0]) && in_array($testParameterTypes[0], [Closure::class, 'callable'])) {
return $arguments;
}
$boundDatasetResult = $this->__callClosure($arguments[0], []);
if (count($testParameterTypes) === 1) {
return [$boundDatasetResult];
}
if (! is_array($boundDatasetResult)) {
return [$boundDatasetResult];
}
return array_values($boundDatasetResult);
}
/**
* Ensures dataset items count matches underlying test case required parameters
*
* @throws ReflectionException
* @throws DatasetArgumentsMismatch
*/
private function __ensureDatasetArgumentNameAndNumberMatches(array $arguments): void
{
if ($arguments === []) {
return;
}
$underlyingTest = Reflection::getFunctionVariable($this->__test, 'closure');
$testReflection = new ReflectionFunction($underlyingTest);
$requiredParametersCount = $testReflection->getNumberOfRequiredParameters();
$suppliedParametersCount = count($arguments);
$datasetParameterNames = array_keys($arguments);
$testParameterNames = array_map(
fn (ReflectionParameter $reflectionParameter): string => $reflectionParameter->getName(),
array_filter($testReflection->getParameters(), fn (ReflectionParameter $reflectionParameter): bool => ! $reflectionParameter->isOptional()),
);
if (array_diff($testParameterNames, $datasetParameterNames) === []) {
return;
}
if (isset($testParameterNames[0]) && $suppliedParametersCount >= $requiredParametersCount) {
return;
}
throw new DatasetArgumentsMismatch($requiredParametersCount, $suppliedParametersCount);
}
/**
* @throws Throwable
*/
private function __callClosure(Closure $closure, array $arguments): mixed
{
return ExceptionTrace::ensure(fn (): mixed => call_user_func_array(Closure::bind($closure, $this, $this::class), $arguments));
}
/**
* Uses the given preset on the test.
*/
public function preset(): Preset
{
return new Preset;
}
#[PostCondition]
protected function __MarkTestIncompleteIfSnapshotHaveChanged(): void
{
if (count($this->__snapshotChanges) === 0) {
return;
}
$this->markTestIncomplete(implode('. ', $this->__snapshotChanges));
}
/**
* The printable test case name.
*/
public static function getPrintableTestCaseName(): string
{
return preg_replace('/P\\\/', '', self::class, 1);
}
/**
* The printable test case method name.
*/
public function getPrintableTestCaseMethodName(): string
{
return $this->__description;
}
/**
* The latest printable test case method name.
*/
public static function getLatestPrintableTestCaseMethodName(): string
{
return self::$__latestDescription ?? '';
}
/**
* The printable test case method context.
*/
public static function getPrintableContext(): array
{
return [
'assignees' => self::$__latestAssignees,
'issues' => self::$__latestIssues,
'prs' => self::$__latestPrs,
'notes' => self::$__latestNotes,
];
}
/**
* Opens a shell for the test case.
*/
public function shell(): void
{
Shell::open();
}
}
================================================
FILE: src/Configuration/Presets.php
================================================
<?php
declare(strict_types=1);
namespace Pest\Configuration;
use Closure;
use Pest\Preset;
final class Presets
{
/**
* Creates a custom preset instance, and adds it to the list of presets.
*/
public function custom(string $name, Closure $execute): void
{
Preset::custom($name, $execute);
}
}
================================================
FILE: src/Configuration/Printer.php
================================================
<?php
declare(strict_types=1);
namespace Pest\Configuration;
use NunoMaduro\Collision\Adapters\Phpunit\Printers\DefaultPrinter;
/**
* @internal
*/
final readonly class Printer
{
/**
* Sets the theme to compact.
*/
public function compact(): self
{
DefaultPrinter::compact(true);
return $this;
}
}
================================================
FILE: src/Configuration/Project.php
================================================
<?php
declare(strict_types=1);
namespace Pest\Configuration;
/**
* @internal
*/
final class Project
{
/**
* The assignees link.
*
* @internal
*/
public string $assignees = '';
/**
* The issues link.
*
* @internal
*/
public string $issues = '';
/**
* The PRs link.
*
* @internal
*/
public string $prs = '';
/**
* The singleton instance.
*/
private static ?self $instance = null;
/**
* Creates a new instance of the project.
*/
public static function getInstance(): self
{
return self::$instance ??= new self;
}
/**
* Sets the test project to GitHub.
*/
public function github(string $project): self
{
$this->issues = "https://github.com/{$project}/issues/%s";
$this->prs = "https://github.com/{$project}/pull/%s";
$this->assignees = 'https://github.com/%s';
return $this;
}
/**
* Sets the test project to GitLab.
*/
public function gitlab(string $project): self
{
$this->issues = "https://gitlab.com/{$project}/issues/%s";
$this->prs = "https://gitlab.com/{$project}/merge_requests/%s";
$this->assignees = 'https://gitlab.com/%s';
return $this;
}
/**
* Sets the test project to Bitbucket.
*/
public function bitbucket(string $project): self
{
$this->issues = "https://bitbucket.org/{$project}/issues/%s";
$this->prs = "https://bitbucket.org/{$project}/pull-requests/%s";
$this->assignees = 'https://bitbucket.org/%s';
return $this;
}
/**
* Sets the test project to Jira.
*/
public function jira(string $namespace, string $project): self
{
$this->issues = "https://{$namespace}.atlassian.net/browse/{$project}-%s";
$this->assignees = "https://{$namespace}.atlassian.net/secure/ViewProfile.jspa?name=%s";
return $this;
}
/**
* Sets the test project to custom.
*/
public function custom(string $issues, string $prs, string $assignees): self
{
$this->issues = $issues;
$this->prs = $prs;
$this->assignees = $assignees;
return $this;
}
}
================================================
FILE: src/Configuration.php
================================================
<?php
declare(strict_types=1);
namespace Pest;
use Pest\PendingCalls\BeforeEachCall;
use Pest\PendingCalls\UsesCall;
/**
* @internal
*
* @mixin UsesCall
*/
final readonly class Configuration
{
/**
* The filename of the configuration.
*/
private string $filename;
/**
* Creates a new configuration instance.
*/
public function __construct(
string $filename,
) {
$this->filename = str_ends_with($filename, DIRECTORY_SEPARATOR.'Pest.php') ? dirname($filename) : $filename;
}
/**
* Use the given classes and traits in the given targets.
*/
public function in(string ...$targets): UsesCall
{
return (new UsesCall($this->filename, []))->in(...$targets);
}
/**
* Depending on where is called, it will extend the given classes and traits globally or locally.
*/
public function extend(string ...$classAndTraits): UsesCall
{
return new UsesCall(
$this->filename,
array_values($classAndTraits)
);
}
/**
* Depending on where is called, it will extend the given classes and traits globally or locally.
*/
public function extends(string ...$classAndTraits): UsesCall
{
return $this->extend(...$classAndTraits);
}
/**
* Depending on where is called, it will add the given groups globally or locally.
*/
public function group(string ...$groups): UsesCall
{
return (new UsesCall($this->filename, []))->group(...$groups);
}
/**
* Marks all tests in the current file to be run exclusively.
*/
public function only(): void
{
(new BeforeEachCall(TestSuite::getInstance(), $this->filename))->only();
}
/**
* Depending on where is called, it will extend the given classes and traits globally or locally.
*/
public function use(string ...$classAndTraits): UsesCall
{
return $this->extend(...$classAndTraits);
}
/**
* Depending on where is called, it will extend the given classes and traits globally or locally.
*/
public function uses(string ...$classAndTraits): UsesCall
{
return $this->extends(...$classAndTraits);
}
/**
* Gets the printer configuration.
*/
public function printer(): Configuration\Printer
{
return new Configuration\Printer;
}
/**
* Gets the presets configuration.
*/
public function presets(): Configuration\Presets
{
return new Configuration\Presets;
}
/**
* Gets the project configuration.
*/
public function project(): Configuration\Project
{
return Configuration\Project::getInstance();
}
/**
* Gets the browser configuration.
*/
public function browser(): Browser\Configuration
{
return new Browser\Configuration;
}
/**
* Proxies calls to the uses method.
*
* @param array<array-key, mixed> $arguments
*/
public function __call(string $name, array $arguments): mixed
{
return $this->uses()->$name(...$arguments); // @phpstan-ignore-line
}
}
================================================
FILE: src/Console/Help.php
================================================
<?php
declare(strict_types=1);
namespace Pest\Console;
use Symfony\Component\Console\Output\OutputInterface;
/**
* @internal
*/
final readonly class Help
{
/**
* The Command messages.
*
* @var array<int, string>
*/
private const array HELP_MESSAGES = [
'<comment>Pest Options:</comment>',
' <info>--init</info> Initialise a standard Pest configuration',
' <info>--coverage</info> Enable coverage and output to standard output',
' <info>--min=<fg=cyan><N></></info> Set the minimum required coverage percentage (<N>), and fail if not met',
' <info>--group=<fg=cyan><name></></info> Only runs tests from the specified group(s)',
];
/**
* Creates a new Console Command instance.
*/
public function __construct(private OutputInterface $output)
{
// ..
}
/**
* Executes the Console Command.
*/
public function __invoke(): void
{
foreach (self::HELP_MESSAGES as $message) {
$this->output->writeln($message);
}
}
}
================================================
FILE: src/Console/Thanks.php
================================================
<?php
declare(strict_types=1);
namespace Pest\Console;
use Pest\Bootstrappers\BootView;
use Pest\Support\View;
use Symfony\Component\Console\Helper\SymfonyQuestionHelper;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Question\ConfirmationQuestion;
/**
* @internal
*/
final readonly class Thanks
{
/**
* The support options.
*
* @var array<string, string>
*/
private const array FUNDING_MESSAGES = [
'Star' => 'https://github.com/pestphp/pest',
'YouTube' => 'https://youtube.com/@nunomaduro',
'TikTok' => 'https://tiktok.com/@enunomaduro',
'Twitch' => 'https://twitch.tv/nunomaduro',
'LinkedIn' => 'https://linkedin.com/in/nunomaduro',
'Instagram' => 'https://instagram.com/enunomaduro',
'X' => 'https://x.com/enunomaduro',
'Sponsor' => 'https://github.com/sponsors/nunomaduro',
];
/**
* Creates a new Console Command instance.
*/
public function __construct(
private InputInterface $input,
private OutputInterface $output
) {
// ..
}
/**
* Executes the Console Command.
*/
public function __invoke(): void
{
$bootstrapper = new BootView($this->output);
$bootstrapper->boot();
$wantsToSupport = false;
if (getenv('PEST_NO_SUPPORT') !== 'true' && $this->input->isInteractive()) {
$wantsToSupport = (new SymfonyQuestionHelper)->ask(
new ArrayInput([]),
$this->output,
new ConfirmationQuestion(
' <options=bold>Wanna show Pest some love by starring it on GitHub?</>',
false,
)
);
View::render('components.new-line');
foreach (self::FUNDING_MESSAGES as $message => $link) {
View::render('components.two-column-detail', [
'left' => $message,
'right' => $link,
]);
}
View::render('components.new-line');
}
if ($wantsToSupport === true) {
if (PHP_OS_FAMILY === 'Darwin') {
exec('open https://github.com/pestphp/pest');
}
if (PHP_OS_FAMILY === 'Windows') {
exec('start https://github.com/pestphp/pest');
}
if (PHP_OS_FAMILY === 'Linux') {
exec('xdg-open https://github.com/pestphp/pest');
}
}
}
}
================================================
FILE: src/Contracts/ArchPreset.php
================================================
<?php
declare(strict_types=1);
namespace Pest\Contracts;
/**
* @internal
*/
interface ArchPreset {}
================================================
FILE: src/Contracts/Bootstrapper.php
================================================
<?php
declare(strict_types=1);
namespace Pest\Contracts;
/**
* @internal
*/
interface Bootstrapper
{
/**
* Boots the bootstrapper.
*/
public function boot(): void;
}
================================================
FILE: src/Contracts/HasPrintableTestCaseName.php
================================================
<?php
declare(strict_types=1);
namespace Pest\Contracts;
use NunoMaduro\Collision\Contracts\Adapters\Phpunit\HasPrintableTestCaseName as BaseHasPrintableTestCaseName;
/**
* @internal
*/
interface HasPrintableTestCaseName extends BaseHasPrintableTestCaseName
{
// ..
}
================================================
FILE: src/Contracts/Panicable.php
================================================
<?php
declare(strict_types=1);
namespace Pest\Contracts;
use Symfony\Component\Console\Output\OutputInterface;
/**
* @internal
*/
interface Panicable
{
/**
* Renders the panic on the given output.
*/
public function render(OutputInterface $output): void;
/**
* The exit code to be used.
*/
public function exitCode(): int;
}
================================================
FILE: src/Contracts/Plugins/AddsOutput.php
================================================
<?php
declare(strict_types=1);
namespace Pest\Contracts\Plugins;
/**
* @internal
*/
interface AddsOutput
{
/**
* Adds output after the Test Suite execution.
*/
public function addOutput(int $exitCode): int;
}
================================================
FILE: src/Contracts/Plugins/Bootable.php
================================================
<?php
declare(strict_types=1);
namespace Pest\Contracts\Plugins;
/**
* @internal
*/
interface Bootable
{
/**
* Boots the plugin.
*/
public function boot(): void;
}
================================================
FILE: src/Contracts/Plugins/HandlesArguments.php
================================================
<?php
declare(strict_types=1);
namespace Pest\Contracts\Plugins;
/**
* @internal
*/
interface HandlesArguments
{
/**
* Adds arguments before the Test Suite execution.
*
* @param array<int, string> $arguments
* @return array<int, string>
*/
public function handleArguments(array $arguments): array;
}
================================================
FILE: src/Contracts/Plugins/HandlesOriginalArguments.php
================================================
<?php
declare(strict_types=1);
namespace Pest\Contracts\Plugins;
/**
* @internal
*/
interface HandlesOriginalArguments
{
/**
* Adds original arguments before the Test Suite execution.
*
* @param array<int, string> $arguments
*/
public function handleOriginalArguments(array $arguments): void;
}
================================================
FILE: src/Contracts/Plugins/Terminable.php
================================================
<?php
declare(strict_types=1);
namespace Pest\Contracts\Plugins;
/**
* @internal
*/
interface Terminable
{
/**
* Terminates the plugin.
*/
public function terminate(): void;
}
================================================
FILE: src/Contracts/TestCaseFilter.php
================================================
<?php
declare(strict_types=1);
namespace Pest\Contracts;
interface TestCaseFilter
{
/**
* Whether the test case is accepted.
*/
public function accept(string $testCaseFilename): bool;
}
================================================
FILE: src/Contracts/TestCaseMethodFilter.php
================================================
<?php
declare(strict_types=1);
namespace Pest\Contracts;
use Pest\Factories\TestCaseMethodFactory;
interface TestCaseMethodFilter
{
/**
* Whether the test case method is accepted.
*/
public function accept(TestCaseMethodFactory $factory): bool;
}
================================================
FILE: src/Evaluators/Attributes.php
================================================
<?php
declare(strict_types=1);
namespace Pest\Evaluators;
use Pest\Factories\Attribute;
/**
* @internal
*/
final class Attributes
{
/**
* Evaluates the given attributes and returns the code.
*
* @param iterable<int, Attribute> $attributes
*/
public static function code(iterable $attributes): string
{
return implode(PHP_EOL, array_map(function (Attribute $attribute): string {
$name = $attribute->name;
if ($attribute->arguments === []) {
return " #[\\{$name}]";
}
$arguments = array_map(fn (string $argument): string => var_export($argument, true), iterator_to_array($attribute->arguments));
return sprintf(' #[\\%s(%s)]', $name, implode(', ', $arguments));
}, iterator_to_array($attributes)));
}
}
================================================
FILE: src/Exceptions/AfterAllAlreadyExist.php
================================================
<?php
declare(strict_types=1);
namespace Pest\Exceptions;
use InvalidArgumentException;
use NunoMaduro\Collision\Contracts\RenderlessEditor;
use NunoMaduro\Collision\Contracts\RenderlessTrace;
use Symfony\Component\Console\Exception\ExceptionInterface;
/**
* @internal
*/
final class AfterAllAlreadyExist extends InvalidArgumentException implements ExceptionInterface, RenderlessEditor, RenderlessTrace
{
/**
* Creates a new Exception instance.
*/
public function __construct(string $filename)
{
parent::__construct(sprintf('The afterAll already exists in the filename `%s`.', $filename));
}
}
================================================
FILE: src/Exceptions/AfterAllWithinDescribe.php
================================================
<?php
declare(strict_types=1);
namespace Pest\Exceptions;
use InvalidArgumentException;
use NunoMaduro\Collision\Contracts\RenderlessEditor;
use NunoMaduro\Collision\Contracts\RenderlessTrace;
use Symfony\Component\Console\Exception\ExceptionInterface;
/**
* @internal
*/
final class AfterAllWithinDescribe extends InvalidArgumentException implements ExceptionInterface, RenderlessEditor, RenderlessTrace
{
/**
* Creates a new Exception instance.
*/
public function __construct(string $filename)
{
parent::__construct(sprintf('The afterAll method can not be used within describe functions. Filename `%s`.', $filename));
}
}
================================================
FILE: src/Exceptions/AfterBeforeTestFunction.php
================================================
<?php
declare(strict_types=1);
namespace Pest\Exceptions;
use InvalidArgumentException;
use NunoMaduro\Collision\Contracts\RenderlessEditor;
use NunoMaduro\Collision\Contracts\RenderlessTrace;
use Symfony\Component\Console\Exception\ExceptionInterface;
/**
* @internal
*/
final class AfterBeforeTestFunction extends InvalidArgumentException implements ExceptionInterface, RenderlessEditor, RenderlessTrace
{
/**
* Creates a new Exception instance.
*/
public function __construct(string $filename)
{
parent::__construct('After method cannot be used with before the [test|it] functions in the filename `['.$filename.']`.');
}
}
================================================
FILE: src/Exceptions/BeforeAllAlreadyExist.php
================================================
<?php
declare(strict_types=1);
namespace Pest\Exceptions;
use InvalidArgumentException;
use NunoMaduro\Collision\Contracts\RenderlessEditor;
use NunoMaduro\Collision\Contracts\RenderlessTrace;
use Symfony\Component\Console\Exception\ExceptionInterface;
/**
* @internal
*/
final class BeforeAllAlreadyExist extends InvalidArgumentException implements ExceptionInterface, RenderlessEditor, RenderlessTrace
{
/**
* Creates a new Exception instance.
*/
public function __construct(string $filename)
{
parent::__construct(sprintf('The beforeAll already exists in the filename `%s`.', $filename));
}
}
================================================
FILE: src/Exceptions/BeforeAllWithinDescribe.php
================================================
<?php
declare(strict_types=1);
namespace Pest\Exceptions;
use InvalidArgumentException;
use NunoMaduro\Collision\Contracts\RenderlessEditor;
use NunoMaduro\Collision\Contracts\RenderlessTrace;
use Symfony\Component\Console\Exception\ExceptionInterface;
/**
* @internal
*/
final class BeforeAllWithinDescribe extends InvalidArgumentException implements ExceptionInterface, RenderlessEditor, RenderlessTrace
{
/**
* Creates a new Exception instance.
*/
public function __construct(string $filename)
{
parent::__construct(sprintf('The beforeAll method can not be used within describe functions. Filename `%s`.', $filename));
}
}
================================================
FILE: src/Exceptions/DatasetAlreadyExists.php
================================================
<?php
declare(strict_types=1);
namespace Pest\Exceptions;
use InvalidArgumentException;
use NunoMaduro\Collision\Contracts\RenderlessEditor;
use NunoMaduro\Collision\Contracts\RenderlessTrace;
use Symfony\Component\Console\Exception\ExceptionInterface;
/**
* @internal
*/
final class DatasetAlreadyExists extends InvalidArgumentException implements ExceptionInterface, RenderlessEditor, RenderlessTrace
{
/**
* Creates a new Exception instance.
*/
public function __construct(string $name, string $scope)
{
parent::__construct(sprintf('A dataset with the name `%s` already exists in scope [%s].', $name, $scope));
}
}
================================================
FILE: src/Exceptions/DatasetArgumentsMismatch.php
================================================
<?php
declare(strict_types=1);
namespace Pest\Exceptions;
use Exception;
final class DatasetArgumentsMismatch extends Exception
{
public function __construct(int $requiredCount, int $suppliedCount)
{
if ($requiredCount <= $suppliedCount) {
parent::__construct('Test argument names and dataset keys do not match');
} else {
parent::__construct(sprintf('Test expects %d arguments but dataset only provides %d', $requiredCount, $suppliedCount));
}
}
//
}
================================================
FILE: src/Exceptions/DatasetDoesNotExist.php
================================================
<?php
declare(strict_types=1);
namespace Pest\Exceptions;
use InvalidArgumentException;
use NunoMaduro\Collision\Contracts\RenderlessEditor;
use NunoMaduro\Collision\Contracts\RenderlessTrace;
use Symfony\Component\Console\Exception\ExceptionInterface;
/**
* @internal
*/
final class DatasetDoesNotExist extends InvalidArgumentException implements ExceptionInterface, RenderlessEditor, RenderlessTrace
{
/**
* Creates a new Exception instance.
*/
public function __construct(string $name)
{
parent::__construct(sprintf("A dataset with the name `%s` does not exist. You can create it using `dataset('%s', ['a', 'b']);`.", $name, $name));
}
}
================================================
FILE: src/Exceptions/DatasetMissing.php
================================================
<?php
declare(strict_types=1);
namespace Pest\Exceptions;
use BadFunctionCallException;
use NunoMaduro\Collision\Contracts\RenderlessEditor;
use NunoMaduro\Collision\Contracts\RenderlessTrace;
use Symfony\Component\Console\Exception\ExceptionInterface;
/**
* @internal
*/
final class DatasetMissing extends BadFunctionCallException implements ExceptionInterface, RenderlessEditor, RenderlessTrace
{
/**
* Creates a new Exception instance.
*
* @param array<string, string> $arguments
*/
public function __construct(string $file, string $name, array $arguments)
{
parent::__construct(sprintf(
'A test with the description [%s] has [%d] argument(s) ([%s]) and no dataset(s) provided in [%s]',
$name,
count($arguments),
implode(', ', array_map(static fn (string $arg, string $type): string => sprintf('%s $%s', $type, $arg), array_keys($arguments), $arguments)),
$file,
));
}
}
================================================
FILE: src/Exceptions/ExpectationNotFound.php
================================================
<?php
declare(strict_types=1);
namespace Pest\Exceptions;
use Exception;
/**
* @internal
*/
final class ExpectationNotFound extends Exception
{
/**
* Creates a new ExpectationNotFound instance from the given name.
*/
public static function fromName(string $name): ExpectationNotFound
{
return new self("Expectation [$name] does not exist.");
}
}
================================================
FILE: src/Exceptions/FatalException.php
================================================
<?php
declare(strict_types=1);
namespace Pest\Exceptions;
use NunoMaduro\Collision\Contracts\RenderlessTrace;
use RuntimeException;
/**
* @internal
*/
final class FatalException extends RuntimeException implements RenderlessTrace
{
//
}
================================================
FILE: src/Exceptions/FileOrFolderNotFound.php
================================================
<?php
declare(strict_types=1);
namespace Pest\Exceptions;
use InvalidArgumentException;
use NunoMaduro\Collision\Contracts\RenderlessEditor;
use NunoMaduro\Collision\Contracts\RenderlessTrace;
use Symfony\Component\Console\Exception\ExceptionInterface;
/**
* @internal
*/
final class FileOrFolderNotFound extends InvalidArgumentException implements ExceptionInterface, RenderlessEditor, RenderlessTrace
{
/**
* Creates a new Exception instance.
*/
public function __construct(string $filename)
{
parent::__construct(sprintf('The file or folder with the name `%s` could not be found.', $filename));
}
}
================================================
FILE: src/Exceptions/InvalidArgumentException.php
================================================
<?php
declare(strict_types=1);
namespace Pest\Exceptions;
use InvalidArgumentException as BaseInvalidArgumentException;
use NunoMaduro\Collision\Contracts\RenderlessEditor;
use NunoMaduro\Collision\Contracts\RenderlessTrace;
use Symfony\Component\Console\Exception\ExceptionInterface;
/**
* @internal
*/
final class InvalidArgumentException extends BaseInvalidArgumentException implements ExceptionInterface, RenderlessEditor, RenderlessTrace
{
/**
* Creates a new Exception instance.
*/
public function __construct(string $message)
{
parent::__construct($message, 1);
}
}
================================================
FILE: src/Exceptions/InvalidExpectation.php
================================================
<?php
declare(strict_types=1);
namespace Pest\Exceptions;
use LogicException;
use NunoMaduro\Collision\Contracts\RenderlessEditor;
use NunoMaduro\Collision\Contracts\RenderlessTrace;
use Symfony\Component\Console\Exception\ExceptionInterface;
/**
* @internal
*/
final class InvalidExpectation extends LogicException implements ExceptionInterface, RenderlessEditor, RenderlessTrace
{
/**
* @param array<int, string> $methods
*
* @throws self
*/
public static function fromMethods(array $methods): never
{
throw new self(sprintf('Expectation [%s] is not valid.', implode('->', $methods)));
}
}
================================================
FILE: src/Exceptions/InvalidExpectationValue.php
================================================
<?php
declare(strict_types=1);
namespace Pest\Exceptions;
use InvalidArgumentException;
/**
* @internal
*/
final class InvalidExpectationValue extends InvalidArgumentException
{
/**
* @throws self
*/
public static function expected(string $type): never
{
throw new self(sprintf('Invalid expectation value type. Expected [%s].', $type));
}
}
================================================
FILE: src/Exceptions/InvalidOption.php
================================================
<?php
declare(strict_types=1);
namespace Pest\Exceptions;
use InvalidArgumentException;
use NunoMaduro\Collision\Contracts\RenderlessEditor;
use NunoMaduro\Collision\Contracts\RenderlessTrace;
use Symfony\Component\Console\Exception\ExceptionInterface;
/**
* @internal
*/
final class InvalidOption extends InvalidArgumentException implements ExceptionInterface, RenderlessEditor, RenderlessTrace
{
/**
* Creates a new Exception instance.
*/
public function __construct(string $message)
{
parent::__construct($message, 1);
}
}
================================================
FILE: src/Exceptions/InvalidPestCommand.php
================================================
<?php
declare(strict_types=1);
namespace Pest\Exceptions;
use InvalidArgumentException;
use NunoMaduro\Collision\Contracts\RenderlessEditor;
use NunoMaduro\Collision\Contracts\RenderlessTrace;
use Symfony\Component\Console\Exception\ExceptionInterface;
/**
* @internal
*/
final class InvalidPestCommand extends InvalidArgumentException implements ExceptionInterface, RenderlessEditor, RenderlessTrace
{
/**
* Creates a new Exception instance.
*/
public function __construct()
{
parent::__construct('Please run [./vendor/bin/pest] instead.');
}
}
================================================
FILE: src/Exceptions/MissingDependency.php
================================================
<?php
declare(strict_types=1);
namespace Pest\Exceptions;
use InvalidArgumentException;
use NunoMaduro\Collision\Contracts\RenderlessEditor;
use NunoMaduro\Collision\Contracts\RenderlessTrace;
use Symfony\Component\Console\Exception\ExceptionInterface;
/**
* @internal
*/
final class MissingDependency extends InvalidArgumentException implements ExceptionInterface, RenderlessEditor, RenderlessTrace
{
/**
* Creates a new Exception instance.
*/
public function __construct(string $feature, string $dependency)
{
parent::__construct(sprintf('The feature "%s" requires "%s".', $feature, $dependency));
}
}
================================================
FILE: src/Exceptions/NoDirtyTestsFound.php
================================================
<?php
declare(strict_types=1);
namespace Pest\Exceptions;
use InvalidArgumentException;
use NunoMaduro\Collision\Contracts\RenderlessEditor;
use NunoMaduro\Collision\Contracts\RenderlessTrace;
use Pest\Contracts\Panicable;
use Symfony\Component\Console\Exception\ExceptionInterface;
use Symfony\Component\Console\Output\OutputInterface;
/**
* @internal
*/
final class NoDirtyTestsFound extends InvalidArgumentException implements ExceptionInterface, Panicable, RenderlessEditor, RenderlessTrace
{
/**
* Renders the panic on the given output.
*/
public function render(OutputInterface $output): void
{
$output->writeln([
'',
' <fg=white;options=bold;bg=blue> INFO </> No "dirty" tests found.',
'',
]);
}
/**
* The exit code to be used.
*/
public function exitCode(): int
{
return 0;
}
}
================================================
FILE: src/Exceptions/ShouldNotHappen.php
================================================
<?php
declare(strict_types=1);
namespace Pest\Exceptions;
use Exception;
use RuntimeException;
/**
* @internal
*/
final class ShouldNotHappen extends RuntimeException
{
/**
* Creates a new Exception instance.
*/
public function __construct(Exception $exception)
{
$message = $exception->getMessage();
parent::__construct(sprintf(<<<'EOF'
This should not happen - please create an new issue here: https://github.com/pestphp/pest/issues
Issue: %s
PHP version: %s
Operating system: %s
EOF
, $message, phpversion(), PHP_OS), 1, $exception);
}
/**
* Creates a new instance of should not happen without a specific exception.
*/
public static function fromMessage(string $message): ShouldNotHappen
{
return new ShouldNotHappen(new Exception($message));
}
}
================================================
FILE: src/Exceptions/TestAlreadyExist.php
================================================
<?php
declare(strict_types=1);
namespace Pest\Exceptions;
use InvalidArgumentException;
use NunoMaduro\Collision\Contracts\RenderlessEditor;
use NunoMaduro\Collision\Contracts\RenderlessTrace;
use Symfony\Component\Console\Exception\ExceptionInterface;
/**
* @internal
*/
final class TestAlreadyExist extends InvalidArgumentException implements ExceptionInterface, RenderlessEditor, RenderlessTrace
{
/**
* Creates a new Exception instance.
*/
public function __construct(string $fileName, string $description)
{
parent::__construct(sprintf('A test with the description `%s` already exists in the filename `%s`.', $description, $fileName));
}
}
================================================
FILE: src/Exceptions/TestCaseAlreadyInUse.php
================================================
<?php
declare(strict_types=1);
namespace Pest\Exceptions;
use InvalidArgumentException;
use NunoMaduro\Collision\Contracts\RenderlessEditor;
use NunoMaduro\Collision\Contracts\RenderlessTrace;
use Symfony\Component\Console\Exception\ExceptionInterface;
/**
* @internal
*/
final class TestCaseAlreadyInUse extends InvalidArgumentException implements ExceptionInterface, RenderlessEditor, RenderlessTrace
{
/**
* Creates a new Exception instance.
*/
public function __construct(string $inUse, string $newOne, string $folder)
{
parent::__construct(sprintf(
'Test case [%s] can not be used. The folder [%s] already uses the test case [%s].',
$newOne,
$folder,
$inUse,
));
}
}
================================================
FILE: src/Exceptions/TestCaseClassOrTraitNotFound.php
================================================
<?php
declare(strict_types=1);
namespace Pest\Exceptions;
use InvalidArgumentException;
use NunoMaduro\Collision\Contracts\RenderlessEditor;
use NunoMaduro\Collision\Contracts\RenderlessTrace;
use Symfony\Component\Console\Exception\ExceptionInterface;
/**
* @internal
*/
final class TestCaseClassOrTraitNotFound extends InvalidArgumentException implements ExceptionInterface, RenderlessEditor, RenderlessTrace
{
/**
* Creates a new Exception instance.
*/
public function __construct(string $testCaseClass)
{
parent::__construct(sprintf('The class `%s` was not found.', $testCaseClass));
}
}
================================================
FILE: src/Exceptions/TestClosureMustNotBeStatic.php
================================================
<?php
declare(strict_types=1);
namespace Pest\Exceptions;
use InvalidArgumentException;
use NunoMaduro\Collision\Contracts\RenderlessEditor;
use NunoMaduro\Collision\Contracts\RenderlessTrace;
use Pest\Factories\TestCaseMethodFactory;
use Symfony\Component\Console\Exception\ExceptionInterface;
/**
* @internal
*/
final class TestClosureMustNotBeStatic extends InvalidArgumentException implements ExceptionInterface, RenderlessEditor, RenderlessTrace
{
/**
* Creates a new Exception instance.
*/
public function __construct(TestCaseMethodFactory $method)
{
parent::__construct(
sprintf(
'Test closure must not be static. Please remove the [static] keyword from the [%s] method in [%s].',
$method->description,
$method->filename
)
);
}
}
================================================
FILE: src/Exceptions/TestDescriptionMissing.php
================================================
<?php
declare(strict_types=1);
namespace Pest\Exceptions;
use InvalidArgumentException;
use NunoMaduro\Collision\Contracts\RenderlessEditor;
use NunoMaduro\Collision\Contracts\RenderlessTrace;
use Symfony\Component\Console\Exception\ExceptionInterface;
/**
* @internal
*/
final class TestDescriptionMissing extends InvalidArgumentException implements ExceptionInterface, RenderlessEditor, RenderlessTrace
{
/**
* Creates a new Exception instance.
*/
public function __construct(string $fileName)
{
parent::__construct(sprintf('Test description is missing in the filename `%s`.', $fileName));
}
}
================================================
FILE: src/Expectation.php
================================================
<?php
declare(strict_types=1);
namespace Pest;
use Attribute;
use BadMethodCallException;
use Closure;
use InvalidArgumentException;
use OutOfRangeException;
use Pest\Arch\Contracts\ArchExpectation;
use Pest\Arch\Expectations\Targeted;
use Pest\Arch\Expectations\ToBeUsedIn;
use Pest\Arch\Expectations\ToBeUsedInNothing;
use Pest\Arch\Expectations\ToOnlyBeUsedIn;
use Pest\Arch\Expectations\ToOnlyUse;
use Pest\Arch\Expectations\ToUse;
use Pest\Arch\Expectations\ToUseNothing;
use Pest\Arch\PendingArchExpectation;
use Pest\Arch\Support\FileLineFinder;
use Pest\Concerns\Extendable;
use Pest\Concerns\Pipeable;
use Pest\Concerns\Retrievable;
use Pest\Exceptions\ExpectationNotFound;
use Pest\Exceptions\InvalidExpectation;
use Pest\Exceptions\InvalidExpectationValue;
use Pest\Expectations\EachExpectation;
use Pest\Expectations\HigherOrderExpectation;
use Pest\Expectations\OppositeExpectation;
use Pest\Matchers\Any;
use Pest\Support\ExpectationPipeline;
use Pest\Support\Reflection;
use PHPUnit\Architecture\Elements\ObjectDescription;
use PHPUnit\Framework\ExpectationFailedException;
use ReflectionEnum;
use ReflectionMethod;
use ReflectionProperty;
/**
* @template TValue
*
* @property OppositeExpectation $not Creates the opposite expectation.
* @property EachExpectation $each Creates an expectation on each element on the traversable value.
* @property PendingArchExpectation $classes
* @property PendingArchExpectation $traits
* @property PendingArchExpectation $interfaces
* @property PendingArchExpectation $enums
*
* @mixin Mixins\Expectation<TValue>
* @mixin PendingArchExpectation
*/
final class Expectation
{
/** @use Extendable<self<TValue>> */
use Extendable;
use Pipeable;
use Retrievable;
/**
* Creates a new expectation.
*
* @param TValue $value
*/
public function __construct(
public mixed $value
) {
// ..
}
/**
* Creates a new expectation.
*
* @template TAndValue
*
* @param TAndValue $value
* @return self<TAndValue>
*/
public function and(mixed $value): Expectation
{
return $value instanceof self ? $value : new self($value);
}
/**
* Creates a new expectation with the decoded JSON value.
*
* @return self<array<int|string, mixed>|bool>
*/
public function json(): Expectation
{
if (! is_string($this->value)) {
InvalidExpectationValue::expected('string');
}
$this->toBeJson();
/** @var array<int|string, mixed>|bool $value */
$value = json_decode($this->value, true, 512, JSON_THROW_ON_ERROR);
return $this->and($value);
}
/**
* Dump the expectation value.
*
* @return self<TValue>
*/
public function dump(mixed ...$arguments): self
{
if (function_exists('dump')) {
dump($this->value, ...$arguments);
} else {
var_dump($this->value);
}
return $this;
}
/**
* Dump the expectation value and end the script.
*
* @return never
*/
public function dd(mixed ...$arguments): void
{
if (function_exists('dd')) {
dd($this->value, ...$arguments);
}
var_dump($this->value);
exit(1);
}
/**
* Dump the expectation value when the result of the condition is truthy.
*
* @param (Closure(TValue): bool)|bool $condition
* @return self<TValue>
*/
public function ddWhen(Closure|bool $condition, mixed ...$arguments): Expectation
{
$condition = $condition instanceof Closure ? $condition($this->value) : $condition;
if (! $condition) {
return $this;
}
$this->dd(...$arguments);
}
/**
* Dump the expectation value when the result of the condition is falsy.
*
* @param (Closure(TValue): bool)|bool $condition
* @return self<TValue>
*/
public function ddUnless(Closure|bool $condition, mixed ...$arguments): Expectation
{
$condition = $condition instanceof Closure ? $condition($this->value) : $condition;
if ($condition) {
return $this;
}
$this->dd(...$arguments);
}
/**
* Send the expectation value to Ray along with all given arguments.
*
* @return self<TValue>
*/
public function ray(mixed ...$arguments): self
{
if (function_exists('ray')) {
ray($this->value, ...$arguments);
}
return $this;
}
/**
* Creates the opposite expectation for the value.
*
* @return OppositeExpectation<TValue>
*/
public function not(): OppositeExpectation
{
return new OppositeExpectation($this);
}
/**
* Creates an expectation on each item of the iterable "value".
*
* @return EachExpectation<TValue>
*/
public function each(?callable $callback = null): EachExpectation
{
if (! is_iterable($this->value)) {
throw new BadMethodCallException('Expectation value is not iterable.');
}
if (is_callable($callback)) {
foreach ($this->value as $key => $item) {
$callback(new self($item), $key);
}
}
return new EachExpectation($this);
}
/**
* Allows you to specify a sequential set of expectations for each item in a iterable "value".
*
* @template TSequenceValue
*
* @param (callable(self<TValue>, self<string|int>): void)|TSequenceValue ...$callbacks
* @return self<TValue>
*/
public function sequence(mixed ...$callbacks): self
{
if (! is_iterable($this->value)) {
throw new BadMethodCallException('Expectation value is not iterable.');
}
if ($callbacks === []) {
throw new InvalidArgumentException('No sequence expectations defined.');
}
$index = $valuesCount = 0;
foreach ($this->value as $key => $value) {
$valuesCount++;
if ($callbacks[$index] instanceof Closure) {
$callbacks[$index](new self($value), new self($key));
} else {
(new self($value))->toEqual($callbacks[$index]);
}
$index = isset($callbacks[$index + 1]) ? $index + 1 : 0;
}
if ($valuesCount < count($callbacks)) {
throw new OutOfRangeException('Sequence expectations are more than the iterable items.');
}
return $this;
}
/**
* If the subject matches one of the given "expressions", the expression callback will run.
*
* @template TMatchSubject of array-key
*
* @param (callable(): TMatchSubject)|TMatchSubject $subject
* @param array<TMatchSubject, (callable(self<TValue>): mixed)|TValue> $expressions
* @return self<TValue>
*/
public function match(mixed $subject, array $expressions): self
{
$subject = $subject instanceof Closure ? $subject() : $subject;
$matched = false;
foreach ($expressions as $key => $callback) {
if ($subject != $key) { // @pest-arch-ignore-line
continue;
}
$matched = true;
if (is_callable($callback)) {
$callback(new self($this->value));
continue;
}
$this->and($this->value)->toEqual($callback);
break;
}
if ($matched === false) {
throw new ExpectationFailedException('Unhandled match value.');
}
return $this;
}
/**
* Apply the callback if the given "condition" is falsy.
*
* @param (callable(): bool)|bool $condition
* @param callable(Expectation<TValue>): mixed $callback
* @return self<TValue>
*/
public function unless(callable|bool $condition, callable $callback): Expectation
{
$condition = is_callable($condition)
? $condition
: static fn (): bool => $condition;
return $this->when(! $condition(), $callback);
}
/**
* Apply the callback if the given "condition" is truthy.
*
* @param (callable(): bool)|bool $condition
* @param callable(self<TValue>): mixed $callback
* @return self<TValue>
*/
public function when(callable|bool $condition, callable $callback): self
{
$condition = is_callable($condition)
? $condition
: static fn (): bool => $condition;
if ($condition()) {
$callback($this->and($this->value));
}
return $this;
}
/**
* Dynamically calls methods on the class or creates a new higher order expectation.
*
* @param array<int, mixed> $parameters
* @return Expectation<TValue>|HigherOrderExpectation<Expectation<TValue>, TValue>
*/
public function __call(string $method, array $parameters): Expectation|HigherOrderExpectation|PendingArchExpectation|ArchExpectation
{
if (! self::hasMethod($method)) {
if (! is_object($this->value) && method_exists(PendingArchExpectation::class, $method)) {
$pendingArchExpectation = new PendingArchExpectation($this, []);
return $pendingArchExpectation->$method(...$parameters); // @phpstan-ignore-line
}
if (! is_object($this->value)) {
throw new BadMethodCallException(sprintf(
'Method "%s" does not exist in %s.',
$method,
gettype($this->value)
));
}
/* @phpstan-ignore-next-line */
return new HigherOrderExpectation($this, call_user_func_array($this->value->$method(...), $parameters));
}
$closure = $this->getExpectationClosure($method);
$reflectionClosure = new \ReflectionFunction($closure);
$expectation = $reflectionClosure->getClosureThis();
if ($reflectionClosure->getReturnType()?->__toString() === ArchExpectation::class) {
return $closure(...$parameters);
}
assert(is_object($expectation));
ExpectationPipeline::for($closure)
->send(...$parameters)
->through($this->pipes($method, $expectation, Expectation::class))
->run();
return $this;
}
/**
* Creates a new expectation closure from the given name.
*
* @throws ExpectationNotFound
*/
private function getExpectationClosure(string $name): Closure
{
if (method_exists(Mixins\Expectation::class, $name)) {
// @phpstan-ignore-next-line
return Closure::fromCallable([new Mixins\Expectation($this->value), $name]);
}
if (self::hasExtend($name)) {
$extend = self::$extends[$name]->bindTo($this, Expectation::class);
if ($extend != false) { // @pest-arch-ignore-line
return $extend;
}
}
throw ExpectationNotFound::fromName($name);
}
/**
* Dynamically calls methods on the class without any arguments or creates a new higher order expectation.
*
* @return Expectation<TValue>|OppositeExpectation<TValue>|EachExpectation<TValue>|HigherOrderExpectation<Expectation<TValue>, TValue|null>|TValue
*/
public function __get(string $name): mixed
{
if (! self::hasMethod($name)) {
if (! is_object($this->value) && method_exists(PendingArchExpectation::class, $name)) {
/* @phpstan-ignore-next-line */
return $this->{$name}();
}
/* @phpstan-ignore-next-line */
return new HigherOrderExpectation($this, $this->retrieve($name, $this->value));
}
/* @phpstan-ignore-next-line */
return $this->{$name}();
}
/**
* Checks if the given expectation method exists.
*/
public static function hasMethod(string $name): bool
{
return method_exists(self::class, $name)
|| method_exists(Mixins\Expectation::class, $name)
|| self::hasExtend($name);
}
/**
* Matches any value.
*/
public function any(): Any
{
return new Any;
}
/**
* Asserts that the given expectation target use the given dependencies.
*
* @param array<int, string>|string $targets
*/
public function toUse(array|string $targets): ArchExpectation
{
return ToUse::make($this, $targets);
}
/**
* Asserts that the given expectation target does have the given permissions
*/
public function toHaveFileSystemPermissions(string $permissions): ArchExpectation
{
return Targeted::make(
$this,
fn (ObjectDescription $object): bool => substr(sprintf('%o', fileperms($object->path)), -4) === $permissions,
sprintf('permissions to be [%s]', $permissions),
FileLineFinder::where(fn (string $line): bool => str_contains($line, '<?php')),
);
}
/**
* Asserts that the given expectation target to have line count less than the given number.
*/
public function toHaveLineCountLessThan(int $lines): ArchExpectation
{
return Targeted::make(
$this,
fn (ObjectDescription $object): bool => count(file($object->path)) < $lines, // @phpstan-ignore-line
sprintf('to have less than %d lines of code', $lines),
FileLineFinder::where(fn (string $line): bool => str_contains($line, '<?php')),
);
}
/**
* Asserts that the given expectation target have all methods documented.
*/
public function toHaveMethodsDocumented(): ArchExpectation
{
return Targeted::make(
$this,
fn (ObjectDescription $object): bool => isset($object->reflectionClass) === false
|| array_filter(
Reflection::getMethodsFromReflectionClass($object->reflectionClass),
fn (ReflectionMethod $method): bool => (enum_exists($object->name) === false || in_array($method->name, ['from', 'tryFrom', 'cases'], true) === false)
&& realpath($method->getFileName() ?: '/') === realpath($object->path) // @phpstan-ignore-line
&& $method->getDocComment() === false,
) === [],
'to have methods with documentation / annotations',
FileLineFinder::where(fn (string $line): bool => str_contains($line, 'class'))
);
}
/**
* Asserts that the given expectation target have all properties documented.
*/
public function toHavePropertiesDocumented(): ArchExpectation
{
return Targeted::make(
$this,
fn (ObjectDescription $object): bool => isset($object->reflectionClass) === false
|| array_filter(
Reflection::getPropertiesFromReflectionClass($object->reflectionClass),
fn (ReflectionProperty $property): bool => (enum_exists($object->name) === false || in_array($property->name, ['value', 'name'], true) === false)
&& realpath($property->getDeclaringClass()->getFileName() ?: '/') === realpath($object->path) // @phpstan-ignore-line
&& $property->isPromoted() === false
&& $property->getDocComment() === false,
) === [],
'to have properties with documentation / annotations',
FileLineFinder::where(fn (string $line): bool => str_contains($line, 'class'))
);
}
/**
* Asserts that the given expectation target use the "declare(strict_types=1)" declaration.
*/
public function toUseStrictTypes(): ArchExpectation
{
return Targeted::make(
$this,
fn (ObjectDescription $object): bool => (bool) preg_match('/^<\?php\s*(\/\*[\s\S]*?\*\/|\/\/[^\r\n]*(?:\r?\n|$)|\s)*declare\s*\(\s*strict_types\s*=\s*1\s*\)\s*;/m', (string) file_get_contents($object->path)),
'to use strict types',
FileLineFinder::where(fn (string $line): bool => str_contains($line, '<?php')),
);
}
/**
* Asserts that the given expectation target uses strict equality.
*/
public function toUseStrictEquality(): ArchExpectation
{
return Targeted::make(
$this,
fn (ObjectDescription $object): bool => ! str_contains((string) file_get_contents($object->path), ' == ') && ! str_contains((string) file_get_contents($object->path), ' != '),
'to use strict equality',
FileLineFinder::where(fn (string $line): bool => str_contains($line, ' == ') || str_contains($line, ' != ')),
);
}
/**
* Asserts that the given expectation target is final.
*/
public function toBeFinal(): ArchExpectation
{
return Targeted::make(
$this,
fn (ObjectDescription $object): bool => ! enum_exists($object->name) && isset($object->reflectionClass) && $object->reflectionClass->isFinal(),
'to be final',
FileLineFinder::where(fn (string $line): bool => str_contains($line, 'class')),
);
}
/**
* Asserts that the given expectation target is readonly.
*/
public function toBeReadonly(): ArchExpectation
{
return Targeted::make(
$this,
fn (ObjectDescription $object): bool => ! enum_exists($object->name) && isset($object->reflectionClass) && $object->reflectionClass->isReadOnly() && assert(true), // @phpstan-ignore-line
'to be readonly',
FileLineFinder::where(fn (string $line): bool => str_contains($line, 'class')),
);
}
/**
* Asserts that the given expectation target is trait.
*/
public function toBeTrait(): ArchExpectation
{
return Targeted::make(
$this,
fn (ObjectDescription $object): bool => isset($object->reflectionClass) && $object->reflectionClass->isTrait(),
'to be trait',
FileLineFinder::where(fn (string $line): bool => str_contains($line, 'class')),
);
}
/**
* Asserts that the given expectation targets are traits.
*/
public function toBeTraits(): ArchExpectation
{
return $this->toBeTrait();
}
/**
* Asserts that the given expectation target is abstract.
*/
public function toBeAbstract(): ArchExpectation
{
return Targeted::make(
$this,
fn (ObjectDescription $object): bool => isset($object->reflectionClass) && $object->reflectionClass->isAbstract(),
'to be abstract',
FileLineFinder::where(fn (string $line): bool => str_contains($line, 'class')),
);
}
/**
* Asserts that the given expectation target has a specific method.
*
* @param array<int, string>|string $method
*/
public function toHaveMethod(array|string $method): ArchExpectation
{
$methods = is_array($method) ? $method : [$method];
return Targeted::make(
$this,
fn (ObjectDescription $object): bool => count(array_filter($methods, fn (string $method): bool => isset($object->reflectionClass) && $object->reflectionClass->hasMethod($method))) === count($methods),
sprintf("to have method '%s'", implode("', '", $methods)),
FileLineFinder::where(fn (string $line): bool => str_contains($line, 'class')),
);
}
/**
* Asserts that the given expectation target has a specific methods.
*
* @param array<int, string> $methods
*/
public function toHaveMethods(array $methods): ArchExpectation
{
return $this->toHaveMethod($methods);
}
/**
* Not supported.
*/
public function toHavePublicMethodsBesides(): void
{
throw InvalidExpectation::fromMethods(['toHavePublicMethodsBesides']);
}
/**
* Not supported.
*/
public function toHavePublicMethods(): void
{
throw InvalidExpectation::fromMethods(['toHavePublicMethods']);
}
/**
* Not supported.
*/
public function toHaveProtectedMethodsBesides(): void
{
throw InvalidExpectation::fromMethods(['toHaveProtectedMethodsBesides']);
}
/**
* Not supported.
*/
public function toHaveProtectedMethods(): void
{
throw InvalidExpectation::fromMethods(['toHaveProtectedMethods']);
}
/**
* Not supported.
*/
public function toHavePrivateMethodsBesides(): void
{
throw InvalidExpectation::fromMethods(['toHavePrivateMethodsBesides']);
}
/**
* Not supported.
*/
public function toHavePrivateMethods(): void
{
throw InvalidExpectation::fromMethods(['toHavePrivateMethods']);
}
/**
* Asserts that the given expectation target is enum.
*/
public function toBeEnum(): ArchExpectation
{
return Targeted::make(
$this,
fn (ObjectDescription $object): bool => isset($object->reflectionClass) && $object->reflectionClass->isEnum(),
'to be enum',
FileLineFinder::where(fn (string $line): bool => str_contains($line, 'class')),
);
}
/**
* Asserts that the given expectation targets are enums.
*/
public function toBeEnums(): ArchExpectation
{
return $this->toBeEnum();
}
/**
* Asserts that the given expectation target is a class.
*/
public function toBeClass(): ArchExpectation
{
return Targeted::make(
$this,
fn (ObjectDescription $object): bool => class_exists($object->name) && ! enum_exists($object->name),
'to be class',
FileLineFinder::where(fn (string $line): bool => true),
);
}
/**
* Asserts that the given expectation targets are classes.
*/
public function toBeClasses(): ArchExpectation
{
return $this->toBeClass();
}
/**
* Asserts that the given expectation target is interface.
*/
public function toBeInterface(): ArchExpectation
{
return Targeted::make(
$this,
fn (ObjectDescription $object): bool => isset($object->reflectionClass) && $object->reflectionClass->isInterface(),
'to be interface',
FileLineFinder::where(fn (string $line): bool => str_contains($line, 'class')),
);
}
/**
* Asserts that the given expectation targets are interfaces.
*/
public function toBeInterfaces(): ArchExpectation
{
return $this->toBeInterface();
}
/**
* Asserts that the given expectation target to be subclass of the given class.
*/
public function toExtend(string $class): ArchExpectation
{
return Targeted::make(
$this,
fn (ObjectDescription $object): bool => isset($object->reflectionClass) && ($class === $object->reflectionClass->getName() || $object->reflectionClass->isSubclassOf($class)),
sprintf("to extend '%s'", $class),
FileLineFinder::where(fn (string $line): bool => str_contains($line, 'class')),
);
}
/**
* Asserts that the given expectation target to be have a parent class.
*/
public function toExtendNothing(): ArchExpectation
{
return Targeted::make(
$this,
fn (ObjectDescription $object): bool => $object->reflectionClass->getParentClass() === false,
'to extend nothing',
FileLineFinder::where(fn (string $line): bool => str_contains($line, 'class')),
);
}
/**
* Asserts that the given expectation target to use the given trait.
*/
public function toUseTrait(string $trait): ArchExpectation
{
return $this->toUseTraits($trait);
}
/**
* Asserts that the given expectation target to use the given traits.
*
* @param array<int, string>|string $traits
*/
public function toUseTraits(array|string $traits): ArchExpectation
{
$traits = is_array($traits) ? $traits : [$traits];
return Targeted::make(
$this,
function (ObjectDescription $object) use ($traits): bool {
foreach ($traits as $trait) {
if (isset($object->reflectionClass) === false) {
return false;
}
if (! in_array($trait, $object->reflectionClass->getTraitNames(), true)) {
return false;
}
}
return true;
},
"to use traits '".implode("', '", $traits)."'",
FileLineFinder::where(fn (string $line): bool => str_contains($line, 'class')),
);
}
/**
* Asserts that the given expectation target to not implement any interfaces.
*/
public function toImplementNothing(): ArchExpectation
{
return Targeted::make(
$this,
fn (ObjectDescription $object): bool => isset($object->reflectionClass) && $object->reflectionClass->getInterfaceNames() === [],
'to implement nothing',
FileLineFinder::where(fn (string $line): bool => str_contains($line, 'class')),
);
}
/**
* Asserts that the given expectation target to only implement the given interfaces.
*
* @param array<int, string>|string $interfaces
*/
public function toOnlyImpl
gitextract_nn7gly9v/
├── .editorconfig
├── .gitattributes
├── .github/
│ ├── FUNDING.yml
│ ├── ISSUE_TEMPLATE/
│ │ └── bug_report.yml
│ ├── PULL_REQUEST_TEMPLATE.md
│ └── workflows/
│ ├── static.yml
│ └── tests.yml
├── .gitignore
├── CONTRIBUTING.md
├── LICENSE.md
├── README.md
├── RELEASE.md
├── bin/
│ ├── pest
│ └── worker.php
├── composer.json
├── docker/
│ └── Dockerfile
├── extension.neon
├── overrides/
│ ├── Event/
│ │ └── Value/
│ │ └── ThrowableBuilder.php
│ ├── Logging/
│ │ └── JUnit/
│ │ └── JunitXmlLogger.php
│ ├── Runner/
│ │ ├── Filter/
│ │ │ └── NameFilterIterator.php
│ │ ├── ResultCache/
│ │ │ └── DefaultResultCache.php
│ │ └── TestSuiteLoader.php
│ └── TextUI/
│ ├── Command/
│ │ └── Commands/
│ │ └── WarmCodeCoverageCacheCommand.php
│ ├── Output/
│ │ └── Default/
│ │ └── ProgressPrinter/
│ │ └── Subscriber/
│ │ └── TestSkippedSubscriber.php
│ └── TestSuiteFilterProcessor.php
├── phpstan-baseline.neon
├── phpstan.neon
├── phpunit.xml
├── rector.php
├── resources/
│ ├── base-phpunit.xml
│ └── views/
│ ├── components/
│ │ ├── badge.php
│ │ ├── new-line.php
│ │ └── two-column-detail.php
│ ├── installers/
│ │ └── plugin-browser.php
│ ├── usage.php
│ └── version.php
├── src/
│ ├── ArchPresets/
│ │ ├── AbstractPreset.php
│ │ ├── Custom.php
│ │ ├── Laravel.php
│ │ ├── Php.php
│ │ ├── Relaxed.php
│ │ ├── Security.php
│ │ └── Strict.php
│ ├── Bootstrappers/
│ │ ├── BootExcludeList.php
│ │ ├── BootFiles.php
│ │ ├── BootKernelDump.php
│ │ ├── BootOverrides.php
│ │ ├── BootSubscribers.php
│ │ └── BootView.php
│ ├── Collision/
│ │ └── Events.php
│ ├── Concerns/
│ │ ├── Expectable.php
│ │ ├── Extendable.php
│ │ ├── Logging/
│ │ │ └── WritesToConsole.php
│ │ ├── Pipeable.php
│ │ ├── Retrievable.php
│ │ └── Testable.php
│ ├── Configuration/
│ │ ├── Presets.php
│ │ ├── Printer.php
│ │ └── Project.php
│ ├── Configuration.php
│ ├── Console/
│ │ ├── Help.php
│ │ └── Thanks.php
│ ├── Contracts/
│ │ ├── ArchPreset.php
│ │ ├── Bootstrapper.php
│ │ ├── HasPrintableTestCaseName.php
│ │ ├── Panicable.php
│ │ ├── Plugins/
│ │ │ ├── AddsOutput.php
│ │ │ ├── Bootable.php
│ │ │ ├── HandlesArguments.php
│ │ │ ├── HandlesOriginalArguments.php
│ │ │ └── Terminable.php
│ │ ├── TestCaseFilter.php
│ │ └── TestCaseMethodFilter.php
│ ├── Evaluators/
│ │ └── Attributes.php
│ ├── Exceptions/
│ │ ├── AfterAllAlreadyExist.php
│ │ ├── AfterAllWithinDescribe.php
│ │ ├── AfterBeforeTestFunction.php
│ │ ├── BeforeAllAlreadyExist.php
│ │ ├── BeforeAllWithinDescribe.php
│ │ ├── DatasetAlreadyExists.php
│ │ ├── DatasetArgumentsMismatch.php
│ │ ├── DatasetDoesNotExist.php
│ │ ├── DatasetMissing.php
│ │ ├── ExpectationNotFound.php
│ │ ├── FatalException.php
│ │ ├── FileOrFolderNotFound.php
│ │ ├── InvalidArgumentException.php
│ │ ├── InvalidExpectation.php
│ │ ├── InvalidExpectationValue.php
│ │ ├── InvalidOption.php
│ │ ├── InvalidPestCommand.php
│ │ ├── MissingDependency.php
│ │ ├── NoDirtyTestsFound.php
│ │ ├── ShouldNotHappen.php
│ │ ├── TestAlreadyExist.php
│ │ ├── TestCaseAlreadyInUse.php
│ │ ├── TestCaseClassOrTraitNotFound.php
│ │ ├── TestClosureMustNotBeStatic.php
│ │ └── TestDescriptionMissing.php
│ ├── Expectation.php
│ ├── Expectations/
│ │ ├── EachExpectation.php
│ │ ├── HigherOrderExpectation.php
│ │ └── OppositeExpectation.php
│ ├── Factories/
│ │ ├── Attribute.php
│ │ ├── Concerns/
│ │ │ └── HigherOrderable.php
│ │ ├── Covers/
│ │ │ ├── CoversClass.php
│ │ │ └── CoversFunction.php
│ │ ├── TestCaseFactory.php
│ │ └── TestCaseMethodFactory.php
│ ├── Functions.php
│ ├── Installers/
│ │ └── PluginBrowser.php
│ ├── Kernel.php
│ ├── KernelDump.php
│ ├── Logging/
│ │ ├── Converter.php
│ │ └── TeamCity/
│ │ ├── ServiceMessage.php
│ │ ├── Subscriber/
│ │ │ ├── Subscriber.php
│ │ │ ├── TestConsideredRiskySubscriber.php
│ │ │ ├── TestErroredSubscriber.php
│ │ │ ├── TestExecutionFinishedSubscriber.php
│ │ │ ├── TestFailedSubscriber.php
│ │ │ ├── TestFinishedSubscriber.php
│ │ │ ├── TestPreparedSubscriber.php
│ │ │ ├── TestSkippedSubscriber.php
│ │ │ ├── TestSuiteFinishedSubscriber.php
│ │ │ └── TestSuiteStartedSubscriber.php
│ │ └── TeamCityLogger.php
│ ├── Matchers/
│ │ └── Any.php
│ ├── Mixins/
│ │ └── Expectation.php
│ ├── Panic.php
│ ├── PendingCalls/
│ │ ├── AfterEachCall.php
│ │ ├── BeforeEachCall.php
│ │ ├── Concerns/
│ │ │ └── Describable.php
│ │ ├── DescribeCall.php
│ │ ├── TestCall.php
│ │ └── UsesCall.php
│ ├── Pest.php
│ ├── Plugin.php
│ ├── Plugins/
│ │ ├── Actions/
│ │ │ ├── CallsAddsOutput.php
│ │ │ ├── CallsBoot.php
│ │ │ ├── CallsHandleArguments.php
│ │ │ ├── CallsHandleOriginalArguments.php
│ │ │ └── CallsTerminable.php
│ │ ├── Bail.php
│ │ ├── Cache.php
│ │ ├── Concerns/
│ │ │ └── HandleArguments.php
│ │ ├── Configuration.php
│ │ ├── Coverage.php
│ │ ├── Environment.php
│ │ ├── Help.php
│ │ ├── Init.php
│ │ ├── Memory.php
│ │ ├── Only.php
│ │ ├── Parallel/
│ │ │ ├── Contracts/
│ │ │ │ └── HandlersWorkerArguments.php
│ │ │ ├── Handlers/
│ │ │ │ ├── Laravel.php
│ │ │ │ ├── Parallel.php
│ │ │ │ └── Pest.php
│ │ │ ├── Paratest/
│ │ │ │ ├── CleanConsoleOutput.php
│ │ │ │ ├── ResultPrinter.php
│ │ │ │ └── WrapperRunner.php
│ │ │ └── Support/
│ │ │ └── CompactPrinter.php
│ │ ├── Parallel.php
│ │ ├── Printer.php
│ │ ├── ProcessIsolation.php
│ │ ├── Profile.php
│ │ ├── Retry.php
│ │ ├── Shard.php
│ │ ├── Snapshot.php
│ │ ├── Verbose.php
│ │ └── Version.php
│ ├── Preset.php
│ ├── Repositories/
│ │ ├── AfterAllRepository.php
│ │ ├── AfterEachRepository.php
│ │ ├── BeforeAllRepository.php
│ │ ├── BeforeEachRepository.php
│ │ ├── DatasetsRepository.php
│ │ ├── SnapshotRepository.php
│ │ └── TestRepository.php
│ ├── Result.php
│ ├── Runner/
│ │ └── Filter/
│ │ └── EnsureTestCaseIsInitiatedFilter.php
│ ├── Subscribers/
│ │ ├── EnsureConfigurationIsAvailable.php
│ │ ├── EnsureIgnorableTestCasesAreIgnored.php
│ │ ├── EnsureKernelDumpIsFlushed.php
│ │ └── EnsureTeamCityEnabled.php
│ ├── Support/
│ │ ├── Arr.php
│ │ ├── Backtrace.php
│ │ ├── ChainableClosure.php
│ │ ├── Closure.php
│ │ ├── Container.php
│ │ ├── Coverage.php
│ │ ├── DatasetInfo.php
│ │ ├── Description.php
│ │ ├── ExceptionTrace.php
│ │ ├── ExpectationPipeline.php
│ │ ├── Exporter.php
│ │ ├── HigherOrderCallables.php
│ │ ├── HigherOrderMessage.php
│ │ ├── HigherOrderMessageCollection.php
│ │ ├── HigherOrderTapProxy.php
│ │ ├── NullClosure.php
│ │ ├── Reflection.php
│ │ ├── Shell.php
│ │ ├── StateGenerator.php
│ │ ├── Str.php
│ │ └── View.php
│ ├── TestCaseFilters/
│ │ └── GitDirtyTestCaseFilter.php
│ ├── TestCaseMethodFilters/
│ │ ├── AssigneeTestCaseFilter.php
│ │ ├── IssueTestCaseFilter.php
│ │ ├── NotesTestCaseFilter.php
│ │ ├── PrTestCaseFilter.php
│ │ └── TodoTestCaseFilter.php
│ ├── TestCases/
│ │ └── IgnorableTestCase.php
│ └── TestSuite.php
├── stubs/
│ ├── Browser.php
│ ├── Dataset.php
│ ├── Feature.php
│ ├── Unit.php
│ ├── init/
│ │ ├── Feature/
│ │ │ └── ExampleTest.php.stub
│ │ ├── Pest.php.stub
│ │ ├── TestCase.php.stub
│ │ ├── Unit/
│ │ │ └── ExampleTest.php.stub
│ │ └── phpunit.xml.stub
│ └── init-laravel/
│ ├── Feature/
│ │ └── ExampleTest.php.stub
│ ├── Pest.php.stub
│ ├── TestCase.php.stub
│ ├── Unit/
│ │ └── ExampleTest.php.stub
│ └── phpunit.xml.stub
├── tests/
│ ├── .cache/
│ │ └── test-results
│ ├── .pest/
│ │ ├── snapshots/
│ │ │ ├── Features/
│ │ │ │ └── Expect/
│ │ │ │ └── toMatchSnapshot/
│ │ │ │ ├── _describable__→_multiple_snapshot_expectations_with_describe.snap
│ │ │ │ ├── _describable__→_multiple_snapshot_expectations_with_describe__2.snap
│ │ │ │ ├── _within_describe__→_pass_with_dataset_with_data_set____my_datas_set_value___.snap
│ │ │ │ ├── failures.snap
│ │ │ │ ├── failures_with_custom_message.snap
│ │ │ │ ├── multiple_snapshot_expectations.snap
│ │ │ │ ├── multiple_snapshot_expectations__2.snap
│ │ │ │ ├── multiple_snapshot_expectations_with_datasets_with_data_set___1__.snap
│ │ │ │ ├── multiple_snapshot_expectations_with_datasets_with_data_set___1____2.snap
│ │ │ │ ├── multiple_snapshot_expectations_with_datasets_with_data_set____bar___.snap
│ │ │ │ ├── multiple_snapshot_expectations_with_datasets_with_data_set____bar_____2.snap
│ │ │ │ ├── multiple_snapshot_expectations_with_datasets_with_data_set____baz___.snap
│ │ │ │ ├── multiple_snapshot_expectations_with_datasets_with_data_set____baz_____2.snap
│ │ │ │ ├── multiple_snapshot_expectations_with_datasets_with_data_set____foo___.snap
│ │ │ │ ├── multiple_snapshot_expectations_with_datasets_with_data_set____foo_____2.snap
│ │ │ │ ├── multiple_snapshot_expectations_with_repeat_with_data_set___10__.snap
│ │ │ │ ├── multiple_snapshot_expectations_with_repeat_with_data_set___10____2.snap
│ │ │ │ ├── multiple_snapshot_expectations_with_repeat_with_data_set___1__.snap
│ │ │ │ ├── multiple_snapshot_expectations_with_repeat_with_data_set___1____2.snap
│ │ │ │ ├── multiple_snapshot_expectations_with_repeat_with_data_set___2__.snap
│ │ │ │ ├── multiple_snapshot_expectations_with_repeat_with_data_set___2____2.snap
│ │ │ │ ├── multiple_snapshot_expectations_with_repeat_with_data_set___3__.snap
│ │ │ │ ├── multiple_snapshot_expectations_with_repeat_with_data_set___3____2.snap
│ │ │ │ ├── multiple_snapshot_expectations_with_repeat_with_data_set___4__.snap
│ │ │ │ ├── multiple_snapshot_expectations_with_repeat_with_data_set___4____2.snap
│ │ │ │ ├── multiple_snapshot_expectations_with_repeat_with_data_set___5__.snap
│ │ │ │ ├── multiple_snapshot_expectations_with_repeat_with_data_set___5____2.snap
│ │ │ │ ├── multiple_snapshot_expectations_with_repeat_with_data_set___6__.snap
│ │ │ │ ├── multiple_snapshot_expectations_with_repeat_with_data_set___6____2.snap
│ │ │ │ ├── multiple_snapshot_expectations_with_repeat_with_data_set___7__.snap
│ │ │ │ ├── multiple_snapshot_expectations_with_repeat_with_data_set___7____2.snap
│ │ │ │ ├── multiple_snapshot_expectations_with_repeat_with_data_set___8__.snap
│ │ │ │ ├── multiple_snapshot_expectations_with_repeat_with_data_set___8____2.snap
│ │ │ │ ├── multiple_snapshot_expectations_with_repeat_with_data_set___9__.snap
│ │ │ │ ├── multiple_snapshot_expectations_with_repeat_with_data_set___9____2.snap
│ │ │ │ ├── not_failures.snap
│ │ │ │ ├── pass.snap
│ │ │ │ ├── pass_using_pipes.snap
│ │ │ │ ├── pass_with______toString_.snap
│ │ │ │ ├── pass_with__toArray_.snap
│ │ │ │ ├── pass_with__toSnapshot_.snap
│ │ │ │ ├── pass_with__toString_.snap
│ │ │ │ ├── pass_with_array.snap
│ │ │ │ └── pass_with_dataset_with_data_set____my_datas_set_value___.snap
│ │ │ └── Visual/
│ │ │ ├── Collision/
│ │ │ │ └── collision_with_data_set_________.snap
│ │ │ ├── Help/
│ │ │ │ └── visual_snapshot_of_help_command_output.snap
│ │ │ ├── Todo/
│ │ │ │ ├── todo.snap
│ │ │ │ ├── todo_in_parallel.snap
│ │ │ │ ├── todos.snap
│ │ │ │ └── todos_in_parallel.snap
│ │ │ └── Version/
│ │ │ └── visual_snapshot_of_help_command_output.snap
│ │ └── snapshots-external/
│ │ └── Features/
│ │ └── Expect/
│ │ └── toMatchSnapshot/
│ │ ├── _within_describe__→_pass_with_dataset___my_datas_set_value___with_data___my_datas_set_value__.snap
│ │ ├── _within_describe__→_pass_with_dataset_with_data_set_____my_datas_set_value___.snap
│ │ ├── _within_describe__→_pass_with_dataset_with_data_set____my_datas_set_value___.snap
│ │ ├── pass_with_dataset___my_datas_set_value___with_data___my_datas_set_value__.snap
│ │ ├── pass_with_dataset_with_data_set_____my_datas_set_value___.snap
│ │ └── pass_with_dataset_with_data_set____my_datas_set_value___.snap
│ ├── .snapshots/
│ │ ├── Failure.php.inc
│ │ ├── SuccessOnly.php.inc
│ │ ├── allows-to-run-a-directory.txt
│ │ ├── allows-to-run-a-single-test.txt
│ │ ├── disable-decorating-printer.txt
│ │ └── success.txt
│ ├── .tests/
│ │ ├── Failure.php
│ │ └── SuccessOnly.php
│ ├── Arch.php
│ ├── Autoload.php
│ ├── Datasets/
│ │ ├── Bound.php
│ │ └── Numbers.php
│ ├── Environments/
│ │ └── Windows.php
│ ├── Features/
│ │ ├── After.php
│ │ ├── AfterAll.php
│ │ ├── AfterEach.php
│ │ ├── Assignee.php
│ │ ├── BeforeAll.php
│ │ ├── BeforeEach.php
│ │ ├── BeforeEachProxiesToTestCallWithExpectations.php
│ │ ├── BeforeEachProxiesToTestCallWithSkip.php
│ │ ├── BeforeEachProxiesToTestCallWithTodo.php
│ │ ├── Coverage.php
│ │ ├── Covers/
│ │ │ ├── ClassCoverage.php
│ │ │ ├── ExceptionHandling.php
│ │ │ ├── FunctionCoverage.php
│ │ │ ├── GuessCoverage.php
│ │ │ └── TraitCoverage.php
│ │ ├── DatasetsTests.php
│ │ ├── Depends.php
│ │ ├── DependsInheritance.php
│ │ ├── Deprecated.php
│ │ ├── Describe.php
│ │ ├── DescriptionLess.php
│ │ ├── Done.php
│ │ ├── Exceptions.php
│ │ ├── Expect/
│ │ │ ├── HigherOrder/
│ │ │ │ ├── methods.php
│ │ │ │ ├── methodsAndProperties.php
│ │ │ │ └── properties.php
│ │ │ ├── each.php
│ │ │ ├── extend.php
│ │ │ ├── json.php
│ │ │ ├── matchExpectation.php
│ │ │ ├── not.php
│ │ │ ├── pipes.php
│ │ │ ├── ray.php
│ │ │ ├── sequence.php
│ │ │ ├── toBe.php
│ │ │ ├── toBeAlpha.php
│ │ │ ├── toBeAlphaNumeric.php
│ │ │ ├── toBeArray.php
│ │ │ ├── toBeBetween.php
│ │ │ ├── toBeBool.php
│ │ │ ├── toBeCallable.php
│ │ │ ├── toBeCamelCase.php
│ │ │ ├── toBeDigits.php
│ │ │ ├── toBeDirectory.php
│ │ │ ├── toBeEmpty.php
│ │ │ ├── toBeFalse.php
│ │ │ ├── toBeFalsy.php
│ │ │ ├── toBeFile.php
│ │ │ ├── toBeFloat.php
│ │ │ ├── toBeGreaterThan.php
│ │ │ ├── toBeGreaterThanOrEqual.php
│ │ │ ├── toBeIn.php
│ │ │ ├── toBeInfinite.php
│ │ │ ├── toBeInstanceOf.php
│ │ │ ├── toBeInt.php
│ │ │ ├── toBeIntBackedEnum.php
│ │ │ ├── toBeInvokable.php
│ │ │ ├── toBeIterable.php
│ │ │ ├── toBeJson.php
│ │ │ ├── toBeKebabCase.php
│ │ │ ├── toBeLessThan.php
│ │ │ ├── toBeLessThanOrEqual.php
│ │ │ ├── toBeList.php
│ │ │ ├── toBeLowercase.php
│ │ │ ├── toBeNAN.php
│ │ │ ├── toBeNull.php
│ │ │ ├── toBeNumeric.php
│ │ │ ├── toBeObject.php
│ │ │ ├── toBeReadableDirectory.php
│ │ │ ├── toBeReadableFile.php
│ │ │ ├── toBeResource.php
│ │ │ ├── toBeScalar.php
│ │ │ ├── toBeSlug.php
│ │ │ ├── toBeSnakeCase.php
│ │ │ ├── toBeString.php
│ │ │ ├── toBeStringBackedEnum.php
│ │ │ ├── toBeStudlyCase.php
│ │ │ ├── toBeTrue.php
│ │ │ ├── toBeTruthy.php
│ │ │ ├── toBeUppercase.php
│ │ │ ├── toBeUrl.php
│ │ │ ├── toBeUuid.php
│ │ │ ├── toBeWritableDirectory.php
│ │ │ ├── toBeWritableFile.php
│ │ │ ├── toContain.php
│ │ │ ├── toContainEqual.php
│ │ │ ├── toContainOnlyInstancesOf.php
│ │ │ ├── toEndWith.php
│ │ │ ├── toEqual.php
│ │ │ ├── toEqualCanonicalizing.php
│ │ │ ├── toEqualWithDelta.php
│ │ │ ├── toHaveAttribute.php
│ │ │ ├── toHaveCamelCaseKeys.php
│ │ │ ├── toHaveConstructor.php
│ │ │ ├── toHaveCount.php
│ │ │ ├── toHaveDestructor.php
│ │ │ ├── toHaveFileSystemPermissions.php
│ │ │ ├── toHaveKebabCaseKeys.php
│ │ │ ├── toHaveKey.php
│ │ │ ├── toHaveKeys.php
│ │ │ ├── toHaveLength.php
│ │ │ ├── toHaveLineCountLessThan.php
│ │ │ ├── toHaveMethod.php
│ │ │ ├── toHaveMethods.php
│ │ │ ├── toHaveMethodsDocumented.php
│ │ │ ├── toHavePrefix.php
│ │ │ ├── toHavePrivateMethodsBesides.php
│ │ │ ├── toHaveProperties.php
│ │ │ ├── toHavePropertiesDocumented.php
│ │ │ ├── toHaveProperty.php
│ │ │ ├── toHaveProtectedMethodsBesides.php
│ │ │ ├── toHavePublicMethodsBesides.php
│ │ │ ├── toHaveSameSize.php
│ │ │ ├── toHaveSnakeCaseKeys.php
│ │ │ ├── toHaveStudlyCaseKeys.php
│ │ │ ├── toHaveSuffix.php
│ │ │ ├── toMatch.php
│ │ │ ├── toMatchArray.php
│ │ │ ├── toMatchConstraint.php
│ │ │ ├── toMatchObject.php
│ │ │ ├── toMatchSnapshot.php
│ │ │ ├── toStartWith.php
│ │ │ ├── toThrow.php
│ │ │ ├── toUseStrictEquality.php
│ │ │ ├── toUseStrictTypes.php
│ │ │ ├── toUseTrait.php
│ │ │ ├── unless.php
│ │ │ └── when.php
│ │ ├── Fail.php
│ │ ├── Fails.php
│ │ ├── Fixture.php
│ │ ├── Helpers.php
│ │ ├── HigherOrderTests.php
│ │ ├── Incompleted.php
│ │ ├── Issue.php
│ │ ├── It.php
│ │ ├── Note.php
│ │ ├── Notices.php
│ │ ├── Pr.php
│ │ ├── References.php
│ │ ├── Repeat.php
│ │ ├── ScopedDatasets/
│ │ │ ├── Directory/
│ │ │ │ ├── Datasets/
│ │ │ │ │ └── Scoped.php
│ │ │ │ ├── NestedDirectory1/
│ │ │ │ │ ├── Datasets.php
│ │ │ │ │ └── TestFileInNestedDirectoryWithDatasetsFile.php
│ │ │ │ ├── NestedDirectory2/
│ │ │ │ │ └── TestFileInNestedDirectory.php
│ │ │ │ ├── TestFileWithLocallyDefinedDataset.php
│ │ │ │ └── TestFileWithScopedDataset.php
│ │ │ └── TestFileOutOfScope.php
│ │ ├── See.php
│ │ ├── Skip.php
│ │ ├── SkipOnPhp.php
│ │ ├── Test.php
│ │ ├── TestCycle.php
│ │ ├── ThrowsNoExceptions.php
│ │ ├── Ticket.php
│ │ ├── Todo.php
│ │ ├── Warnings.php
│ │ └── Wip.php
│ ├── Fixtures/
│ │ ├── Arch/
│ │ │ ├── ToBeIntBackedEnum/
│ │ │ │ ├── HasIntBacking/
│ │ │ │ │ └── HasIntBackingEnum.php
│ │ │ │ └── HasStringBacking/
│ │ │ │ └── HasStringBackingEnum.php
│ │ │ ├── ToBeInvokable/
│ │ │ │ ├── IsInvokable/
│ │ │ │ │ ├── InvokableClass.php
│ │ │ │ │ ├── InvokableClassViaParent.php
│ │ │ │ │ ├── InvokableClassViaTrait.php
│ │ │ │ │ ├── InvokableTrait.php
│ │ │ │ │ └── ParentInvokableClass.php
│ │ │ │ └── IsNotInvokable/
│ │ │ │ └── IsNotInvokableClass.php
│ │ │ ├── ToBeStringBackedEnum/
│ │ │ │ ├── HasIntBacking/
│ │ │ │ │ └── HasIntBackingEnum.php
│ │ │ │ └── HasStringBacking/
│ │ │ │ └── HasStringBackingEnum.php
│ │ │ ├── ToHaveAttribute/
│ │ │ │ ├── Attributes/
│ │ │ │ │ └── AsAttribute.php
│ │ │ │ ├── HaveAttribute/
│ │ │ │ │ └── HaveAttributeClass.php
│ │ │ │ └── NotHaveAttribute/
│ │ │ │ └── NotHaveAttributeClass.php
│ │ │ ├── ToHaveConstructor/
│ │ │ │ ├── HasConstructor/
│ │ │ │ │ └── HasConstructor.php
│ │ │ │ └── HasNoConstructor/
│ │ │ │ └── HasNoConstructor.php
│ │ │ ├── ToHaveDestructor/
│ │ │ │ ├── HasDestructor/
│ │ │ │ │ └── HasDestructor.php
│ │ │ │ └── HasNoDestructor/
│ │ │ │ └── HasNoDestructor.php
│ │ │ ├── ToHaveMethod/
│ │ │ │ ├── HasMethod/
│ │ │ │ │ ├── HasMethod.php
│ │ │ │ │ ├── HasMethodTrait.php
│ │ │ │ │ ├── HasMethodViaParent.php
│ │ │ │ │ ├── HasMethodViaTrait.php
│ │ │ │ │ └── ParentHasMethodClass.php
│ │ │ │ └── HasNoMethod/
│ │ │ │ └── HasNoMethodClass.php
│ │ │ ├── ToHavePrefix/
│ │ │ │ ├── HasNoPrefix/
│ │ │ │ │ └── ClassWithout.php
│ │ │ │ └── HasPrefix/
│ │ │ │ └── PrefixClassWith.php
│ │ │ ├── ToHavePublicMethodsBesides/
│ │ │ │ └── UserController.php
│ │ │ ├── ToHaveSuffix/
│ │ │ │ ├── HasNoSuffix/
│ │ │ │ │ └── ClassWithout.php
│ │ │ │ └── HasSuffix/
│ │ │ │ └── ClassWithSuffix.php
│ │ │ ├── ToUseStrictEquality/
│ │ │ │ ├── NotStrictEquality.php
│ │ │ │ └── StrictEquality.php
│ │ │ └── ToUseStrictTypes/
│ │ │ ├── HasNoStrictType.php
│ │ │ ├── HasStrictType.php
│ │ │ └── HasStrictTypeWithCommentsAbove.php
│ │ ├── CollisionTest.php
│ │ ├── Covers/
│ │ │ ├── CoversClass1.php
│ │ │ ├── CoversClass2.php
│ │ │ ├── CoversClass3.php
│ │ │ └── CoversTrait.php
│ │ ├── DirectoryWithTests/
│ │ │ └── ExampleTest.php
│ │ ├── ExampleTest.php
│ │ ├── Inheritance/
│ │ │ ├── Base/
│ │ │ │ └── ExampleTest.php
│ │ │ └── ExampleTest.php
│ │ ├── UnexpectedOutput.php
│ │ ├── phpunit-in-isolation.xml
│ │ └── phpunit-not-in-isolation.xml
│ ├── Helpers/
│ │ ├── Helper.php
│ │ └── TestInHelpers.php
│ ├── Helpers.php
│ ├── Hooks/
│ │ ├── AfterEachTest.php
│ │ ├── BeforeAllTest.php
│ │ └── BeforeEachTest.php
│ ├── PHPUnit/
│ │ ├── CustomAffixes/
│ │ │ ├── @#$%^&()-_=+.php
│ │ │ ├── A Test With Spaces.php
│ │ │ ├── AdditionalFileExtension.spec.php
│ │ │ ├── FolderWithAn@/
│ │ │ │ └── ExampleTest.php
│ │ │ ├── ManyExtensions.class.test.php
│ │ │ ├── Test 'Case' With Quotes.php
│ │ │ ├── kebab-case-spec.php
│ │ │ └── snake_case_spec.php
│ │ ├── CustomTestCase/
│ │ │ ├── ChildTest.php
│ │ │ ├── CustomTestCase.php
│ │ │ ├── ExecutedTest.php
│ │ │ ├── ParentTest.php
│ │ │ └── UsesPerDirectory.php
│ │ ├── CustomTestCaseInSubFolders/
│ │ │ ├── SubFolder/
│ │ │ │ └── SubFolder/
│ │ │ │ ├── CustomTestCaseInSubFolder.php
│ │ │ │ └── UsesPerSubDirectory.php
│ │ │ └── SubFolder2/
│ │ │ └── UsesPerFile.php
│ │ ├── GlobPatternTests/
│ │ │ ├── SubFolder/
│ │ │ │ └── InnerFolder/
│ │ │ │ └── UsesPerDirectoryAsPattern.php
│ │ │ └── SubFolder2/
│ │ │ └── UsesPerFileAsPattern.php
│ │ └── IgnorableTest.php
│ ├── Pest.php
│ ├── Playground.php
│ ├── Plugins/
│ │ ├── Coverage.php
│ │ └── Traits.php
│ ├── Unit/
│ │ ├── Configuration/
│ │ │ ├── In.php
│ │ │ └── Theme.php
│ │ ├── Console/
│ │ │ └── Help.php
│ │ ├── DatasetsTests.php
│ │ ├── Expectations/
│ │ │ └── OppositeExpectation.php
│ │ ├── Overrides/
│ │ │ └── ThrowableBuilder.php
│ │ ├── Plugins/
│ │ │ ├── Concerns/
│ │ │ │ └── HandleArguments.php
│ │ │ ├── Environment.php
│ │ │ └── Retry.php
│ │ ├── Preset.php
│ │ ├── Support/
│ │ │ ├── Arr.php
│ │ │ ├── Backtrace.php
│ │ │ ├── Container.php
│ │ │ ├── DatasetInfo.php
│ │ │ ├── ExceptionTrace.php
│ │ │ ├── HigherOrderMessage.php
│ │ │ ├── Reflection.php
│ │ │ └── Str.php
│ │ ├── TestName.php
│ │ └── TestSuite.php
│ └── Visual/
│ ├── BeforeEachTestName.php
│ ├── Collision.php
│ ├── Help.php
│ ├── JUnit.php
│ ├── Parallel.php
│ ├── SingleTestOrDirectory.php
│ ├── Success.php
│ ├── TeamCity.php
│ ├── Todo.php
│ └── Version.php
└── tests-external/
└── Features/
└── Expect/
└── toMatchSnapshot.php
SYMBOL INDEX (1136 symbols across 250 files)
FILE: overrides/Event/Value/ThrowableBuilder.php
class ThrowableBuilder (line 59) | final readonly class ThrowableBuilder
method from (line 65) | public static function from(\Throwable $t): Throwable
FILE: overrides/Logging/JUnit/JunitXmlLogger.php
class JunitXmlLogger (line 52) | final class JunitXmlLogger
method __construct (line 111) | public function __construct(Printer $printer, Facade $facade)
method flush (line 120) | public function flush(): void
method testSuiteStarted (line 127) | public function testSuiteStarted(Started $event): void
method testSuiteFinished (line 152) | public function testSuiteFinished(): void
method testPreparationStarted (line 199) | public function testPreparationStarted(PreparationStarted $event): void
method testPreparationFailed (line 204) | public function testPreparationFailed(): void
method testPrepared (line 209) | public function testPrepared(): void
method testPrintedUnexpectedOutput (line 214) | public function testPrintedUnexpectedOutput(PrintedUnexpectedOutput $e...
method testFinished (line 229) | public function testFinished(Finished $event): void
method testMarkedIncomplete (line 241) | public function testMarkedIncomplete(MarkedIncomplete $event): void
method testSkipped (line 249) | public function testSkipped(Skipped $event): void
method testErrored (line 257) | public function testErrored(Errored $event): void
method testFailed (line 267) | public function testFailed(Failed $event): void
method handleFinish (line 277) | private function handleFinish(Info $telemetryInfo, int $numberOfAssert...
method registerSubscribers (line 312) | private function registerSubscribers(Facade $facade): void
method createDocument (line 330) | private function createDocument(): void
method handleFault (line 342) | private function handleFault(Errored|Failed $event, string $type): void
method handleIncompleteOrSkipped (line 375) | private function handleIncompleteOrSkipped(MarkedIncomplete|Skipped $e...
method testAsString (line 397) | private function testAsString(Test $test): string
method name (line 416) | private function name(Test $test): string
method createTestCase (line 450) | private function createTestCase(Errored|Failed|MarkedIncomplete|Prepar...
FILE: overrides/Runner/Filter/NameFilterIterator.php
class NameFilterIterator (line 63) | abstract class NameFilterIterator extends RecursiveFilterIterator
method __construct (line 78) | public function __construct(RecursiveIterator $iterator, string $filter)
method accept (line 89) | public function accept(): bool
method doAccept (line 119) | abstract protected function doAccept(bool $result): bool;
method prepareFilter (line 126) | private function prepareFilter(string $filter): array
FILE: overrides/Runner/ResultCache/DefaultResultCache.php
class DefaultResultCache (line 73) | final class DefaultResultCache implements ResultCache
method __construct (line 89) | public function __construct(?string $filepath = null)
method setStatus (line 98) | public function setStatus(ResultCacheId $id, TestStatus $status): void
method status (line 107) | public function status(ResultCacheId $id): TestStatus
method setTime (line 112) | public function setTime(ResultCacheId $id, float $time): void
method time (line 117) | public function time(ResultCacheId $id): float
method mergeWith (line 122) | public function mergeWith(self $other): void
method load (line 133) | public function load(): void
method persist (line 176) | public function persist(): void
method cacheVersion (line 202) | private function cacheVersion(): string
FILE: overrides/Runner/TestSuiteLoader.php
class TestSuiteLoader (line 59) | final class TestSuiteLoader
method __construct (line 76) | public function __construct()
method load (line 86) | public function load(string $suiteClassFile): ReflectionClass
method reload (line 206) | public function reload(ReflectionClass $aClass): ReflectionClass
method classNameFromFileName (line 211) | private function classNameFromFileName(string $suiteClassFile): string
method exceptionFor (line 223) | private function exceptionFor(string $className, string $filename): Re...
FILE: overrides/TextUI/Command/Commands/WarmCodeCoverageCacheCommand.php
class WarmCodeCoverageCacheCommand (line 60) | final readonly class WarmCodeCoverageCacheCommand implements Command
method __construct (line 66) | public function __construct(Configuration $configuration, CodeCoverage...
method execute (line 76) | public function execute(): Result
FILE: overrides/TextUI/Output/Default/ProgressPrinter/Subscriber/TestSkippedSubscriber.php
class TestSkippedSubscriber (line 55) | final class TestSkippedSubscriber extends Subscriber implements SkippedS...
method notify (line 57) | public function notify(Skipped $event): void
method printTodoItem (line 69) | private function printTodoItem(): void
FILE: overrides/TextUI/TestSuiteFilterProcessor.php
class TestSuiteFilterProcessor (line 60) | final readonly class TestSuiteFilterProcessor
method process (line 66) | public function process(Configuration $configuration, TestSuite $suite...
FILE: src/ArchPresets/AbstractPreset.php
class AbstractPreset (line 13) | abstract class AbstractPreset // @pest-arch-ignore-line
method __construct (line 27) | public function __construct(
method execute (line 38) | abstract public function execute(): void;
method ignoring (line 45) | final public function ignoring(array|string $targetsOrDependencies): void
method eachUserNamespace (line 58) | final public function eachUserNamespace(callable ...$callbacks): void
method flush (line 70) | final public function flush(): void
FILE: src/ArchPresets/Custom.php
class Custom (line 14) | final class Custom extends AbstractPreset
method __construct (line 22) | public function __construct(
method name (line 33) | public function name(): string
method execute (line 41) | public function execute(): void
FILE: src/ArchPresets/Laravel.php
class Laravel (line 12) | final class Laravel extends AbstractPreset
method execute (line 17) | public function execute(): void
FILE: src/ArchPresets/Php.php
class Php (line 10) | final class Php extends AbstractPreset
method execute (line 15) | public function execute(): void
FILE: src/ArchPresets/Relaxed.php
class Relaxed (line 13) | final class Relaxed extends AbstractPreset
method execute (line 18) | public function execute(): void
FILE: src/ArchPresets/Security.php
class Security (line 10) | final class Security extends AbstractPreset
method execute (line 15) | public function execute(): void
FILE: src/ArchPresets/Strict.php
class Strict (line 13) | final class Strict extends AbstractPreset
method execute (line 18) | public function execute(): void
FILE: src/Bootstrappers/BootExcludeList.php
class BootExcludeList (line 13) | final class BootExcludeList implements Bootstrapper
method boot (line 31) | public function boot(): void
FILE: src/Bootstrappers/BootFiles.php
class BootFiles (line 21) | final class BootFiles implements Bootstrapper
method boot (line 39) | public function boot(): void
method load (line 73) | private function load(string $filename): void
method bootDatasets (line 84) | private function bootDatasets(string $testsPath): void
FILE: src/Bootstrappers/BootKernelDump.php
class BootKernelDump (line 15) | final readonly class BootKernelDump implements Bootstrapper
method __construct (line 20) | public function __construct(
method boot (line 29) | public function boot(): void
FILE: src/Bootstrappers/BootOverrides.php
class BootOverrides (line 13) | final class BootOverrides implements Bootstrapper
method boot (line 34) | public function boot(): void
FILE: src/Bootstrappers/BootSubscribers.php
class BootSubscribers (line 16) | final readonly class BootSubscribers implements Bootstrapper
method __construct (line 33) | public function __construct(
method boot (line 40) | public function boot(): void
FILE: src/Bootstrappers/BootView.php
class BootView (line 14) | final readonly class BootView implements Bootstrapper
method __construct (line 19) | public function __construct(
method boot (line 28) | public function boot(): void
FILE: src/Collision/Events.php
class Events (line 17) | final class Events
method setOutput (line 27) | public static function setOutput(OutputInterface $output): void
method beforeTestMethodDescription (line 35) | public static function beforeTestMethodDescription(TestResult $result,...
method afterTestMethodDescription (line 79) | public static function afterTestMethodDescription(TestResult $result):...
FILE: src/Concerns/Expectable.php
type Expectable (line 12) | trait Expectable
method expect (line 22) | public function expect(mixed $value): Expectation
FILE: src/Concerns/Extendable.php
type Extendable (line 14) | trait Extendable
method extend (line 28) | public function extend(string $name, Closure $extend): void
method hasExtend (line 36) | public static function hasExtend(string $name): bool
FILE: src/Concerns/Logging/WritesToConsole.php
type WritesToConsole (line 10) | trait WritesToConsole
method writeSuccess (line 15) | private function writeSuccess(string $message): void
method writeError (line 23) | private function writeError(string $message): void
method writeWarning (line 31) | private function writeWarning(string $message): void
method writePestTestOutput (line 39) | private function writePestTestOutput(string $message, string $color, s...
FILE: src/Concerns/Pipeable.php
type Pipeable (line 12) | trait Pipeable
method pipe (line 31) | public function pipe(string $name, Closure $pipe): void
method intercept (line 41) | public function intercept(string $name, string|Closure $filter, Closur...
method pipes (line 67) | private function pipes(string $name, object $context, string $scope): ...
FILE: src/Concerns/Retrievable.php
type Retrievable (line 10) | trait Retrievable
method retrieve (line 22) | private function retrieve(string $key, mixed $value, mixed $default = ...
FILE: src/Concerns/Testable.php
type Testable (line 28) | trait Testable
method flush (line 109) | public static function flush(): void
method note (line 118) | public function note(array|string $note): self
method __addBeforeAll (line 130) | public function __addBeforeAll(?Closure $hook): void
method __addAfterAll (line 144) | public function __addAfterAll(?Closure $hook): void
method __addBeforeEach (line 158) | public function __addBeforeEach(?Closure $hook): void
method __addAfterEach (line 166) | public function __addAfterEach(?Closure $hook): void
method __addHook (line 174) | private function __addHook(string $property, ?Closure $hook): void
method setUpBeforeClass (line 188) | public static function setUpBeforeClass(): void
method tearDownAfterClass (line 208) | public static function tearDownAfterClass(): void
method setUp (line 224) | protected function setUp(...$arguments): void
method __initializeTestCase (line 274) | public function __initializeTestCase(): void
method tearDown (line 301) | protected function tearDown(...$arguments): void
method __runTest (line 326) | private function __runTest(Closure $closure, ...$args): mixed
method __resolveTestArguments (line 339) | private function __resolveTestArguments(array $arguments): array
method __ensureDatasetArgumentNameAndNumberMatches (line 396) | private function __ensureDatasetArgumentNameAndNumberMatches(array $ar...
method __callClosure (line 427) | private function __callClosure(Closure $closure, array $arguments): mixed
method preset (line 435) | public function preset(): Preset
method __MarkTestIncompleteIfSnapshotHaveChanged (line 440) | #[PostCondition]
method getPrintableTestCaseName (line 453) | public static function getPrintableTestCaseName(): string
method getPrintableTestCaseMethodName (line 461) | public function getPrintableTestCaseMethodName(): string
method getLatestPrintableTestCaseMethodName (line 469) | public static function getLatestPrintableTestCaseMethodName(): string
method getPrintableContext (line 477) | public static function getPrintableContext(): array
method shell (line 490) | public function shell(): void
FILE: src/Configuration.php
class Configuration (line 15) | final readonly class Configuration
method __construct (line 25) | public function __construct(
method in (line 34) | public function in(string ...$targets): UsesCall
method extend (line 42) | public function extend(string ...$classAndTraits): UsesCall
method extends (line 53) | public function extends(string ...$classAndTraits): UsesCall
method group (line 61) | public function group(string ...$groups): UsesCall
method only (line 69) | public function only(): void
method use (line 77) | public function use(string ...$classAndTraits): UsesCall
method uses (line 85) | public function uses(string ...$classAndTraits): UsesCall
method printer (line 93) | public function printer(): Configuration\Printer
method presets (line 101) | public function presets(): Configuration\Presets
method project (line 109) | public function project(): Configuration\Project
method browser (line 117) | public function browser(): Browser\Configuration
method __call (line 127) | public function __call(string $name, array $arguments): mixed
FILE: src/Configuration/Presets.php
class Presets (line 10) | final class Presets
method custom (line 15) | public function custom(string $name, Closure $execute): void
FILE: src/Configuration/Printer.php
class Printer (line 12) | final readonly class Printer
method compact (line 17) | public function compact(): self
FILE: src/Configuration/Project.php
class Project (line 10) | final class Project
method getInstance (line 41) | public static function getInstance(): self
method github (line 49) | public function github(string $project): self
method gitlab (line 62) | public function gitlab(string $project): self
method bitbucket (line 75) | public function bitbucket(string $project): self
method jira (line 88) | public function jira(string $namespace, string $project): self
method custom (line 100) | public function custom(string $issues, string $prs, string $assignees)...
FILE: src/Console/Help.php
class Help (line 12) | final readonly class Help
method __construct (line 30) | public function __construct(private OutputInterface $output)
method __invoke (line 38) | public function __invoke(): void
FILE: src/Console/Thanks.php
class Thanks (line 18) | final readonly class Thanks
method __construct (line 39) | public function __construct(
method __invoke (line 49) | public function __invoke(): void
FILE: src/Contracts/ArchPreset.php
type ArchPreset (line 10) | interface ArchPreset {}
FILE: src/Contracts/Bootstrapper.php
type Bootstrapper (line 10) | interface Bootstrapper
method boot (line 15) | public function boot(): void;
FILE: src/Contracts/HasPrintableTestCaseName.php
type HasPrintableTestCaseName (line 12) | interface HasPrintableTestCaseName extends BaseHasPrintableTestCaseName
FILE: src/Contracts/Panicable.php
type Panicable (line 12) | interface Panicable
method render (line 17) | public function render(OutputInterface $output): void;
method exitCode (line 22) | public function exitCode(): int;
FILE: src/Contracts/Plugins/AddsOutput.php
type AddsOutput (line 10) | interface AddsOutput
method addOutput (line 15) | public function addOutput(int $exitCode): int;
FILE: src/Contracts/Plugins/Bootable.php
type Bootable (line 10) | interface Bootable
method boot (line 15) | public function boot(): void;
FILE: src/Contracts/Plugins/HandlesArguments.php
type HandlesArguments (line 10) | interface HandlesArguments
method handleArguments (line 18) | public function handleArguments(array $arguments): array;
FILE: src/Contracts/Plugins/HandlesOriginalArguments.php
type HandlesOriginalArguments (line 10) | interface HandlesOriginalArguments
method handleOriginalArguments (line 17) | public function handleOriginalArguments(array $arguments): void;
FILE: src/Contracts/Plugins/Terminable.php
type Terminable (line 10) | interface Terminable
method terminate (line 15) | public function terminate(): void;
FILE: src/Contracts/TestCaseFilter.php
type TestCaseFilter (line 7) | interface TestCaseFilter
method accept (line 12) | public function accept(string $testCaseFilename): bool;
FILE: src/Contracts/TestCaseMethodFilter.php
type TestCaseMethodFilter (line 9) | interface TestCaseMethodFilter
method accept (line 14) | public function accept(TestCaseMethodFactory $factory): bool;
FILE: src/Evaluators/Attributes.php
class Attributes (line 12) | final class Attributes
method code (line 19) | public static function code(iterable $attributes): string
FILE: src/Exceptions/AfterAllAlreadyExist.php
class AfterAllAlreadyExist (line 15) | final class AfterAllAlreadyExist extends InvalidArgumentException implem...
method __construct (line 20) | public function __construct(string $filename)
FILE: src/Exceptions/AfterAllWithinDescribe.php
class AfterAllWithinDescribe (line 15) | final class AfterAllWithinDescribe extends InvalidArgumentException impl...
method __construct (line 20) | public function __construct(string $filename)
FILE: src/Exceptions/AfterBeforeTestFunction.php
class AfterBeforeTestFunction (line 15) | final class AfterBeforeTestFunction extends InvalidArgumentException imp...
method __construct (line 20) | public function __construct(string $filename)
FILE: src/Exceptions/BeforeAllAlreadyExist.php
class BeforeAllAlreadyExist (line 15) | final class BeforeAllAlreadyExist extends InvalidArgumentException imple...
method __construct (line 20) | public function __construct(string $filename)
FILE: src/Exceptions/BeforeAllWithinDescribe.php
class BeforeAllWithinDescribe (line 15) | final class BeforeAllWithinDescribe extends InvalidArgumentException imp...
method __construct (line 20) | public function __construct(string $filename)
FILE: src/Exceptions/DatasetAlreadyExists.php
class DatasetAlreadyExists (line 15) | final class DatasetAlreadyExists extends InvalidArgumentException implem...
method __construct (line 20) | public function __construct(string $name, string $scope)
FILE: src/Exceptions/DatasetArgumentsMismatch.php
class DatasetArgumentsMismatch (line 9) | final class DatasetArgumentsMismatch extends Exception
method __construct (line 11) | public function __construct(int $requiredCount, int $suppliedCount)
FILE: src/Exceptions/DatasetDoesNotExist.php
class DatasetDoesNotExist (line 15) | final class DatasetDoesNotExist extends InvalidArgumentException impleme...
method __construct (line 20) | public function __construct(string $name)
FILE: src/Exceptions/DatasetMissing.php
class DatasetMissing (line 15) | final class DatasetMissing extends BadFunctionCallException implements E...
method __construct (line 22) | public function __construct(string $file, string $name, array $arguments)
FILE: src/Exceptions/ExpectationNotFound.php
class ExpectationNotFound (line 12) | final class ExpectationNotFound extends Exception
method fromName (line 17) | public static function fromName(string $name): ExpectationNotFound
FILE: src/Exceptions/FatalException.php
class FatalException (line 13) | final class FatalException extends RuntimeException implements Renderles...
FILE: src/Exceptions/FileOrFolderNotFound.php
class FileOrFolderNotFound (line 15) | final class FileOrFolderNotFound extends InvalidArgumentException implem...
method __construct (line 20) | public function __construct(string $filename)
FILE: src/Exceptions/InvalidArgumentException.php
class InvalidArgumentException (line 15) | final class InvalidArgumentException extends BaseInvalidArgumentExceptio...
method __construct (line 20) | public function __construct(string $message)
FILE: src/Exceptions/InvalidExpectation.php
class InvalidExpectation (line 15) | final class InvalidExpectation extends LogicException implements Excepti...
method fromMethods (line 22) | public static function fromMethods(array $methods): never
FILE: src/Exceptions/InvalidExpectationValue.php
class InvalidExpectationValue (line 12) | final class InvalidExpectationValue extends InvalidArgumentException
method expected (line 17) | public static function expected(string $type): never
FILE: src/Exceptions/InvalidOption.php
class InvalidOption (line 15) | final class InvalidOption extends InvalidArgumentException implements Ex...
method __construct (line 20) | public function __construct(string $message)
FILE: src/Exceptions/InvalidPestCommand.php
class InvalidPestCommand (line 15) | final class InvalidPestCommand extends InvalidArgumentException implemen...
method __construct (line 20) | public function __construct()
FILE: src/Exceptions/MissingDependency.php
class MissingDependency (line 15) | final class MissingDependency extends InvalidArgumentException implement...
method __construct (line 20) | public function __construct(string $feature, string $dependency)
FILE: src/Exceptions/NoDirtyTestsFound.php
class NoDirtyTestsFound (line 17) | final class NoDirtyTestsFound extends InvalidArgumentException implement...
method render (line 22) | public function render(OutputInterface $output): void
method exitCode (line 34) | public function exitCode(): int
FILE: src/Exceptions/ShouldNotHappen.php
class ShouldNotHappen (line 13) | final class ShouldNotHappen extends RuntimeException
method __construct (line 18) | public function __construct(Exception $exception)
method fromMessage (line 35) | public static function fromMessage(string $message): ShouldNotHappen
FILE: src/Exceptions/TestAlreadyExist.php
class TestAlreadyExist (line 15) | final class TestAlreadyExist extends InvalidArgumentException implements...
method __construct (line 20) | public function __construct(string $fileName, string $description)
FILE: src/Exceptions/TestCaseAlreadyInUse.php
class TestCaseAlreadyInUse (line 15) | final class TestCaseAlreadyInUse extends InvalidArgumentException implem...
method __construct (line 20) | public function __construct(string $inUse, string $newOne, string $fol...
FILE: src/Exceptions/TestCaseClassOrTraitNotFound.php
class TestCaseClassOrTraitNotFound (line 15) | final class TestCaseClassOrTraitNotFound extends InvalidArgumentExceptio...
method __construct (line 20) | public function __construct(string $testCaseClass)
FILE: src/Exceptions/TestClosureMustNotBeStatic.php
class TestClosureMustNotBeStatic (line 16) | final class TestClosureMustNotBeStatic extends InvalidArgumentException ...
method __construct (line 21) | public function __construct(TestCaseMethodFactory $method)
FILE: src/Exceptions/TestDescriptionMissing.php
class TestDescriptionMissing (line 15) | final class TestDescriptionMissing extends InvalidArgumentException impl...
method __construct (line 20) | public function __construct(string $fileName)
FILE: src/Expectation.php
class Expectation (line 53) | final class Expectation
method __construct (line 66) | public function __construct(
method and (line 80) | public function and(mixed $value): Expectation
method json (line 90) | public function json(): Expectation
method dump (line 109) | public function dump(mixed ...$arguments): self
method dd (line 125) | public function dd(mixed ...$arguments): void
method ddWhen (line 142) | public function ddWhen(Closure|bool $condition, mixed ...$arguments): ...
method ddUnless (line 159) | public function ddUnless(Closure|bool $condition, mixed ...$arguments)...
method ray (line 175) | public function ray(mixed ...$arguments): self
method not (line 189) | public function not(): OppositeExpectation
method each (line 199) | public function each(?callable $callback = null): EachExpectation
method sequence (line 222) | public function sequence(mixed ...$callbacks): self
method match (line 262) | public function match(mixed $subject, array $expressions): self
method unless (line 300) | public function unless(callable|bool $condition, callable $callback): ...
method when (line 316) | public function when(callable|bool $condition, callable $callback): self
method __call (line 335) | public function __call(string $method, array $parameters): Expectation...
method getExpectationClosure (line 379) | private function getExpectationClosure(string $name): Closure
method __get (line 402) | public function __get(string $name): mixed
method hasMethod (line 421) | public static function hasMethod(string $name): bool
method any (line 431) | public function any(): Any
method toUse (line 441) | public function toUse(array|string $targets): ArchExpectation
method toHaveFileSystemPermissions (line 449) | public function toHaveFileSystemPermissions(string $permissions): Arch...
method toHaveLineCountLessThan (line 462) | public function toHaveLineCountLessThan(int $lines): ArchExpectation
method toHaveMethodsDocumented (line 475) | public function toHaveMethodsDocumented(): ArchExpectation
method toHavePropertiesDocumented (line 494) | public function toHavePropertiesDocumented(): ArchExpectation
method toUseStrictTypes (line 514) | public function toUseStrictTypes(): ArchExpectation
method toUseStrictEquality (line 527) | public function toUseStrictEquality(): ArchExpectation
method toBeFinal (line 540) | public function toBeFinal(): ArchExpectation
method toBeReadonly (line 553) | public function toBeReadonly(): ArchExpectation
method toBeTrait (line 566) | public function toBeTrait(): ArchExpectation
method toBeTraits (line 579) | public function toBeTraits(): ArchExpectation
method toBeAbstract (line 587) | public function toBeAbstract(): ArchExpectation
method toHaveMethod (line 602) | public function toHaveMethod(array|string $method): ArchExpectation
method toHaveMethods (line 619) | public function toHaveMethods(array $methods): ArchExpectation
method toHavePublicMethodsBesides (line 627) | public function toHavePublicMethodsBesides(): void
method toHavePublicMethods (line 635) | public function toHavePublicMethods(): void
method toHaveProtectedMethodsBesides (line 643) | public function toHaveProtectedMethodsBesides(): void
method toHaveProtectedMethods (line 651) | public function toHaveProtectedMethods(): void
method toHavePrivateMethodsBesides (line 659) | public function toHavePrivateMethodsBesides(): void
method toHavePrivateMethods (line 667) | public function toHavePrivateMethods(): void
method toBeEnum (line 675) | public function toBeEnum(): ArchExpectation
method toBeEnums (line 688) | public function toBeEnums(): ArchExpectation
method toBeClass (line 696) | public function toBeClass(): ArchExpectation
method toBeClasses (line 709) | public function toBeClasses(): ArchExpectation
method toBeInterface (line 717) | public function toBeInterface(): ArchExpectation
method toBeInterfaces (line 730) | public function toBeInterfaces(): ArchExpectation
method toExtend (line 738) | public function toExtend(string $class): ArchExpectation
method toExtendNothing (line 751) | public function toExtendNothing(): ArchExpectation
method toUseTrait (line 764) | public function toUseTrait(string $trait): ArchExpectation
method toUseTraits (line 774) | public function toUseTraits(array|string $traits): ArchExpectation
method toImplementNothing (line 801) | public function toImplementNothing(): ArchExpectation
method toOnlyImplement (line 816) | public function toOnlyImplement(array|string $interfaces): ArchExpecta...
method toHavePrefix (line 833) | public function toHavePrefix(string $prefix): ArchExpectation
method toHaveSuffix (line 846) | public function toHaveSuffix(string $suffix): ArchExpectation
method toImplement (line 861) | public function toImplement(array|string $interfaces): ArchExpectation
method toOnlyUse (line 886) | public function toOnlyUse(array|string $targets): ArchExpectation
method toUseNothing (line 894) | public function toUseNothing(): ArchExpectation
method toHaveSuspiciousCharacters (line 902) | public function toHaveSuspiciousCharacters(): ArchExpectation
method toBeUsed (line 910) | public function toBeUsed(): void
method toBeUsedIn (line 920) | public function toBeUsedIn(array|string $targets): ArchExpectation
method toOnlyBeUsedIn (line 930) | public function toOnlyBeUsedIn(array|string $targets): ArchExpectation
method toBeUsedInNothing (line 938) | public function toBeUsedInNothing(): ArchExpectation
method toBeInvokable (line 946) | public function toBeInvokable(): ArchExpectation
method toHaveSnakeCaseKeys (line 961) | public function toHaveSnakeCaseKeys(string $message = ''): self
method toHaveKebabCaseKeys (line 985) | public function toHaveKebabCaseKeys(string $message = ''): self
method toHaveCamelCaseKeys (line 1009) | public function toHaveCamelCaseKeys(string $message = ''): self
method toHaveStudlyCaseKeys (line 1033) | public function toHaveStudlyCaseKeys(string $message = ''): self
method toHaveAttribute (line 1055) | public function toHaveAttribute(string $attribute): ArchExpectation
method toHaveConstructor (line 1068) | public function toHaveConstructor(): ArchExpectation
method toHaveDestructor (line 1076) | public function toHaveDestructor(): ArchExpectation
method toBeBackedEnum (line 1084) | private function toBeBackedEnum(string $backingType): ArchExpectation
method toBeStringBackedEnums (line 1100) | public function toBeStringBackedEnums(): ArchExpectation
method toBeIntBackedEnums (line 1108) | public function toBeIntBackedEnums(): ArchExpectation
method toBeStringBackedEnum (line 1116) | public function toBeStringBackedEnum(): ArchExpectation
method toBeIntBackedEnum (line 1124) | public function toBeIntBackedEnum(): ArchExpectation
FILE: src/Expectations/EachExpectation.php
class EachExpectation (line 18) | final class EachExpectation
method __construct (line 30) | public function __construct(private readonly Expectation $original) {}
method and (line 40) | public function and(mixed $value): Expectation
method not (line 50) | public function not(): self
method __call (line 63) | public function __call(string $name, array $arguments): self
method __get (line 80) | public function __get(string $name): self
FILE: src/Expectations/HigherOrderExpectation.php
class HigherOrderExpectation (line 19) | final class HigherOrderExpectation
method __construct (line 44) | public function __construct(private readonly Expectation $original, mi...
method not (line 54) | public function not(): self
method expect (line 69) | public function expect(mixed $value): Expectation
method and (line 82) | public function and(mixed $value): Expectation
method scoped (line 94) | public function scoped(Closure $expectation): self
method json (line 106) | public function json(): self
method __call (line 117) | public function __call(string $name, array $arguments): self
method __get (line 132) | public function __get(string $name): self
method expectationHasMethod (line 151) | private function expectationHasMethod(string $name): bool
method getValue (line 168) | private function getValue(): mixed
method performAssertion (line 179) | private function performAssertion(string $name, array $arguments): self
FILE: src/Expectations/OppositeExpectation.php
class OppositeExpectation (line 38) | final readonly class OppositeExpectation
method __construct (line 45) | public function __construct(private Expectation $original) {}
method toHaveKeys (line 53) | public function toHaveKeys(array $keys): Expectation
method toUse (line 77) | public function toUse(array|string $targets): ArchExpectation
method toHaveFileSystemPermissions (line 90) | public function toHaveFileSystemPermissions(string $permissions): Arch...
method toHaveLineCountLessThan (line 106) | public function toHaveLineCountLessThan(): ArchExpectation
method toHaveMethodsDocumented (line 114) | public function toHaveMethodsDocumented(): ArchExpectation
method toHavePropertiesDocumented (line 136) | public function toHavePropertiesDocumented(): ArchExpectation
method toUseStrictTypes (line 159) | public function toUseStrictTypes(): ArchExpectation
method toUseStrictEquality (line 175) | public function toUseStrictEquality(): ArchExpectation
method toBeFinal (line 191) | public function toBeFinal(): ArchExpectation
method toBeReadonly (line 207) | public function toBeReadonly(): ArchExpectation
method toBeTrait (line 223) | public function toBeTrait(): ArchExpectation
method toBeTraits (line 239) | public function toBeTraits(): ArchExpectation
method toBeAbstract (line 247) | public function toBeAbstract(): ArchExpectation
method toHaveMethod (line 265) | public function toHaveMethod(array|string $method): ArchExpectation
method toHaveSuspiciousCharacters (line 286) | public function toHaveSuspiciousCharacters(): ArchExpectation
method toHaveMethods (line 310) | public function toHaveMethods(array $methods): ArchExpectation
method toHavePublicMethodsBesides (line 320) | public function toHavePublicMethodsBesides(array|string $methods): Arc...
method toHavePublicMethods (line 356) | public function toHavePublicMethods(): ArchExpectation
method toHaveProtectedMethodsBesides (line 366) | public function toHaveProtectedMethodsBesides(array|string $methods): ...
method toHaveProtectedMethods (line 402) | public function toHaveProtectedMethods(): ArchExpectation
method toHavePrivateMethodsBesides (line 412) | public function toHavePrivateMethodsBesides(array|string $methods): Ar...
method toHavePrivateMethods (line 448) | public function toHavePrivateMethods(): ArchExpectation
method toBeEnum (line 456) | public function toBeEnum(): ArchExpectation
method toBeEnums (line 472) | public function toBeEnums(): ArchExpectation
method toBeClass (line 480) | public function toBeClass(): ArchExpectation
method toBeClasses (line 496) | public function toBeClasses(): ArchExpectation
method toBeInterface (line 504) | public function toBeInterface(): ArchExpectation
method toBeInterfaces (line 520) | public function toBeInterfaces(): ArchExpectation
method toExtend (line 528) | public function toExtend(string $class): ArchExpectation
method toExtendNothing (line 544) | public function toExtendNothing(): ArchExpectation
method toUseTrait (line 560) | public function toUseTrait(string $trait): ArchExpectation
method toUseTraits (line 570) | public function toUseTraits(array|string $traits): ArchExpectation
method toImplement (line 598) | public function toImplement(array|string $interfaces): ArchExpectation
method toImplementNothing (line 624) | public function toImplementNothing(): ArchExpectation
method toOnlyImplement (line 640) | public function toOnlyImplement(): void
method toHavePrefix (line 648) | public function toHavePrefix(string $prefix): ArchExpectation
method toHaveSuffix (line 664) | public function toHaveSuffix(string $suffix): ArchExpectation
method toOnlyUse (line 680) | public function toOnlyUse(): void
method toUseNothing (line 688) | public function toUseNothing(): void
method toBeUsed (line 696) | public function toBeUsed(): ArchExpectation
method toBeUsedIn (line 709) | public function toBeUsedIn(array|string $targets): ArchExpectation
method toOnlyBeUsedIn (line 719) | public function toOnlyBeUsedIn(): void
method toBeUsedInNothing (line 727) | public function toBeUsedInNothing(): void
method toBeInvokable (line 735) | public function toBeInvokable(): ArchExpectation
method toHaveAttribute (line 751) | public function toHaveAttribute(string $attribute): ArchExpectation
method __call (line 770) | public function __call(string $name, array $arguments): Expectation
method __get (line 791) | public function __get(string $name): Expectation
method throwExpectationFailedException (line 811) | public function throwExpectationFailedException(string $name, array|st...
method toHaveConstructor (line 830) | public function toHaveConstructor(): ArchExpectation
method toHaveDestructor (line 838) | public function toHaveDestructor(): ArchExpectation
method toBeBackedEnum (line 846) | private function toBeBackedEnum(string $backingType): ArchExpectation
method toBeStringBackedEnums (line 865) | public function toBeStringBackedEnums(): ArchExpectation
method toBeIntBackedEnums (line 873) | public function toBeIntBackedEnums(): ArchExpectation
method toBeStringBackedEnum (line 881) | public function toBeStringBackedEnum(): ArchExpectation
method toBeIntBackedEnum (line 889) | public function toBeIntBackedEnum(): ArchExpectation
FILE: src/Factories/Attribute.php
class Attribute (line 10) | final class Attribute
method __construct (line 15) | public function __construct(public string $name, public iterable $argu...
FILE: src/Factories/Concerns/HigherOrderable.php
type HigherOrderable (line 9) | trait HigherOrderable
method bootHigherOrderable (line 29) | private function bootHigherOrderable(): void
FILE: src/Factories/Covers/CoversClass.php
class CoversClass (line 10) | final class CoversClass
method __construct (line 12) | public function __construct(public string $class) {}
FILE: src/Factories/Covers/CoversFunction.php
class CoversFunction (line 10) | final class CoversFunction
method __construct (line 12) | public function __construct(public string $function) {}
FILE: src/Factories/TestCaseFactory.php
class TestCaseFactory (line 27) | final class TestCaseFactory
method __construct (line 65) | public function __construct(
method make (line 71) | public function make(): void
method evaluate (line 85) | public function evaluate(string $filename, array $methods): void
method addMethod (line 183) | public function addMethod(TestCaseMethodFactory $method): void
method hasMethod (line 219) | public function hasMethod(string $methodName): bool
method getMethod (line 237) | public function getMethod(string $methodName): TestCaseMethodFactory
FILE: src/Factories/TestCaseMethodFactory.php
class TestCaseMethodFactory (line 25) | final class TestCaseMethodFactory
method __construct (line 115) | public function __construct(
method setUp (line 129) | public function setUp(TestCase $concrete): void
method tearDown (line 147) | public function tearDown(TestCase $concrete): void
method getClosure (line 155) | public function getClosure(): Closure
method receivesArguments (line 179) | public function receivesArguments(): bool
method buildForEvaluation (line 187) | public function buildForEvaluation(): string
method buildDatasetForEvaluation (line 245) | private function buildDatasetForEvaluation(string $methodName, string ...
FILE: src/Functions.php
function expect (line 38) | function expect(mixed $value = null): Expectation
function beforeAll (line 48) | function beforeAll(Closure $closure): void
function beforeEach (line 68) | function beforeEach(?Closure $closure = null): BeforeEachCall
function dataset (line 82) | function dataset(string $name, Closure|iterable $dataset): void
function describe (line 98) | function describe(string $description, Closure $tests): DescribeCall
function uses (line 113) | function uses(string ...$classAndTraits): UsesCall
function pest (line 125) | function pest(): Configuration
function test (line 141) | function test(?string $description = null, ?Closure $closure = null): Hi...
function it (line 163) | function it(string $description, ?Closure $closure = null): TestCall
function todo (line 180) | function todo(string $description): TestCall
function afterEach (line 198) | function afterEach(?Closure $closure = null): AfterEachCall
function afterAll (line 210) | function afterAll(Closure $closure): void
function covers (line 228) | function covers(array|string ...$classesOrFunctions): void
function mutates (line 257) | function mutates(array|string ...$targets): void
function fixture (line 290) | function fixture(string $file): string
function visit (line 321) | function visit(array|string $url, array $options = []): ArrayablePending...
FILE: src/Installers/PluginBrowser.php
class PluginBrowser (line 9) | final readonly class PluginBrowser
method install (line 11) | public static function install(): void
FILE: src/Kernel.php
class Kernel (line 30) | final readonly class Kernel
method __construct (line 49) | public function __construct(
method boot (line 59) | public static function boot(TestSuite $testSuite, InputInterface $inpu...
method handle (line 96) | public function handle(array $originalArguments, array $arguments): int
method terminate (line 123) | public function terminate(): void
method shutdown (line 137) | public function shutdown(): void
FILE: src/KernelDump.php
class KernelDump (line 10) | final class KernelDump
method __construct (line 20) | public function __construct(
method enable (line 29) | public function enable(): void
method disable (line 41) | public function disable(): void
method terminate (line 53) | public function terminate(): void
method flush (line 61) | private function flush(): void
method isOpeningHeadline (line 100) | private function isOpeningHeadline(string $output): bool
method isInternalError (line 108) | private function isInternalError(string $output): bool
FILE: src/Logging/Converter.php
class Converter (line 29) | final readonly class Converter
method __construct (line 44) | public function __construct(
method getTestCaseMethodName (line 53) | public function getTestCaseMethodName(Test $test): string
method getTestCaseLocation (line 65) | public function getTestCaseLocation(Test $test): string
method getExceptionMessage (line 83) | public function getExceptionMessage(Throwable $throwable): string
method getExceptionDetails (line 102) | public function getExceptionDetails(Throwable $throwable): string
method getStackTrace (line 122) | public function getStackTrace(Throwable $throwable): string
method getTestSuiteName (line 150) | public function getTestSuiteName(TestSuite $testSuite): string
method getTrimmedTestClassName (line 171) | public function getTrimmedTestClassName(TestMethod $test): string
method getTestSuiteLocation (line 179) | public function getTestSuiteLocation(TestSuite $testSuite): ?string
method getTestMethodNameWithoutDatasetSuffix (line 200) | private function getTestMethodNameWithoutDatasetSuffix(TestMethod $tes...
method getFirstTest (line 208) | private function getFirstTest(TestSuite $testSuite): ?TestMethod
method getTestSuiteSize (line 228) | public function getTestSuiteSize(TestSuite $testSuite): int
method toRelativePath (line 236) | private function toRelativePath(string $path): string
method getStateFromResult (line 245) | public function getStateFromResult(PhpUnitTestResult $result): State
FILE: src/Logging/TeamCity/ServiceMessage.php
class ServiceMessage (line 10) | final class ServiceMessage
method __construct (line 20) | public function __construct(
method toString (line 25) | public function toString(): string
method testSuiteStarted (line 37) | public static function testSuiteStarted(string $name, ?string $locatio...
method testSuiteCount (line 45) | public static function testSuiteCount(int $count): self
method testSuiteFinished (line 52) | public static function testSuiteFinished(string $name): self
method testStarted (line 59) | public static function testStarted(string $name, string $location): self
method testFinished (line 70) | public static function testFinished(string $name, int $duration): self
method testStdOut (line 78) | public static function testStdOut(string $name, string $data): self
method testFailed (line 90) | public static function testFailed(string $name, string $message, strin...
method testStdErr (line 99) | public static function testStdErr(string $name, string $data): self
method testIgnored (line 111) | public static function testIgnored(string $name, string $message, ?str...
method comparisonFailure (line 120) | public static function comparisonFailure(string $name, string $message...
method escapeServiceMessage (line 132) | private function escapeServiceMessage(string $text): string
method setFlowId (line 141) | public static function setFlowId(int $flowId): void
FILE: src/Logging/TeamCity/Subscriber/Subscriber.php
class Subscriber (line 12) | abstract class Subscriber // @pest-arch-ignore-line
method __construct (line 17) | public function __construct(private readonly TeamCityLogger $logger) {}
method logger (line 22) | final protected function logger(): TeamCityLogger // @pest-arch-ignore...
FILE: src/Logging/TeamCity/Subscriber/TestConsideredRiskySubscriber.php
class TestConsideredRiskySubscriber (line 13) | final class TestConsideredRiskySubscriber extends Subscriber implements ...
method notify (line 15) | public function notify(ConsideredRisky $event): void
FILE: src/Logging/TeamCity/Subscriber/TestErroredSubscriber.php
class TestErroredSubscriber (line 13) | final class TestErroredSubscriber extends Subscriber implements ErroredS...
method notify (line 15) | public function notify(Errored $event): void
FILE: src/Logging/TeamCity/Subscriber/TestExecutionFinishedSubscriber.php
class TestExecutionFinishedSubscriber (line 13) | final class TestExecutionFinishedSubscriber extends Subscriber implement...
method notify (line 15) | public function notify(ExecutionFinished $event): void
FILE: src/Logging/TeamCity/Subscriber/TestFailedSubscriber.php
class TestFailedSubscriber (line 13) | final class TestFailedSubscriber extends Subscriber implements FailedSub...
method notify (line 15) | public function notify(Failed $event): void
FILE: src/Logging/TeamCity/Subscriber/TestFinishedSubscriber.php
class TestFinishedSubscriber (line 13) | final class TestFinishedSubscriber extends Subscriber implements Finishe...
method notify (line 15) | public function notify(Finished $event): void
FILE: src/Logging/TeamCity/Subscriber/TestPreparedSubscriber.php
class TestPreparedSubscriber (line 13) | final class TestPreparedSubscriber extends Subscriber implements Prepare...
method notify (line 15) | public function notify(Prepared $event): void
FILE: src/Logging/TeamCity/Subscriber/TestSkippedSubscriber.php
class TestSkippedSubscriber (line 13) | final class TestSkippedSubscriber extends Subscriber implements SkippedS...
method notify (line 15) | public function notify(Skipped $event): void
FILE: src/Logging/TeamCity/Subscriber/TestSuiteFinishedSubscriber.php
class TestSuiteFinishedSubscriber (line 13) | final class TestSuiteFinishedSubscriber extends Subscriber implements Fi...
method notify (line 15) | public function notify(Finished $event): void
FILE: src/Logging/TeamCity/Subscriber/TestSuiteStartedSubscriber.php
class TestSuiteStartedSubscriber (line 13) | final class TestSuiteStartedSubscriber extends Subscriber implements Sta...
method notify (line 15) | public function notify(Started $event): void
FILE: src/Logging/TeamCity/TeamCityLogger.php
class TeamCityLogger (line 44) | final class TeamCityLogger
method __construct (line 65) | public function __construct(
method testSuiteStarted (line 75) | public function testSuiteStarted(TestSuiteStarted $event): void
method testSuiteFinished (line 94) | public function testSuiteFinished(TestSuiteFinished $event): void
method testPrepared (line 103) | public function testPrepared(Prepared $event): void
method testMarkedIncomplete (line 115) | public function testMarkedIncomplete(): never
method testSkipped (line 120) | public function testSkipped(Skipped $event): void
method testErrored (line 136) | public function testErrored(Errored $event): void
method testFailed (line 157) | public function testFailed(Failed $event): void
method testConsideredRisky (line 189) | public function testConsideredRisky(ConsideredRisky $event): void
method testFinished (line 201) | public function testFinished(Finished $event): void
method testExecutionFinished (line 221) | public function testExecutionFinished(ExecutionFinished $event): void
method output (line 250) | public function output(ServiceMessage $message): void
method registerSubscribers (line 259) | private function registerSubscribers(): void
method setFlowId (line 276) | private function setFlowId(): void
method whenFirstEventForTest (line 285) | private function whenFirstEventForTest(Test $test, callable $callback)...
FILE: src/Matchers/Any.php
class Any (line 10) | final class Any {}
FILE: src/Mixins/Expectation.php
class Expectation (line 38) | final class Expectation
method __construct (line 50) | public function __construct(
method toBe (line 63) | public function toBe(mixed $expected, string $message = ''): self
method toBeEmpty (line 75) | public function toBeEmpty(string $message = ''): self
method toBeTrue (line 87) | public function toBeTrue(string $message = ''): self
method toBeTruthy (line 99) | public function toBeTruthy(string $message = ''): self
method toBeFalse (line 111) | public function toBeFalse(string $message = ''): self
method toBeFalsy (line 123) | public function toBeFalsy(string $message = ''): self
method toBeGreaterThan (line 135) | public function toBeGreaterThan(int|float|string|DateTimeInterface $ex...
method toBeGreaterThanOrEqual (line 147) | public function toBeGreaterThanOrEqual(int|float|string|DateTimeInterf...
method toBeLessThan (line 159) | public function toBeLessThan(int|float|string|DateTimeInterface $expec...
method toBeLessThanOrEqual (line 171) | public function toBeLessThanOrEqual(int|float|string|DateTimeInterface...
method toContain (line 183) | public function toContain(mixed ...$needles): self
method toContainEqual (line 204) | public function toContainEqual(mixed ...$needles): self
method toStartWith (line 223) | public function toStartWith(string $expected, string $message = ''): self
method toEndWith (line 240) | public function toEndWith(string $expected, string $message = ''): self
method toHaveLength (line 256) | public function toHaveLength(int $number, string $message = ''): self
method toHaveCount (line 284) | public function toHaveCount(int $count, string $message = ''): self
method toHaveSameSize (line 301) | public function toHaveSameSize(Countable|iterable $expected, string $m...
method toHaveProperty (line 317) | public function toHaveProperty(string $name, mixed $value = new Any, s...
method toHaveProperties (line 338) | public function toHaveProperties(iterable $names, string $message = ''...
method toEqual (line 352) | public function toEqual(mixed $expected, string $message = ''): self
method toEqualCanonicalizing (line 370) | public function toEqualCanonicalizing(mixed $expected, string $message...
method toEqualWithDelta (line 383) | public function toEqualWithDelta(mixed $expected, float $delta, string...
method toBeIn (line 396) | public function toBeIn(iterable $values, string $message = ''): self
method toBeInfinite (line 408) | public function toBeInfinite(string $message = ''): self
method toBeInstanceOf (line 421) | public function toBeInstanceOf(string $class, string $message = ''): self
method toBeArray (line 433) | public function toBeArray(string $message = ''): self
method toBeList (line 445) | public function toBeList(string $message = ''): self
method toBeBool (line 457) | public function toBeBool(string $message = ''): self
method toBeCallable (line 469) | public function toBeCallable(string $message = ''): self
method toBeFloat (line 481) | public function toBeFloat(string $message = ''): self
method toBeInt (line 493) | public function toBeInt(string $message = ''): self
method toBeIterable (line 505) | public function toBeIterable(string $message = ''): self
method toBeNumeric (line 517) | public function toBeNumeric(string $message = ''): self
method toBeDigits (line 529) | public function toBeDigits(string $message = ''): self
method toBeObject (line 541) | public function toBeObject(string $message = ''): self
method toBeResource (line 553) | public function toBeResource(string $message = ''): self
method toBeScalar (line 565) | public function toBeScalar(string $message = ''): self
method toBeString (line 577) | public function toBeString(string $message = ''): self
method toBeJson (line 589) | public function toBeJson(string $message = ''): self
method toBeNan (line 603) | public function toBeNan(string $message = ''): self
method toBeNull (line 615) | public function toBeNull(string $message = ''): self
method toHaveKey (line 627) | public function toHaveKey(string|int $key, mixed $value = new Any, str...
method toHaveKeys (line 660) | public function toHaveKeys(array $keys, string $message = ''): self
method toBeDirectory (line 678) | public function toBeDirectory(string $message = ''): self
method toBeReadableDirectory (line 694) | public function toBeReadableDirectory(string $message = ''): self
method toBeWritableDirectory (line 710) | public function toBeWritableDirectory(string $message = ''): self
method toBeFile (line 726) | public function toBeFile(string $message = ''): self
method toBeReadableFile (line 742) | public function toBeReadableFile(string $message = ''): self
method toBeWritableFile (line 758) | public function toBeWritableFile(string $message = ''): self
method toMatchArray (line 774) | public function toMatchArray(iterable $array, string $message = ''): self
method toMatchObject (line 804) | public function toMatchObject(object|iterable $object, string $message...
method toMatchSnapshot (line 833) | public function toMatchSnapshot(string $message = ''): self
method toMatch (line 876) | public function toMatch(string $expression, string $message = ''): self
method toMatchConstraint (line 891) | public function toMatchConstraint(Constraint $constraint, string $mess...
method toContainOnlyInstancesOf (line 902) | public function toContainOnlyInstancesOf(string $class, string $messag...
method toThrow (line 919) | public function toThrow(callable|string|Throwable $exception, ?string ...
method export (line 985) | private function export(mixed $value): string
method toBeUppercase (line 999) | public function toBeUppercase(string $message = ''): self
method toBeLowercase (line 1011) | public function toBeLowercase(string $message = ''): self
method toBeAlphaNumeric (line 1023) | public function toBeAlphaNumeric(string $message = ''): self
method toBeAlpha (line 1035) | public function toBeAlpha(string $message = ''): self
method toBeSnakeCase (line 1047) | public function toBeSnakeCase(string $message = ''): self
method toBeKebabCase (line 1065) | public function toBeKebabCase(string $message = ''): self
method toBeCamelCase (line 1083) | public function toBeCamelCase(string $message = ''): self
method toBeStudlyCase (line 1101) | public function toBeStudlyCase(string $message = ''): self
method toBeUuid (line 1119) | public function toBeUuid(string $message = ''): self
method toBeBetween (line 1135) | public function toBeBetween(int|float|DateTimeInterface $lowestValue, ...
method toBeUrl (line 1148) | public function toBeUrl(string $message = ''): self
method toBeSlug (line 1164) | public function toBeSlug(string $message = ''): self
FILE: src/Panic.php
class Panic (line 15) | final readonly class Panic
method __construct (line 20) | private function __construct(
method with (line 29) | public static function with(Throwable $throwable): never
method handle (line 45) | private function handle(): void
FILE: src/PendingCalls/AfterEachCall.php
class AfterEachCall (line 19) | final class AfterEachCall
method __construct (line 36) | public function __construct(
method __destruct (line 51) | public function __destruct()
method __call (line 76) | public function __call(string $name, array $arguments): self
FILE: src/PendingCalls/BeforeEachCall.php
class BeforeEachCall (line 22) | final class BeforeEachCall
method __construct (line 44) | public function __construct(
method __destruct (line 60) | public function __destruct()
method after (line 98) | public function after(Closure $closure): self
method __call (line 112) | public function __call(string $name, array $arguments): self
FILE: src/PendingCalls/Concerns/Describable.php
type Describable (line 12) | trait Describable
FILE: src/PendingCalls/DescribeCall.php
class DescribeCall (line 15) | final class DescribeCall
method __construct (line 32) | public function __construct(
method describing (line 46) | public static function describing(): array
method __destruct (line 54) | public function __destruct()
method __call (line 72) | public function __call(string $name, array $arguments): self
FILE: src/PendingCalls/TestCall.php
class TestCall (line 36) | final class TestCall // @phpstan-ignore-line
method __construct (line 60) | public function __construct(
method after (line 78) | public function after(Closure $closure): self
method fails (line 114) | public function fails(?string $message = null): self
method throws (line 122) | public function throws(string|int $exception, ?string $exceptionMessag...
method throwsIf (line 154) | public function throwsIf(callable|bool $condition, string|int $excepti...
method throwsUnless (line 172) | public function throwsUnless(callable|bool $condition, string|int $exc...
method with (line 190) | public function with(Closure|iterable|string ...$data): self
method depends (line 202) | public function depends(string ...$depends): self
method group (line 214) | public function group(string ...$groups): self
method only (line 229) | public function only(): self
method skip (line 239) | public function skip(Closure|bool|string $conditionOrMessage = true, s...
method skipOnPhp (line 266) | public function skipOnPhp(string $version): self
method skipOnWindows (line 291) | public function skipOnWindows(): self
method skipOnMac (line 299) | public function skipOnMac(): self
method skipOnLinux (line 307) | public function skipOnLinux(): self
method skipOnOs (line 315) | private function skipOnOs(string $osFamily, string $message): self
method runningOnCI (line 325) | private function runningOnCI(): bool
method skipOnCI (line 359) | public function skipOnCI(): self
method skipLocally (line 368) | public function skipLocally(): self
method onlyOnWindows (line 380) | public function onlyOnWindows(): self
method onlyOnMac (line 388) | public function onlyOnMac(): self
method onlyOnLinux (line 396) | public function onlyOnLinux(): self
method repeat (line 404) | public function repeat(int $times): self
method todo (line 418) | public function todo(// @phpstan-ignore-line
method wip (line 450) | public function wip(// @phpstan-ignore-line
method done (line 478) | public function done(// @phpstan-ignore-line
method issue (line 508) | public function issue(array|string|int $number): self
method ticket (line 524) | public function ticket(array|string|int $number): self
method assignee (line 534) | public function assignee(array|string $assignee): self
method pr (line 548) | public function pr(array|string|int $number): self
method note (line 564) | public function note(array|string $note): self
method covers (line 578) | public function covers(array|string ...$classesOrFunctions): self
method coversClass (line 607) | public function coversClass(string ...$classes): self
method coversTrait (line 630) | public function coversTrait(string ...$traits): self
method coversFunction (line 653) | public function coversFunction(string ...$functions): self
method references (line 671) | public function references(string|array ...$classes): self
method see (line 684) | public function see(string|array ...$classes): self
method throwsNoExceptions (line 694) | public function throwsNoExceptions(): self
method __get (line 704) | public function __get(string $name): self
method __call (line 714) | public function __call(string $name, array $arguments): self
method addChain (line 724) | private function addChain(string $file, int $line, string $name, ?arra...
method __destruct (line 750) | public function __destruct()
FILE: src/PendingCalls/UsesCall.php
class UsesCall (line 14) | final class UsesCall
method __construct (line 49) | public function __construct(
method compact (line 59) | public function compact(): self
method use (line 71) | public function use(string ...$classAndTraits): self
method extend (line 79) | public function extend(string ...$classAndTraits): self
method in (line 89) | public function in(string ...$targets): self
method group (line 124) | public function group(string ...$groups): self
method beforeAll (line 134) | public function beforeAll(Closure $hook): self
method beforeEach (line 144) | public function beforeEach(Closure $hook): self
method afterEach (line 154) | public function afterEach(Closure $hook): self
method afterAll (line 164) | public function afterAll(Closure $hook): self
method __destruct (line 174) | public function __destruct()
FILE: src/Pest.php
function version (line 7) | function version(): string
function testDirectory (line 12) | function testDirectory(string $file = ''): string
FILE: src/Plugin.php
class Plugin (line 7) | final class Plugin
method uses (line 23) | public static function uses(string ...$traits): void
FILE: src/Plugins/Actions/CallsAddsOutput.php
class CallsAddsOutput (line 13) | final class CallsAddsOutput
method execute (line 20) | public static function execute(int $exitCode): int
FILE: src/Plugins/Actions/CallsBoot.php
class CallsBoot (line 13) | final class CallsBoot
method execute (line 20) | public static function execute(): void
FILE: src/Plugins/Actions/CallsHandleArguments.php
class CallsHandleArguments (line 13) | final class CallsHandleArguments
method execute (line 23) | public static function execute(array $argv): array
FILE: src/Plugins/Actions/CallsHandleOriginalArguments.php
class CallsHandleOriginalArguments (line 13) | final class CallsHandleOriginalArguments
method execute (line 22) | public static function execute(array $argv): void
FILE: src/Plugins/Actions/CallsTerminable.php
class CallsTerminable (line 13) | final class CallsTerminable
method execute (line 20) | public static function execute(): void
FILE: src/Plugins/Bail.php
class Bail (line 13) | final class Bail implements HandlesArguments
method handleArguments (line 20) | public function handleArguments(array $arguments): array
FILE: src/Plugins/Cache.php
class Cache (line 17) | final class Cache implements HandlesArguments
method handleArguments (line 35) | public function handleArguments(array $arguments): array
FILE: src/Plugins/Concerns/HandleArguments.php
type HandleArguments (line 10) | trait HandleArguments
method hasArgument (line 17) | public function hasArgument(string $argument, array $arguments): bool
method pushArgument (line 38) | public function pushArgument(string $argument, array $arguments): array
method popArgument (line 51) | public function popArgument(string $argument, array $arguments): array
FILE: src/Plugins/Configuration.php
class Configuration (line 17) | final class Configuration implements HandlesArguments, Terminable
method handleArguments (line 35) | public function handleArguments(array $arguments): array
method fromGeneratedConfigurationFile (line 49) | private function fromGeneratedConfigurationFile(): string
method hasCustomConfigurationFile (line 69) | private function hasCustomConfigurationFile(): bool
method getTempPhpunitXmlPath (line 80) | private function getTempPhpunitXmlPath(): string
method terminate (line 88) | public function terminate(): void
FILE: src/Plugins/Coverage.php
class Coverage (line 18) | final class Coverage implements AddsOutput, HandlesArguments
method __construct (line 49) | public function __construct(private readonly OutputInterface $output)
method handleArguments (line 57) | public function handleArguments(array $originals): array
method addOutput (line 133) | public function addOutput(int $exitCode): int
method computeComparableCoverage (line 180) | private function computeComparableCoverage(float $coverage): float
FILE: src/Plugins/Environment.php
class Environment (line 12) | final class Environment implements HandlesArguments
method handleArguments (line 32) | public function handleArguments(array $arguments): array
method name (line 48) | public static function name(?string $name = null): string
FILE: src/Plugins/Help.php
class Help (line 17) | final readonly class Help implements HandlesArguments
method __construct (line 24) | public function __construct(
method handleArguments (line 33) | public function handleArguments(array $arguments): array
method colorizeOptions (line 86) | private function colorizeOptions(string $argument): string
method getContent (line 98) | private function getContent(): array
FILE: src/Plugins/Init.php
class Init (line 18) | final readonly class Init implements HandlesArguments
method __construct (line 39) | public function __construct(
method handleArguments (line 50) | public function handleArguments(array $arguments): array
method init (line 69) | public function init(): void
method isLaravelInstalled (line 120) | private function isLaravelInstalled(): bool
FILE: src/Plugins/Memory.php
class Memory (line 14) | final class Memory implements AddsOutput, HandlesArguments
method __construct (line 26) | public function __construct(
method handleArguments (line 35) | public function handleArguments(array $arguments): array
method addOutput (line 45) | public function addOutput(int $exitCode): int
FILE: src/Plugins/Only.php
class Only (line 16) | final class Only implements Terminable
method enable (line 32) | public static function enable(TestCall|TestCaseMethodFactory $testCall...
method isEnabled (line 65) | public static function isEnabled(): bool
method group (line 75) | public static function group(): string
method terminate (line 89) | public function terminate(): void
FILE: src/Plugins/Parallel.php
class Parallel (line 22) | final class Parallel implements HandlesArguments
method isEnabled (line 42) | public static function isEnabled(): bool
method isWorker (line 56) | public static function isWorker(): bool
method setGlobal (line 68) | public static function setGlobal(string $key, string|int|bool|Stringab...
method getGlobal (line 78) | public static function getGlobal(string $key): string|int|bool|null
method handleArguments (line 95) | public function handleArguments(array $arguments): array
method runTestSuiteInParallel (line 117) | private function runTestSuiteInParallel(array $arguments): int
method runWorkerHandlers (line 141) | private function runWorkerHandlers(array $arguments): array
method paratestCommand (line 158) | private function paratestCommand(): Application
method hasArgumentsThatWouldBeFasterWithoutParallel (line 175) | private function hasArgumentsThatWouldBeFasterWithoutParallel(): bool
method runTestSuiteInSeries (line 194) | private function runTestSuiteInSeries(array $arguments): array
FILE: src/Plugins/Parallel/Contracts/HandlersWorkerArguments.php
type HandlersWorkerArguments (line 7) | interface HandlersWorkerArguments
method handleWorkerArguments (line 13) | public function handleWorkerArguments(array $arguments): array;
FILE: src/Plugins/Parallel/Handlers/Laravel.php
class Laravel (line 21) | final class Laravel implements HandlesArguments
method handleArguments (line 28) | public function handleArguments(array $arguments): array
method whenUsingLaravel (line 46) | private function whenUsingLaravel(array $arguments, Closure $closure):...
method ensureRunnerIsResolvable (line 61) | private function ensureRunnerIsResolvable(): void
method ensureEnvironmentVariables (line 74) | private function ensureEnvironmentVariables(array $arguments): array
method ensureRunner (line 97) | private function ensureRunner(array $arguments): array
FILE: src/Plugins/Parallel/Handlers/Parallel.php
class Parallel (line 14) | final class Parallel implements HandlesArguments
method handleArguments (line 31) | public function handleArguments(array $arguments): array
FILE: src/Plugins/Parallel/Handlers/Pest.php
class Pest (line 10) | final class Pest implements HandlersWorkerArguments
method handleWorkerArguments (line 17) | public function handleWorkerArguments(array $arguments): array
FILE: src/Plugins/Parallel/Paratest/CleanConsoleOutput.php
class CleanConsoleOutput (line 9) | final class CleanConsoleOutput extends ConsoleOutput
method doWrite (line 14) | #[\Override]
method isOpeningHeadline (line 27) | private function isOpeningHeadline(string $message): bool
FILE: src/Plugins/Parallel/Paratest/ResultPrinter.php
class ResultPrinter (line 30) | final class ResultPrinter
method __construct (line 58) | public function __construct(
method printFeedback (line 96) | public function printFeedback(
method printResults (line 146) | public function printResults(TestResult $testResult, array $teamcityFi...
method printFeedbackItem (line 178) | private function printFeedbackItem(string $item): void
method tailMultiple (line 198) | private function tailMultiple(array $files): string
method tail (line 212) | private function tail(SplFileInfo $file): string
FILE: src/Plugins/Parallel/Paratest/WrapperRunner.php
class WrapperRunner (line 49) | final class WrapperRunner implements RunnerInterface
method __construct (line 109) | public function __construct(
method run (line 140) | public function run(): int
method handleLaravelHerd (line 171) | private function handleLaravelHerd(array $parameters): array
method startWorkers (line 180) | private function startWorkers(): void
method assignAllPendingTests (line 187) | private function assignAllPendingTests(): void
method flushWorker (line 223) | private function flushWorker(WrapperWorker $worker): void
method waitForAllToFinish (line 234) | private function waitForAllToFinish(): void
method startWorker (line 261) | private function startWorker(int $token): WrapperWorker
method destroyWorker (line 295) | private function destroyWorker(int $token): void
method complete (line 306) | private function complete(TestResult $testResultSum): int
method generateCodeCoverageReports (line 422) | private function generateCodeCoverageReports(): void
method generateLogs (line 454) | private function generateLogs(): void
method clearFiles (line 469) | private function clearFiles(array $files): void
method getTestFiles (line 485) | private function getTestFiles(SuiteLoader $suiteLoader): array
FILE: src/Plugins/Parallel/Support/CompactPrinter.php
class CompactPrinter (line 27) | final class CompactPrinter
method __construct (line 53) | public function __construct(
method default (line 65) | public static function default(): self
method newLine (line 78) | public function newLine(): void
method descriptionItem (line 86) | public function descriptionItem(string $item): void
method errors (line 109) | public function errors(State $state): void
method recap (line 119) | public function recap(State $state, PHPUnitTestResult $testResult, Dur...
FILE: src/Plugins/Printer.php
class Printer (line 12) | final class Printer implements HandlesArguments
method handleArguments (line 19) | public function handleArguments(array $arguments): array
FILE: src/Plugins/ProcessIsolation.php
class ProcessIsolation (line 13) | final class ProcessIsolation implements HandlesArguments
method handleArguments (line 20) | public function handleArguments(array $arguments): array
FILE: src/Plugins/Profile.php
class Profile (line 13) | final class Profile implements HandlesArguments
method handleArguments (line 20) | public function handleArguments(array $arguments): array
FILE: src/Plugins/Retry.php
class Retry (line 13) | final class Retry implements HandlesArguments
method handleArguments (line 20) | public function handleArguments(array $arguments): array
FILE: src/Plugins/Shard.php
class Shard (line 18) | final class Shard implements AddsOutput, HandlesArguments
method __construct (line 39) | public function __construct(
method handleArguments (line 48) | public function handleArguments(array $arguments): array
method allTests (line 84) | private function allTests(array $arguments): array
method removeParallelArguments (line 101) | private function removeParallelArguments(array $arguments): array
method buildFilterArgument (line 109) | private function buildFilterArgument(mixed $testsToRun): string
method addOutput (line 117) | public function addOutput(int $exitCode): int
method getShard (line 147) | public static function getShard(InputInterface $input): array
FILE: src/Plugins/Snapshot.php
class Snapshot (line 14) | final class Snapshot implements HandlesArguments
method handleArguments (line 21) | public function handleArguments(array $arguments): array
FILE: src/Plugins/Verbose.php
class Verbose (line 12) | final class Verbose implements HandlesArguments
method handleArguments (line 24) | public function handleArguments(array $arguments): array
FILE: src/Plugins/Version.php
class Version (line 15) | final class Version implements HandlesArguments
method handleArguments (line 22) | public function handleArguments(array $arguments): array
FILE: src/Preset.php
class Preset (line 23) | final class Preset
method __construct (line 42) | public function __construct()
method php (line 50) | public function php(): Php
method laravel (line 58) | public function laravel(): Laravel
method strict (line 66) | public function strict(): Strict
method security (line 74) | public function security(): AbstractPreset
method relaxed (line 82) | public function relaxed(): AbstractPreset
method custom (line 92) | public static function custom(string $name, Closure $execute): void
method __call (line 108) | public function __call(string $name, array $arguments): AbstractPreset
method executePreset (line 130) | private function executePreset(AbstractPreset $preset): AbstractPreset
method baseNamespaces (line 148) | private function baseNamespaces(): array
FILE: src/Repositories/AfterAllRepository.php
class AfterAllRepository (line 15) | final class AfterAllRepository
method each (line 25) | public function each(callable $each): void
method set (line 35) | public function set(Closure $closure): void
method get (line 49) | public function get(string $filename): Closure
FILE: src/Repositories/AfterEachRepository.php
class AfterEachRepository (line 16) | final class AfterEachRepository
method set (line 26) | public function set(string $filename, AfterEachCall $afterEachCall, Cl...
method get (line 43) | public function get(string $filename): Closure
FILE: src/Repositories/BeforeAllRepository.php
class BeforeAllRepository (line 15) | final class BeforeAllRepository
method pop (line 25) | public function pop(string $filename): Closure
method set (line 37) | public function set(Closure $closure): void
method get (line 51) | public function get(string $filename): Closure
FILE: src/Repositories/BeforeEachRepository.php
class BeforeEachRepository (line 15) | final class BeforeEachRepository
method set (line 25) | public function set(string $filename, BeforeEachCall $beforeEachCall, ...
method get (line 43) | public function get(string $filename): array
FILE: src/Repositories/DatasetsRepository.php
class DatasetsRepository (line 20) | final class DatasetsRepository
method set (line 43) | public static function set(string $name, Closure|iterable $data, strin...
method with (line 59) | public static function with(string $filename, string $description, arr...
method has (line 64) | public static function has(string $filename, string $description): bool
method get (line 74) | public static function get(string $filename, string $description): arr...
method resolve (line 93) | public static function resolve(array $dataset, string $currentTestFile...
method processDatasets (line 143) | private static function processDatasets(array $datasets, string $curre...
method getScopedDataset (line 182) | private static function getScopedDataset(string $name, string $current...
method getDatasetsCombinations (line 211) | private static function getDatasetsCombinations(array $combinations): ...
method getDatasetDescription (line 230) | private static function getDatasetDescription(int|string $key, array $...
FILE: src/Repositories/SnapshotRepository.php
class SnapshotRepository (line 13) | final class SnapshotRepository
method __construct (line 21) | public function __construct(
method has (line 30) | public function has(): bool
method get (line 42) | public function get(): array
method save (line 58) | public function save(string $snapshot): string
method flush (line 74) | public function flush(): void
method getSnapshotFilename (line 105) | private function getSnapshotFilename(): string
method getCurrentSnapshotKey (line 133) | private function getCurrentSnapshotKey(): string
method getCurrentSnapshotCounter (line 138) | private function getCurrentSnapshotCounter(): int
method startNewExpectation (line 143) | public function startNewExpectation(): void
FILE: src/Repositories/TestRepository.php
class TestRepository (line 22) | final class TestRepository
method count (line 47) | public function count(): int
method getFilenames (line 57) | public function getFilenames(): array
method use (line 70) | public function use(array $classOrTraits, array $groups, array $paths,...
method addTestCaseFilter (line 103) | public function addTestCaseFilter(TestCaseFilter $filter): void
method addTestCaseMethodFilter (line 111) | public function addTestCaseMethodFilter(TestCaseMethodFilter $filter):...
method get (line 119) | public function get(string $filename): ?TestCaseFactory
method set (line 127) | public function set(TestCaseMethodFactory $method): void
method makeIfNeeded (line 151) | public function makeIfNeeded(string $filename): void
method make (line 169) | private function make(TestCaseFactory $testCase): void
FILE: src/Result.php
class Result (line 14) | final class Result
method failed (line 21) | public static function failed(Configuration $configuration, TestResult...
method ok (line 29) | public static function ok(Configuration $configuration, TestResult $re...
method exitCode (line 37) | public static function exitCode(Configuration $configuration, TestResu...
FILE: src/Runner/Filter/EnsureTestCaseIsInitiatedFilter.php
class EnsureTestCaseIsInitiatedFilter (line 15) | final class EnsureTestCaseIsInitiatedFilter extends RecursiveFilterIterator
method __construct (line 20) | public function __construct(RecursiveIterator $iterator)
method accept (line 28) | public function accept(): bool
FILE: src/Subscribers/EnsureConfigurationIsAvailable.php
class EnsureConfigurationIsAvailable (line 15) | final class EnsureConfigurationIsAvailable implements ConfiguredSubscriber
method notify (line 20) | public function notify(Configured $event): void
FILE: src/Subscribers/EnsureIgnorableTestCasesAreIgnored.php
class EnsureIgnorableTestCasesAreIgnored (line 17) | final class EnsureIgnorableTestCasesAreIgnored implements StartedSubscriber
method notify (line 22) | public function notify(Started $event): void
FILE: src/Subscribers/EnsureKernelDumpIsFlushed.php
class EnsureKernelDumpIsFlushed (line 15) | final class EnsureKernelDumpIsFlushed implements StartedSubscriber
method notify (line 20) | public function notify(Started $event): void
FILE: src/Subscribers/EnsureTeamCityEnabled.php
class EnsureTeamCityEnabled (line 18) | final readonly class EnsureTeamCityEnabled implements ConfiguredSubscriber
method __construct (line 23) | public function __construct(
method notify (line 32) | public function notify(Configured $event): void
FILE: src/Support/Arr.php
class Arr (line 10) | final class Arr
method has (line 17) | public static function has(array $array, string|int $key): bool
method get (line 41) | public static function get(array $array, string|int $key, mixed $defau...
method dot (line 70) | public static function dot(array $array, string $prepend = ''): array
method last (line 90) | public static function last(array $array): mixed
FILE: src/Support/Backtrace.php
class Backtrace (line 12) | final class Backtrace
method testFile (line 21) | public static function testFile(): string
method datasetsFile (line 50) | public static function datasetsFile(): string
method file (line 76) | public static function file(): string
method dirname (line 86) | public static function dirname(): string
method line (line 96) | public static function line(): int
method backtrace (line 106) | private static function backtrace(): array
FILE: src/Support/ChainableClosure.php
class ChainableClosure (line 13) | final class ChainableClosure
method boundWhen (line 18) | public static function boundWhen(Closure $condition, Closure $next): C...
method bound (line 34) | public static function bound(Closure $closure, Closure $next): Closure
method unbound (line 49) | public static function unbound(Closure $closure, Closure $next): Closure
method boundStatically (line 60) | public static function boundStatically(Closure $closure, Closure $next...
FILE: src/Support/Closure.php
class Closure (line 13) | final class Closure
method bind (line 20) | public static function bind(?BaseClosure $closure, ?object $newThis, o...
FILE: src/Support/Container.php
class Container (line 14) | final class Container
method getInstance (line 29) | public static function getInstance(): self
method get (line 41) | public function get(string $id): object|string
method add (line 56) | public function add(string $id, object|string $instance): self
method build (line 71) | private function build(string $id): object
FILE: src/Support/Coverage.php
class Coverage (line 21) | final class Coverage
method getPath (line 26) | public static function getPath(): string
method isAvailable (line 38) | public static function isAvailable(): bool
method usingXdebug (line 68) | public static function usingXdebug(): bool
method report (line 77) | public static function report(OutputInterface $output, bool $compact =...
method getMissingCoverage (line 171) | public static function getMissingCoverage(mixed $file): array
FILE: src/Support/DatasetInfo.php
class DatasetInfo (line 12) | final class DatasetInfo
method isInsideADatasetsDirectory (line 18) | public static function isInsideADatasetsDirectory(string $file): bool
method isADatasetsFile (line 23) | public static function isADatasetsFile(string $file): bool
method scope (line 28) | public static function scope(string $file): string
FILE: src/Support/Description.php
class Description (line 7) | final readonly class Description implements \Stringable
method __construct (line 12) | public function __construct(private string $description) {}
method __toString (line 17) | public function __toString(): string
FILE: src/Support/ExceptionTrace.php
class ExceptionTrace (line 14) | final class ExceptionTrace
method ensure (line 23) | public static function ensure(Closure $closure): mixed
FILE: src/Support/ExpectationPipeline.php
class ExpectationPipeline (line 12) | final class ExpectationPipeline
method __construct (line 31) | public function __construct(
method for (line 38) | public static function for(Closure $closure): self
method send (line 46) | public function send(mixed ...$passables): self
method through (line 58) | public function through(array $pipes): self
method run (line 68) | public function run(): void
method carry (line 84) | public function carry(): Closure
FILE: src/Support/Exporter.php
class Exporter (line 13) | final readonly class Exporter
method __construct (line 23) | public function __construct(
method default (line 32) | public static function default(): self
method shortenedRecursiveExport (line 44) | public function shortenedRecursiveExport(array &$data, ?Context $conte...
method shortenedExport (line 79) | public function shortenedExport(mixed $value): string
FILE: src/Support/HigherOrderCallables.php
class HigherOrderCallables (line 13) | final readonly class HigherOrderCallables
method __construct (line 18) | public function __construct(private object $target)
method expect (line 31) | public function expect(mixed $value): Expectation
method and (line 47) | public function and(mixed $value): Expectation
method defer (line 56) | public function defer(callable $callable): object
FILE: src/Support/HigherOrderMessage.php
class HigherOrderMessage (line 14) | final class HigherOrderMessage
method __construct (line 30) | public function __construct(
method call (line 46) | public function call(object $target): mixed
method when (line 80) | public function when(callable $condition): self
method hasHigherOrderCallable (line 90) | private function hasHigherOrderCallable(): bool
method getUndefinedMethodMessage (line 95) | private function getUndefinedMethodMessage(object $target, string $met...
FILE: src/Support/HigherOrderMessageCollection.php
class HigherOrderMessageCollection (line 10) | final class HigherOrderMessageCollection
method add (line 22) | public function add(string $filename, int $line, string $name, ?array ...
method addWhen (line 32) | public function addWhen(callable $condition, string $filename, int $li...
method chain (line 40) | public function chain(object $target): void
method proxy (line 50) | public function proxy(object $target): void
method count (line 62) | public function count(string $name): int
FILE: src/Support/HigherOrderTapProxy.php
class HigherOrderTapProxy (line 13) | final class HigherOrderTapProxy
method __construct (line 18) | public function __construct(
method __set (line 27) | public function __set(string $property, mixed $value): void
method __get (line 35) | public function __get(string $property): mixed
method __call (line 58) | public function __call(string $methodName, array $arguments)
FILE: src/Support/NullClosure.php
class NullClosure (line 12) | final class NullClosure
method create (line 17) | public static function create(): Closure
FILE: src/Support/Reflection.php
class Reflection (line 24) | final class Reflection
method call (line 31) | public static function call(object $object, string $method, array $arg...
method bindCallable (line 57) | public static function bindCallable(callable $callable, array $args = ...
method bindCallableWithData (line 66) | public static function bindCallableWithData(callable $callable): mixed
method getFileNameFromClosure (line 86) | public static function getFileNameFromClosure(Closure $closure): string
method getPropertyValue (line 96) | public static function getPropertyValue(object $object, string $proper...
method setPropertyValue (line 125) | public static function setPropertyValue(object $object, string $proper...
method getParameterClassName (line 152) | public static function getParameterClassName(ReflectionParameter $para...
method getFunctionArguments (line 182) | public static function getFunctionArguments(Closure $function): array
method getFunctionVariable (line 208) | public static function getFunctionVariable(Closure $function, string $...
method getPropertiesFromReflectionClass (line 221) | public static function getPropertiesFromReflectionClass(ReflectionClas...
method getMethodsFromReflectionClass (line 256) | public static function getMethodsFromReflectionClass(ReflectionClass $...
FILE: src/Support/Shell.php
class Shell (line 17) | final class Shell
method open (line 22) | public static function open(): void
method casters (line 46) | private static function casters(): array
method tinkered (line 78) | private static function tinkered(PsyShell $shell): ?object
FILE: src/Support/StateGenerator.php
class StateGenerator (line 19) | final class StateGenerator
method fromPhpUnitTestResult (line 21) | public function fromPhpUnitTestResult(int $passedTests, PHPUnitTestRes...
FILE: src/Support/Str.php
class Str (line 10) | final class Str
method random (line 28) | public static function random(int $length = 16): string
method startsWith (line 36) | public static function startsWith(string $target, string $search): bool
method endsWith (line 44) | public static function endsWith(string $target, string $search): bool
method evaluable (line 57) | public static function evaluable(string $code): string
method beforeLast (line 70) | public static function beforeLast(string $subject, string $search): st...
method after (line 88) | public static function after(string $subject, string $search): string
method isUuid (line 96) | public static function isUuid(string $value): bool
method describe (line 106) | public static function describe(array $describeDescriptions, string $t...
method isUrl (line 116) | public static function isUrl(string $value): bool
method slugify (line 124) | public static function slugify(string $target): string
FILE: src/Support/View.php
class View (line 16) | final class View
method renderUsing (line 26) | public static function renderUsing(OutputInterface $output): void
method render (line 36) | public static function render(string $path, array $data = []): void
method compile (line 56) | private static function compile(string $path, array $data): string
FILE: src/TestCaseFilters/GitDirtyTestCaseFilter.php
class GitDirtyTestCaseFilter (line 14) | final class GitDirtyTestCaseFilter implements TestCaseFilter
method __construct (line 24) | public function __construct(private readonly string $projectRoot)
method accept (line 32) | public function accept(string $testCaseFilename): bool
method loadChangedFiles (line 53) | private function loadChangedFiles(): void
FILE: src/TestCaseMethodFilters/AssigneeTestCaseFilter.php
class AssigneeTestCaseFilter (line 10) | final readonly class AssigneeTestCaseFilter implements TestCaseMethodFilter
method __construct (line 15) | public function __construct(private string $assignee)
method accept (line 23) | public function accept(TestCaseMethodFactory $factory): bool
FILE: src/TestCaseMethodFilters/IssueTestCaseFilter.php
class IssueTestCaseFilter (line 10) | final readonly class IssueTestCaseFilter implements TestCaseMethodFilter
method __construct (line 15) | public function __construct(private int $number)
method accept (line 23) | public function accept(TestCaseMethodFactory $factory): bool
FILE: src/TestCaseMethodFilters/NotesTestCaseFilter.php
class NotesTestCaseFilter (line 10) | final readonly class NotesTestCaseFilter implements TestCaseMethodFilter
method accept (line 15) | public function accept(TestCaseMethodFactory $factory): bool
FILE: src/TestCaseMethodFilters/PrTestCaseFilter.php
class PrTestCaseFilter (line 10) | final readonly class PrTestCaseFilter implements TestCaseMethodFilter
method __construct (line 15) | public function __construct(private int $number)
method accept (line 23) | public function accept(TestCaseMethodFactory $factory): bool
FILE: src/TestCaseMethodFilters/TodoTestCaseFilter.php
class TodoTestCaseFilter (line 10) | final readonly class TodoTestCaseFilter implements TestCaseMethodFilter
method accept (line 15) | public function accept(TestCaseMethodFactory $factory): bool
FILE: src/TestCases/IgnorableTestCase.php
class IgnorableTestCase (line 12) | final class IgnorableTestCase extends TestCase
FILE: src/TestSuite.php
class TestSuite (line 20) | final class TestSuite
method __construct (line 70) | public function __construct(
method getInstance (line 90) | public static function getInstance(
method getFilename (line 111) | public function getFilename(): string
method getDescription (line 118) | public function getDescription(): string
method registerSnapshotChange (line 128) | public function registerSnapshotChange(string $message): void
FILE: tests/Autoload.php
type PluginTrait (line 5) | trait PluginTrait
method assertPluginTraitGotRegistered (line 7) | public function assertPluginTraitGotRegistered(): void
type SecondPluginTrait (line 13) | trait SecondPluginTrait
method assertSecondPluginTraitGotRegistered (line 15) | public function assertSecondPluginTraitGotRegistered(): void
function _assertThat (line 24) | function _assertThat()
FILE: tests/Datasets/Numbers.php
function firstSetOfNumbers (line 22) | function firstSetOfNumbers(): Generator
function secondSetOfNumbers (line 28) | function secondSetOfNumbers(): Generator
FILE: tests/Features/After.php
function post (line 158) | function post(string $route)
type Postable (line 163) | trait Postable
method post (line 168) | public function post(string $route)
FILE: tests/Features/Coverage.php
method lineCoverageData (line 40) | public function lineCoverageData(): array
FILE: tests/Features/Covers/FunctionCoverage.php
function testCoversFunction (line 5) | function testCoversFunction() {}
FILE: tests/Features/Covers/GuessCoverage.php
function testCoversFunction2 (line 7) | function testCoversFunction2() {}
FILE: tests/Features/DatasetsTests.php
class Bar (line 127) | class Bar
FILE: tests/Features/DependsInheritance.php
class InheritanceTest (line 5) | class InheritanceTest extends TestCase
method foo (line 7) | public function foo()
FILE: tests/Features/DescriptionLess.php
function get (line 11) | function get(string $route)
type Gettable (line 16) | trait Gettable
method get (line 21) | public function get(string $route)
FILE: tests/Features/Expect/HigherOrder/methods.php
class HasMethods (line 109) | class HasMethods
method jsonString (line 111) | public function jsonString(): string
method name (line 116) | public function name()
method quantity (line 121) | public function quantity()
method multiply (line 126) | public function multiply($x, $y)
method attributes (line 131) | public function attributes()
method books (line 139) | public function books()
method newInstance (line 153) | public function newInstance()
FILE: tests/Features/Expect/HigherOrder/methodsAndProperties.php
class HasMethodsAndProperties (line 66) | class HasMethodsAndProperties
method books (line 83) | public function books()
method multiply (line 97) | public function multiply($x, $y)
method newInstance (line 102) | public function newInstance()
FILE: tests/Features/Expect/HigherOrder/properties.php
class HasProperties (line 82) | class HasProperties
FILE: tests/Features/Expect/pipes.php
class Number (line 10) | class Number
method __construct (line 12) | public function __construct(
class Char (line 19) | class Char
method __construct (line 21) | public function __construct(
class Symbol (line 28) | class Symbol
method __construct (line 30) | public function __construct(
class State (line 37) | class State
method __construct (line 43) | public function __construct()
method reset (line 48) | public function reset(): void
FILE: tests/Features/Expect/toBeIterable.php
function gen (line 19) | function gen(): iterable
FILE: tests/Features/Expect/toMatchSnapshot.php
method __construct (line 46) | public function __construct(protected string $snapshotable) {}
method __toString (line 48) | public function __toString()
method __construct (line 62) | public function __construct(protected string $snapshotable) {}
method toString (line 64) | public function toString()
method __construct (line 98) | public function __construct(protected string $snapshotable) {}
method toArray (line 100) | public function toArray()
method __construct (line 124) | public function __construct(protected string $snapshotable) {}
method toSnapshot (line 126) | public function toSnapshot()
FILE: tests/Features/Expect/toThrow.php
class CustomException (line 5) | class CustomException extends Exception {}
FILE: tests/Features/Helpers.php
function addUser (line 3) | function addUser()
class User (line 17) | class User
method getName (line 19) | public function getName()
function mockUser (line 25) | function mockUser()
FILE: tests/Fixtures/Arch/ToBeInvokable/IsInvokable/InvokableClass.php
class InvokableClass (line 7) | class InvokableClass
method __invoke (line 9) | public function __invoke(): void {}
FILE: tests/Fixtures/Arch/ToBeInvokable/IsInvokable/InvokableClassViaParent.php
class InvokableClassViaParent (line 7) | class InvokableClassViaParent extends ParentInvokableClass
FILE: tests/Fixtures/Arch/ToBeInvokable/IsInvokable/InvokableClassViaTrait.php
class InvokableClassViaTrait (line 7) | class InvokableClassViaTrait
FILE: tests/Fixtures/Arch/ToBeInvokable/IsInvokable/InvokableTrait.php
type InvokableTrait (line 7) | trait InvokableTrait
method __invoke (line 9) | public function __invoke(): void
FILE: tests/Fixtures/Arch/ToBeInvokable/IsInvokable/ParentInvokableClass.php
class ParentInvokableClass (line 7) | class ParentInvokableClass
method __invoke (line 9) | public function __invoke(): void {}
FILE: tests/Fixtures/Arch/ToBeInvokable/IsNotInvokable/IsNotInvokableClass.php
class IsNotInvokableClass (line 7) | class IsNotInvokableClass
method handle (line 9) | public function handle(): void {}
FILE: tests/Fixtures/Arch/ToHaveAttribute/Attributes/AsAttribute.php
class AsAttribute (line 9) | #[Attribute()]
FILE: tests/Fixtures/Arch/ToHaveAttribute/HaveAttribute/HaveAttributeClass.php
class HaveAttributeClass (line 9) | #[AsAttribute]
FILE: tests/Fixtures/Arch/ToHaveAttribute/NotHaveAttribute/NotHaveAttributeClass.php
class NotHaveAttributeClass (line 7) | class NotHaveAttributeClass {}
FILE: tests/Fixtures/Arch/ToHaveConstructor/HasConstructor/HasConstructor.php
class HasConstructor (line 7) | class HasConstructor
method __construct (line 9) | public function __construct() {}
FILE: tests/Fixtures/Arch/ToHaveConstructor/HasNoConstructor/HasNoConstructor.php
class HasNoConstructor (line 7) | class HasNoConstructor {}
FILE: tests/Fixtures/Arch/ToHaveDestructor/HasDestructor/HasDestructor.php
class HasDestructor (line 7) | class HasDestructor
method __destruct (line 9) | public function __destruct() {}
FILE: tests/Fixtures/Arch/ToHaveDestructor/HasNoDestructor/HasNoDestructor.php
class HasNoDestructor (line 7) | class HasNoDestructor {}
FILE: tests/Fixtures/Arch/ToHaveMethod/HasMethod/HasMethod.php
class HasMethod (line 7) | class HasMethod
method foo (line 9) | public function foo(): void {}
FILE: tests/Fixtures/Arch/ToHaveMethod/HasMethod/HasMethodTrait.php
type HasMethodTrait (line 7) | trait HasMethodTrait
method foo (line 9) | public function foo(): void {}
FILE: tests/Fixtures/Arch/ToHaveMethod/HasMethod/HasMethodViaParent.php
class HasMethodViaParent (line 7) | class HasMethodViaParent extends ParentHasMethodClass
FILE: tests/Fixtures/Arch/ToHaveMethod/HasMethod/HasMethodViaTrait.php
class HasMethodViaTrait (line 7) | class HasMethodViaTrait
FILE: tests/Fixtures/Arch/ToHaveMethod/HasMethod/ParentHasMethodClass.php
class ParentHasMethodClass (line 7) | class ParentHasMethodClass
method foo (line 9) | public function foo(): void {}
FILE: tests/Fixtures/Arch/ToHaveMethod/HasNoMethod/HasNoMethodClass.php
class HasNoMethodClass (line 7) | class HasNoMethodClass
method bar (line 9) | public function bar(): void {}
FILE: tests/Fixtures/Arch/ToHavePrefix/HasNoPrefix/ClassWithout.php
class ClassWithout (line 7) | class ClassWithout {}
FILE: tests/Fixtures/Arch/ToHavePrefix/HasPrefix/PrefixClassWith.php
class PrefixClassWith (line 7) | class PrefixClassWith {}
FILE: tests/Fixtures/Arch/ToHavePublicMethodsBesides/UserController.php
class UserController (line 7) | class UserController
method publicMethod (line 9) | public function publicMethod(): string
method protectedMethod (line 14) | protected function protectedMethod(): string
method privateMethod (line 19) | private function privateMethod(): string
FILE: tests/Fixtures/Arch/ToHaveSuffix/HasNoSuffix/ClassWithout.php
class ClassWithout (line 7) | class ClassWithout {}
FILE: tests/Fixtures/Arch/ToHaveSuffix/HasSuffix/ClassWithSuffix.php
class ClassWithSuffix (line 7) | class ClassWithSuffix {}
FILE: tests/Fixtures/Arch/ToUseStrictEquality/NotStrictEquality.php
class NotStrictEquality (line 7) | class NotStrictEquality
method test (line 9) | public function test(): void
FILE: tests/Fixtures/Arch/ToUseStrictEquality/StrictEquality.php
class StrictEquality (line 7) | class StrictEquality
method test (line 9) | public function test(): void
FILE: tests/Fixtures/Arch/ToUseStrictTypes/HasNoStrictType.php
class HasNoStrictType (line 5) | class HasNoStrictType {}
FILE: tests/Fixtures/Arch/ToUseStrictTypes/HasStrictType.php
class HasStrictType (line 7) | class HasStrictType {}
FILE: tests/Fixtures/Arch/ToUseStrictTypes/HasStrictTypeWithCommentsAbove.php
class HasStrictTypeWithCommentsAbove (line 11) | class HasStrictTypeWithCommentsAbove {}
FILE: tests/Fixtures/Covers/CoversClass1.php
class CoversClass1 (line 5) | class CoversClass1
method foo (line 7) | public function foo() {}
FILE: tests/Fixtures/Covers/CoversClass2.php
class CoversClass2 (line 5) | class CoversClass2 {}
FILE: tests/Fixtures/Covers/CoversClass3.php
class CoversClass3 (line 5) | class CoversClass3 {}
FILE: tests/Fixtures/Covers/CoversTrait.php
type CoversTrait (line 5) | trait CoversTrait {}
FILE: tests/Fixtures/Inheritance/Base/ExampleTest.php
class ExampleTest (line 7) | class ExampleTest extends TestCase
method test_example (line 9) | public function test_example()
FILE: tests/Fixtures/Inheritance/ExampleTest.php
class ExampleTest (line 5) | class ExampleTest extends Base\ExampleTest
method test_example (line 9) | public function test_example()
FILE: tests/Helpers.php
function myAssertTrue (line 8) | function myAssertTrue($value)
FILE: tests/Helpers/Helper.php
function myDirectoryAssertTrue (line 3) | function myDirectoryAssertTrue($value)
FILE: tests/PHPUnit/CustomAffixes/FolderWithAn@/ExampleTest.php
class MyCustomClassTest (line 6) | class MyCustomClassTest extends TestCase
method assertTrueIsTrue (line 8) | public function assertTrueIsTrue()
FILE: tests/PHPUnit/CustomTestCase/ChildTest.php
class ChildTest (line 7) | class ChildTest extends ParentTest
method getEntity (line 9) | private function getEntity(): bool
FILE: tests/PHPUnit/CustomTestCase/CustomTestCase.php
class CustomTestCase (line 11) | abstract class CustomTestCase extends TestCase
method assertCustomTrue (line 13) | public function assertCustomTrue()
FILE: tests/PHPUnit/CustomTestCase/ExecutedTest.php
class ExecutedTest (line 11) | class ExecutedTest extends TestCase
method test_that_gets_executed (line 15) | #[Test]
FILE: tests/PHPUnit/CustomTestCase/ParentTest.php
class ParentTest (line 12) | class ParentTest extends TestCase
method getEntity (line 14) | private function getEntity(): bool
method test_override_method (line 19) | #[Test]
FILE: tests/PHPUnit/CustomTestCaseInSubFolders/SubFolder/SubFolder/CustomTestCaseInSubFolder.php
class CustomTestCaseInSubFolder (line 9) | class CustomTestCaseInSubFolder extends TestCase
method assertCustomInSubFolderTrue (line 11) | public function assertCustomInSubFolderTrue()
FILE: tests/PHPUnit/CustomTestCaseInSubFolders/SubFolder2/UsesPerFile.php
type MyCustomTrait (line 5) | trait MyCustomTrait
method assertFalseIsFalse (line 7) | public function assertFalseIsFalse()
class MyCustomClass (line 13) | abstract class MyCustomClass extends TestCase
method assertTrueIsTrue (line 15) | public function assertTrueIsTrue()
FILE: tests/Pest.php
function helper_returns_string (line 80) | function helper_returns_string()
function removeAnsiEscapeSequences (line 87) | function removeAnsiEscapeSequences(string $input): ?string
FILE: tests/Unit/Overrides/ThrowableBuilder.php
method __construct (line 10) | public function __construct()
method toCollisionEditor (line 15) | public function toCollisionEditor(): Frame
FILE: tests/Unit/Support/Container.php
class ClassWithDependency (line 51) | class ClassWithDependency
method __construct (line 53) | public function __construct(Container $container) {}
class ClassWithSubDependency (line 56) | class ClassWithSubDependency
method __construct (line 58) | public function __construct(ClassWithDependency $param) {}
class ClassWithoutTypeParameter (line 61) | class ClassWithoutTypeParameter
method __construct (line 63) | public function __construct($param) {}
FILE: tests/Unit/Support/Reflection.php
class Asd (line 22) | class Asd
method getFoo (line 26) | public function getFoo()
type Zxc (line 32) | trait Zxc
method getBaz (line 36) | public function getBaz()
class Qwe (line 42) | class Qwe extends Asd
method getBar (line 48) | public function getBar()
FILE: tests/Visual/TeamCity.php
function normalize_windows_os_output (line 5) | function normalize_windows_os_output(string $text): string
Condensed preview — 560 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (970K chars).
[
{
"path": ".editorconfig",
"chars": 344,
"preview": "; This file is for unifying the coding style for different editors and IDEs.\n; More information at http://editorconfig.o"
},
{
"path": ".gitattributes",
"chars": 664,
"preview": "/docker export-ignore\n/docs export-ignore\n/tests export-ignore\n/sc"
},
{
"path": ".github/FUNDING.yml",
"chars": 120,
"preview": "# These are supported funding model platforms\n\ngithub: [nunomaduro]\ncustom: https://www.paypal.com/paypalme/enunomaduro\n"
},
{
"path": ".github/ISSUE_TEMPLATE/bug_report.yml",
"chars": 2121,
"preview": "name: Bug Report\ndescription: Report an Issue or Bug with the Pest\ntitle: \"[Bug]: \"\nlabels: [\"bug\"]\nbody:\n - type: mark"
},
{
"path": ".github/PULL_REQUEST_TEMPLATE.md",
"chars": 337,
"preview": "<!--\n- Fill in the form below correctly. This will help the Pest team to understand the PR and also work on it.\n-->\n\n###"
},
{
"path": ".github/workflows/static.yml",
"chars": 1695,
"preview": "name: Static Analysis\n\non:\n push:\n branches: [4.x]\n pull_request:\n schedule:\n - cron: '0 0 * * *'\n\nconcurrency:"
},
{
"path": ".github/workflows/tests.yml",
"chars": 2146,
"preview": "name: Tests\n\non:\n push:\n branches: [4.x]\n pull_request:\n\nconcurrency:\n group: tests-${{ github.workflow }}-${{ git"
},
{
"path": ".gitignore",
"chars": 208,
"preview": ".idea/*\n.idea/codeStyleSettings.xml\n.temp/*\ncomposer.lock\n/vendor/\ncoverage.xml\n.phpunit.result.cache\n.phpunit.cache\n/.p"
},
{
"path": "CONTRIBUTING.md",
"chars": 1752,
"preview": "# CONTRIBUTING\n\nContributions are welcome, and are accepted via pull requests.\nPlease review these guidelines before sub"
},
{
"path": "LICENSE.md",
"chars": 1097,
"preview": "The MIT License (MIT)\n\nCopyright (c) Nuno Maduro <enunomaduro@gmail.com>\n\nPermission is hereby granted, free of charge, "
},
{
"path": "README.md",
"chars": 3148,
"preview": "<p align=\"center\">\n <img src=\"https://raw.githubusercontent.com/pestphp/art/master/v4/social.png\" width=\"600\" alt=\"PE"
},
{
"path": "RELEASE.md",
"chars": 1051,
"preview": "# Release process\n\nWhen releasing a new version of Pest there are some checks and updates that need to be done:\n\n> **For"
},
{
"path": "bin/pest",
"chars": 5568,
"preview": "#!/usr/bin/env php\n<?php\n\ndeclare(strict_types=1);\n\nuse Pest\\Kernel;\nuse Pest\\Panic;\nuse Pest\\TestCaseFilters\\GitDirtyTe"
},
{
"path": "bin/worker.php",
"chars": 3630,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nuse ParaTest\\WrapperRunner\\ApplicationForWrapperWorker;\nuse ParaTest\\WrapperRunner\\Wrap"
},
{
"path": "composer.json",
"chars": 4038,
"preview": "{\n \"name\": \"pestphp/pest\",\n \"description\": \"The elegant PHP Testing Framework.\",\n \"keywords\": [\n \"php\",\n"
},
{
"path": "docker/Dockerfile",
"chars": 353,
"preview": "ARG PHP=8.1\nFROM php:${PHP}-cli-alpine\n\nRUN apk update && apk add \\\n zip libzip-dev icu-dev git\n\nRUN docker-php-ext-i"
},
{
"path": "extension.neon",
"chars": 116,
"preview": "parameters:\n universalObjectCratesClasses:\n - Pest\\Support\\HigherOrderTapProxy\n - Pest\\Expectation\n"
},
{
"path": "overrides/Event/Value/ThrowableBuilder.php",
"chars": 3127,
"preview": "<?php\n\n/*\n * BSD 3-Clause License\n *\n * Copyright (c) 2001-2023, Sebastian Bergmann\n * All rights reserved.\n *\n * Redist"
},
{
"path": "overrides/Logging/JUnit/JunitXmlLogger.php",
"chars": 13753,
"preview": "<?php\n\ndeclare(strict_types=1);\n/*\n * This file is part of PHPUnit.\n *\n * (c) Sebastian Bergmann <sebastian@phpunit.de>\n"
},
{
"path": "overrides/Runner/Filter/NameFilterIterator.php",
"chars": 6025,
"preview": "<?php\n\n/*\n * BSD 3-Clause License\n *\n * Copyright (c) 2001-2023, Sebastian Bergmann\n * All rights reserved.\n *\n * Redist"
},
{
"path": "overrides/Runner/ResultCache/DefaultResultCache.php",
"chars": 5875,
"preview": "<?php\n\n/*\n * BSD 3-Clause License\n *\n * Copyright (c) 2001-2023, Sebastian Bergmann\n * All rights reserved.\n *\n * Redist"
},
{
"path": "overrides/Runner/TestSuiteLoader.php",
"chars": 7313,
"preview": "<?php\n\n/*\n * BSD 3-Clause License\n *\n * Copyright (c) 2001-2023, Sebastian Bergmann\n * All rights reserved.\n *\n * Redist"
},
{
"path": "overrides/TextUI/Command/Commands/WarmCodeCoverageCacheCommand.php",
"chars": 3885,
"preview": "<?php\n\n/*\n * BSD 3-Clause License\n *\n * Copyright (c) 2001-2023, Sebastian Bergmann\n * All rights reserved.\n *\n * Redist"
},
{
"path": "overrides/TextUI/Output/Default/ProgressPrinter/Subscriber/TestSkippedSubscriber.php",
"chars": 2735,
"preview": "<?php\n\n/*\n * BSD 3-Clause License\n *\n * Copyright (c) 2001-2023, Sebastian Bergmann\n * All rights reserved.\n *\n * Redist"
},
{
"path": "overrides/TextUI/TestSuiteFilterProcessor.php",
"chars": 4698,
"preview": "<?php\n\n/*\n * BSD 3-Clause License\n *\n * Copyright (c) 2001-2023, Sebastian Bergmann\n * All rights reserved.\n *\n * Redist"
},
{
"path": "phpstan-baseline.neon",
"chars": 8334,
"preview": "parameters:\n\tignoreErrors:\n\t\t-\n\t\t\tmessage: '#^Parameter \\#1 of callable callable\\(Pest\\\\Expectation\\<string\\|null\\>\\)\\: "
},
{
"path": "phpstan.neon",
"chars": 199,
"preview": "includes:\n - phpstan-baseline.neon\n\nparameters:\n level: 7\n paths:\n - src\n\n reportUnmatchedIgnoredErro"
},
{
"path": "phpunit.xml",
"chars": 1019,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<phpunit xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n xsi:noNam"
},
{
"path": "rector.php",
"chars": 963,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nuse Rector\\CodingStyle\\Rector\\ArrowFunction\\ArrowFunctionDelegatingCallToFirstClassCall"
},
{
"path": "resources/base-phpunit.xml",
"chars": 1124,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<phpunit xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n xsi:noNam"
},
{
"path": "resources/views/components/badge.php",
"chars": 413,
"preview": "<?php\n\n/** @var string $type */\n/** @var string $content */\n[$bgBadgeColor, $bgBadgeText] = match ($type) {\n 'INFO' ="
},
{
"path": "resources/views/components/new-line.php",
"chars": 12,
"preview": "<div></div>\n"
},
{
"path": "resources/views/components/two-column-detail.php",
"chars": 332,
"preview": "<div class=\"flex mx-2 max-w-150\">\n <span>\n <?php echo htmlspecialchars($left) ?>\n </span>\n <span class=\""
},
{
"path": "resources/views/installers/plugin-browser.php",
"chars": 630,
"preview": "<div class=\"mx-2 mb-1\">\n <p>\n <span>Using the <span class=\"text-yellow font-bold\">visit()</span> function requ"
},
{
"path": "resources/views/usage.php",
"chars": 197,
"preview": "<div class=\"mx-2\">\n <span class=\"text-yellow font-bold\">USAGE:</span><span class=\"ml-1\">pest</span><span class=\"ml-1 "
},
{
"path": "resources/views/version.php",
"chars": 171,
"preview": "<div class=\"my-1 mx-2\">\n <span>Pest Testing Framework</span><span class=\"ml-1 text-blue font-bold\"><?php echo htmlspe"
},
{
"path": "src/ArchPresets/AbstractPreset.php",
"chars": 1784,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\ArchPresets;\n\nuse Pest\\Arch\\Contracts\\ArchExpectation;\nuse Pest\\Expectat"
},
{
"path": "src/ArchPresets/Custom.php",
"chars": 937,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\ArchPresets;\n\nuse Closure;\nuse Pest\\Arch\\Contracts\\ArchExpectation;\nuse "
},
{
"path": "src/ArchPresets/Laravel.php",
"chars": 5680,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\ArchPresets;\n\nuse Throwable;\n\n/**\n * @internal\n */\nfinal class Laravel e"
},
{
"path": "src/ArchPresets/Php.php",
"chars": 2717,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\ArchPresets;\n\n/**\n * @internal\n */\nfinal class Php extends AbstractPrese"
},
{
"path": "src/ArchPresets/Relaxed.php",
"chars": 646,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\ArchPresets;\n\nuse Pest\\Arch\\Contracts\\ArchExpectation;\nuse Pest\\Expectat"
},
{
"path": "src/ArchPresets/Security.php",
"chars": 762,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\ArchPresets;\n\n/**\n * @internal\n */\nfinal class Security extends Abstract"
},
{
"path": "src/ArchPresets/Strict.php",
"chars": 950,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\ArchPresets;\n\nuse Pest\\Arch\\Contracts\\ArchExpectation;\nuse Pest\\Expectat"
},
{
"path": "src/Bootstrappers/BootExcludeList.php",
"chars": 765,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Bootstrappers;\n\nuse Pest\\Contracts\\Bootstrapper;\nuse PHPUnit\\Util\\Exclud"
},
{
"path": "src/Bootstrappers/BootFiles.php",
"chars": 2481,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Bootstrappers;\n\nuse Pest\\Contracts\\Bootstrapper;\nuse Pest\\Exceptions\\Fat"
},
{
"path": "src/Bootstrappers/BootKernelDump.php",
"chars": 703,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Bootstrappers;\n\nuse Pest\\Contracts\\Bootstrapper;\nuse Pest\\KernelDump;\nus"
},
{
"path": "src/Bootstrappers/BootOverrides.php",
"chars": 1176,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Bootstrappers;\n\nuse Pest\\Contracts\\Bootstrapper;\nuse Pest\\Exceptions\\Sho"
},
{
"path": "src/Bootstrappers/BootSubscribers.php",
"chars": 1159,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Bootstrappers;\n\nuse Pest\\Contracts\\Bootstrapper;\nuse Pest\\Subscribers;\nu"
},
{
"path": "src/Bootstrappers/BootView.php",
"chars": 555,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Bootstrappers;\n\nuse Pest\\Contracts\\Bootstrapper;\nuse Pest\\Support\\View;\n"
},
{
"path": "src/Collision/Events.php",
"chars": 2733,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Collision;\n\nuse NunoMaduro\\Collision\\Adapters\\Phpunit\\TestResult;\nuse Pe"
},
{
"path": "src/Concerns/Expectable.php",
"chars": 383,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Concerns;\n\nuse Pest\\Expectation;\n\n/**\n * @internal\n */\ntrait Expectable\n"
},
{
"path": "src/Concerns/Extendable.php",
"chars": 673,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Concerns;\n\nuse Closure;\n\n/**\n * @internal\n *\n * @template T of object\n *"
},
{
"path": "src/Concerns/Logging/WritesToConsole.php",
"chars": 1033,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Concerns\\Logging;\n\n/**\n * @internal\n */\ntrait WritesToConsole\n{\n /**\n"
},
{
"path": "src/Concerns/Pipeable.php",
"chars": 1800,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Concerns;\n\nuse Closure;\n\n/**\n * @internal\n */\ntrait Pipeable\n{\n /**\n "
},
{
"path": "src/Concerns/Retrievable.php",
"chars": 691,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Concerns;\n\n/**\n * @internal\n */\ntrait Retrievable\n{\n /**\n * @temp"
},
{
"path": "src/Concerns/Testable.php",
"chars": 13893,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Concerns;\n\nuse Closure;\nuse Pest\\Exceptions\\DatasetArgumentsMismatch;\nus"
},
{
"path": "src/Configuration/Presets.php",
"chars": 330,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Configuration;\n\nuse Closure;\nuse Pest\\Preset;\n\nfinal class Presets\n{\n "
},
{
"path": "src/Configuration/Printer.php",
"chars": 346,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Configuration;\n\nuse NunoMaduro\\Collision\\Adapters\\Phpunit\\Printers\\Defau"
},
{
"path": "src/Configuration/Project.php",
"chars": 2274,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Configuration;\n\n/**\n * @internal\n */\nfinal class Project\n{\n /**\n "
},
{
"path": "src/Configuration.php",
"chars": 3178,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest;\n\nuse Pest\\PendingCalls\\BeforeEachCall;\nuse Pest\\PendingCalls\\UsesCall;\n"
},
{
"path": "src/Console/Help.php",
"chars": 1149,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Console;\n\nuse Symfony\\Component\\Console\\Output\\OutputInterface;\n\n/**\n * "
},
{
"path": "src/Console/Thanks.php",
"chars": 2636,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Console;\n\nuse Pest\\Bootstrappers\\BootView;\nuse Pest\\Support\\View;\nuse Sy"
},
{
"path": "src/Contracts/ArchPreset.php",
"chars": 105,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Contracts;\n\n/**\n * @internal\n */\ninterface ArchPreset {}\n"
},
{
"path": "src/Contracts/Bootstrapper.php",
"chars": 189,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Contracts;\n\n/**\n * @internal\n */\ninterface Bootstrapper\n{\n /**\n *"
},
{
"path": "src/Contracts/HasPrintableTestCaseName.php",
"chars": 278,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Contracts;\n\nuse NunoMaduro\\Collision\\Contracts\\Adapters\\Phpunit\\HasPrint"
},
{
"path": "src/Contracts/Panicable.php",
"chars": 368,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Contracts;\n\nuse Symfony\\Component\\Console\\Output\\OutputInterface;\n\n/**\n "
},
{
"path": "src/Contracts/Plugins/AddsOutput.php",
"chars": 232,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Contracts\\Plugins;\n\n/**\n * @internal\n */\ninterface AddsOutput\n{\n /**\n"
},
{
"path": "src/Contracts/Plugins/Bootable.php",
"chars": 187,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Contracts\\Plugins;\n\n/**\n * @internal\n */\ninterface Bootable\n{\n /**\n "
},
{
"path": "src/Contracts/Plugins/HandlesArguments.php",
"chars": 340,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Contracts\\Plugins;\n\n/**\n * @internal\n */\ninterface HandlesArguments\n{\n "
},
{
"path": "src/Contracts/Plugins/HandlesOriginalArguments.php",
"chars": 330,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Contracts\\Plugins;\n\n/**\n * @internal\n */\ninterface HandlesOriginalArgume"
},
{
"path": "src/Contracts/Plugins/Terminable.php",
"chars": 199,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Contracts\\Plugins;\n\n/**\n * @internal\n */\ninterface Terminable\n{\n /**\n"
},
{
"path": "src/Contracts/TestCaseFilter.php",
"chars": 207,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Contracts;\n\ninterface TestCaseFilter\n{\n /**\n * Whether the test c"
},
{
"path": "src/Contracts/TestCaseMethodFilter.php",
"chars": 269,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Contracts;\n\nuse Pest\\Factories\\TestCaseMethodFactory;\n\ninterface TestCas"
},
{
"path": "src/Evaluators/Attributes.php",
"chars": 846,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Evaluators;\n\nuse Pest\\Factories\\Attribute;\n\n/**\n * @internal\n */\nfinal c"
},
{
"path": "src/Exceptions/AfterAllAlreadyExist.php",
"chars": 634,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Exceptions;\n\nuse InvalidArgumentException;\nuse NunoMaduro\\Collision\\Cont"
},
{
"path": "src/Exceptions/AfterAllWithinDescribe.php",
"chars": 664,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Exceptions;\n\nuse InvalidArgumentException;\nuse NunoMaduro\\Collision\\Cont"
},
{
"path": "src/Exceptions/AfterBeforeTestFunction.php",
"chars": 666,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Exceptions;\n\nuse InvalidArgumentException;\nuse NunoMaduro\\Collision\\Cont"
},
{
"path": "src/Exceptions/BeforeAllAlreadyExist.php",
"chars": 636,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Exceptions;\n\nuse InvalidArgumentException;\nuse NunoMaduro\\Collision\\Cont"
},
{
"path": "src/Exceptions/BeforeAllWithinDescribe.php",
"chars": 666,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Exceptions;\n\nuse InvalidArgumentException;\nuse NunoMaduro\\Collision\\Cont"
},
{
"path": "src/Exceptions/DatasetAlreadyExists.php",
"chars": 658,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Exceptions;\n\nuse InvalidArgumentException;\nuse NunoMaduro\\Collision\\Cont"
},
{
"path": "src/Exceptions/DatasetArgumentsMismatch.php",
"chars": 521,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Exceptions;\n\nuse Exception;\n\nfinal class DatasetArgumentsMismatch extend"
},
{
"path": "src/Exceptions/DatasetDoesNotExist.php",
"chars": 681,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Exceptions;\n\nuse InvalidArgumentException;\nuse NunoMaduro\\Collision\\Cont"
},
{
"path": "src/Exceptions/DatasetMissing.php",
"chars": 994,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Exceptions;\n\nuse BadFunctionCallException;\nuse NunoMaduro\\Collision\\Cont"
},
{
"path": "src/Exceptions/ExpectationNotFound.php",
"chars": 386,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Exceptions;\n\nuse Exception;\n\n/**\n * @internal\n */\nfinal class Expectatio"
},
{
"path": "src/Exceptions/FatalException.php",
"chars": 247,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Exceptions;\n\nuse NunoMaduro\\Collision\\Contracts\\RenderlessTrace;\nuse Run"
},
{
"path": "src/Exceptions/FileOrFolderNotFound.php",
"chars": 642,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Exceptions;\n\nuse InvalidArgumentException;\nuse NunoMaduro\\Collision\\Cont"
},
{
"path": "src/Exceptions/InvalidArgumentException.php",
"chars": 613,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Exceptions;\n\nuse InvalidArgumentException as BaseInvalidArgumentExceptio"
},
{
"path": "src/Exceptions/InvalidExpectation.php",
"chars": 644,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Exceptions;\n\nuse LogicException;\nuse NunoMaduro\\Collision\\Contracts\\Rend"
},
{
"path": "src/Exceptions/InvalidExpectationValue.php",
"chars": 381,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Exceptions;\n\nuse InvalidArgumentException;\n\n/**\n * @internal\n */\nfinal c"
},
{
"path": "src/Exceptions/InvalidOption.php",
"chars": 566,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Exceptions;\n\nuse InvalidArgumentException;\nuse NunoMaduro\\Collision\\Cont"
},
{
"path": "src/Exceptions/InvalidPestCommand.php",
"chars": 586,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Exceptions;\n\nuse InvalidArgumentException;\nuse NunoMaduro\\Collision\\Cont"
},
{
"path": "src/Exceptions/MissingDependency.php",
"chars": 644,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Exceptions;\n\nuse InvalidArgumentException;\nuse NunoMaduro\\Collision\\Cont"
},
{
"path": "src/Exceptions/NoDirtyTestsFound.php",
"chars": 906,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Exceptions;\n\nuse InvalidArgumentException;\nuse NunoMaduro\\Collision\\Cont"
},
{
"path": "src/Exceptions/ShouldNotHappen.php",
"chars": 853,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Exceptions;\n\nuse Exception;\nuse RuntimeException;\n\n/**\n * @internal\n */\n"
},
{
"path": "src/Exceptions/TestAlreadyExist.php",
"chars": 685,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Exceptions;\n\nuse InvalidArgumentException;\nuse NunoMaduro\\Collision\\Cont"
},
{
"path": "src/Exceptions/TestCaseAlreadyInUse.php",
"chars": 768,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Exceptions;\n\nuse InvalidArgumentException;\nuse NunoMaduro\\Collision\\Cont"
},
{
"path": "src/Exceptions/TestCaseClassOrTraitNotFound.php",
"chars": 632,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Exceptions;\n\nuse InvalidArgumentException;\nuse NunoMaduro\\Collision\\Cont"
},
{
"path": "src/Exceptions/TestClosureMustNotBeStatic.php",
"chars": 857,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Exceptions;\n\nuse InvalidArgumentException;\nuse NunoMaduro\\Collision\\Cont"
},
{
"path": "src/Exceptions/TestDescriptionMissing.php",
"chars": 636,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Exceptions;\n\nuse InvalidArgumentException;\nuse NunoMaduro\\Collision\\Cont"
},
{
"path": "src/Expectation.php",
"chars": 35626,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest;\n\nuse Attribute;\nuse BadMethodCallException;\nuse Closure;\nuse InvalidArg"
},
{
"path": "src/Expectations/EachExpectation.php",
"chars": 1816,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Expectations;\n\nuse Pest\\Expectation;\n\nuse function expect;\n\n/**\n * @inte"
},
{
"path": "src/Expectations/HigherOrderExpectation.php",
"chars": 4773,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Expectations;\n\nuse Closure;\nuse Pest\\Concerns\\Retrievable;\nuse Pest\\Expe"
},
{
"path": "src/Expectations/OppositeExpectation.php",
"chars": 31670,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Expectations;\n\nuse Attribute;\nuse Pest\\Arch\\Contracts\\ArchExpectation;\nu"
},
{
"path": "src/Factories/Attribute.php",
"chars": 276,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Factories;\n\n/**\n * @internal\n */\nfinal class Attribute\n{\n /**\n * "
},
{
"path": "src/Factories/Concerns/HigherOrderable.php",
"chars": 820,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Factories\\Concerns;\n\nuse Pest\\Support\\HigherOrderMessageCollection;\n\ntra"
},
{
"path": "src/Factories/Covers/CoversClass.php",
"chars": 173,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Factories\\Covers;\n\n/**\n * @internal\n */\nfinal class CoversClass\n{\n pu"
},
{
"path": "src/Factories/Covers/CoversFunction.php",
"chars": 179,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Factories\\Covers;\n\n/**\n * @internal\n */\nfinal class CoversFunction\n{\n "
},
{
"path": "src/Factories/TestCaseFactory.php",
"chars": 7344,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Factories;\n\nuse ParseError;\nuse Pest\\Concerns;\nuse Pest\\Contracts\\HasPri"
},
{
"path": "src/Factories/TestCaseMethodFactory.php",
"chars": 6668,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Factories;\n\nuse Closure;\nuse Pest\\Evaluators\\Attributes;\nuse Pest\\Except"
},
{
"path": "src/Functions.php",
"chars": 10237,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nuse Pest\\Browser\\Api\\ArrayablePendingAwaitablePage;\nuse Pest\\Browser\\Api\\PendingAwaitab"
},
{
"path": "src/Installers/PluginBrowser.php",
"chars": 230,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Installers;\n\nuse Pest\\Support\\View;\n\nfinal readonly class PluginBrowser\n"
},
{
"path": "src/Kernel.php",
"chars": 4624,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest;\n\nuse NunoMaduro\\Collision\\Writer;\nuse Pest\\Contracts\\Bootstrapper;\nuse "
},
{
"path": "src/KernelDump.php",
"chars": 2529,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest;\n\nuse Pest\\Support\\View;\nuse Symfony\\Component\\Console\\Output\\OutputInte"
},
{
"path": "src/Logging/Converter.php",
"chars": 7753,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Logging;\n\nuse NunoMaduro\\Collision\\Adapters\\Phpunit\\State;\nuse Pest\\Exce"
},
{
"path": "src/Logging/TeamCity/ServiceMessage.php",
"chars": 3648,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Logging\\TeamCity;\n\n/**\n * @internal\n */\nfinal class ServiceMessage\n{\n "
},
{
"path": "src/Logging/TeamCity/Subscriber/Subscriber.php",
"chars": 517,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Logging\\TeamCity\\Subscriber;\n\nuse Pest\\Logging\\TeamCity\\TeamCityLogger;\n"
},
{
"path": "src/Logging/TeamCity/Subscriber/TestConsideredRiskySubscriber.php",
"chars": 415,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Logging\\TeamCity\\Subscriber;\n\nuse PHPUnit\\Event\\Test\\ConsideredRisky;\nus"
},
{
"path": "src/Logging/TeamCity/Subscriber/TestErroredSubscriber.php",
"chars": 367,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Logging\\TeamCity\\Subscriber;\n\nuse PHPUnit\\Event\\Test\\Errored;\nuse PHPUni"
},
{
"path": "src/Logging/TeamCity/Subscriber/TestExecutionFinishedSubscriber.php",
"chars": 439,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Logging\\TeamCity\\Subscriber;\n\nuse PHPUnit\\Event\\TestRunner\\ExecutionFini"
},
{
"path": "src/Logging/TeamCity/Subscriber/TestFailedSubscriber.php",
"chars": 361,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Logging\\TeamCity\\Subscriber;\n\nuse PHPUnit\\Event\\Test\\Failed;\nuse PHPUnit"
},
{
"path": "src/Logging/TeamCity/Subscriber/TestFinishedSubscriber.php",
"chars": 373,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Logging\\TeamCity\\Subscriber;\n\nuse PHPUnit\\Event\\Test\\Finished;\nuse PHPUn"
},
{
"path": "src/Logging/TeamCity/Subscriber/TestPreparedSubscriber.php",
"chars": 373,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Logging\\TeamCity\\Subscriber;\n\nuse PHPUnit\\Event\\Test\\Prepared;\nuse PHPUn"
},
{
"path": "src/Logging/TeamCity/Subscriber/TestSkippedSubscriber.php",
"chars": 367,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Logging\\TeamCity\\Subscriber;\n\nuse PHPUnit\\Event\\Test\\Skipped;\nuse PHPUni"
},
{
"path": "src/Logging/TeamCity/Subscriber/TestSuiteFinishedSubscriber.php",
"chars": 393,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Logging\\TeamCity\\Subscriber;\n\nuse PHPUnit\\Event\\TestSuite\\Finished;\nuse "
},
{
"path": "src/Logging/TeamCity/Subscriber/TestSuiteStartedSubscriber.php",
"chars": 387,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Logging\\TeamCity\\Subscriber;\n\nuse PHPUnit\\Event\\TestSuite\\Started;\nuse P"
},
{
"path": "src/Logging/TeamCity/TeamCityLogger.php",
"chars": 9332,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Logging\\TeamCity;\n\nuse NunoMaduro\\Collision\\Adapters\\Phpunit\\Style;\nuse "
},
{
"path": "src/Matchers/Any.php",
"chars": 99,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Matchers;\n\n/**\n * @internal\n */\nfinal class Any {}\n"
},
{
"path": "src/Mixins/Expectation.php",
"chars": 31160,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Mixins;\n\nuse BadMethodCallException;\nuse Closure;\nuse Countable;\nuse Dat"
},
{
"path": "src/Panic.php",
"chars": 1562,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest;\n\nuse NunoMaduro\\Collision\\Writer;\nuse Pest\\Exceptions\\TestDescriptionMi"
},
{
"path": "src/PendingCalls/AfterEachCall.php",
"chars": 2002,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\PendingCalls;\n\nuse Closure;\nuse Pest\\PendingCalls\\Concerns\\Describable;\n"
},
{
"path": "src/PendingCalls/BeforeEachCall.php",
"chars": 3298,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\PendingCalls;\n\nuse Closure;\nuse Pest\\Exceptions\\AfterBeforeTestFunction;"
},
{
"path": "src/PendingCalls/Concerns/Describable.php",
"chars": 467,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\PendingCalls\\Concerns;\n\nuse Pest\\Support\\Description;\n\n/**\n * @internal\n"
},
{
"path": "src/PendingCalls/DescribeCall.php",
"chars": 1823,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\PendingCalls;\n\nuse Closure;\nuse Pest\\Support\\Backtrace;\nuse Pest\\Support"
},
{
"path": "src/PendingCalls/TestCall.php",
"chars": 21999,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\PendingCalls;\n\nuse Closure;\nuse Pest\\Concerns\\Testable;\nuse Pest\\Excepti"
},
{
"path": "src/PendingCalls/UsesCall.php",
"chars": 4176,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\PendingCalls;\n\nuse Closure;\nuse NunoMaduro\\Collision\\Adapters\\Phpunit\\Pr"
},
{
"path": "src/Pest.php",
"chars": 229,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest;\n\nfunction version(): string\n{\n return '4.4.2';\n}\n\nfunction testDirec"
},
{
"path": "src/Plugin.php",
"chars": 599,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest;\n\nfinal class Plugin\n{\n /**\n * The lazy callables to be executed "
},
{
"path": "src/Plugins/Actions/CallsAddsOutput.php",
"chars": 651,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Plugins\\Actions;\n\nuse Pest\\Contracts\\Plugins;\nuse Pest\\Plugin\\Loader;\n\n/"
},
{
"path": "src/Plugins/Actions/CallsBoot.php",
"chars": 524,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Plugins\\Actions;\n\nuse Pest\\Contracts\\Plugins;\nuse Pest\\Plugin\\Loader;\n\n/"
},
{
"path": "src/Plugins/Actions/CallsHandleArguments.php",
"chars": 712,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Plugins\\Actions;\n\nuse Pest\\Contracts\\Plugins;\nuse Pest\\Plugin\\Loader;\n\n/"
},
{
"path": "src/Plugins/Actions/CallsHandleOriginalArguments.php",
"chars": 678,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Plugins\\Actions;\n\nuse Pest\\Contracts\\Plugins;\nuse Pest\\Plugin\\Loader;\n\n/"
},
{
"path": "src/Plugins/Actions/CallsTerminable.php",
"chars": 544,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Plugins\\Actions;\n\nuse Pest\\Contracts\\Plugins;\nuse Pest\\Plugin\\Loader;\n\n/"
},
{
"path": "src/Plugins/Bail.php",
"chars": 749,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Plugins;\n\nuse Pest\\Contracts\\Plugins\\HandlesArguments;\nuse Pest\\Plugins\\"
},
{
"path": "src/Plugins/Cache.php",
"chars": 1787,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Plugins;\n\nuse Pest\\Contracts\\Plugins\\HandlesArguments;\nuse Pest\\Plugins\\"
},
{
"path": "src/Plugins/Concerns/HandleArguments.php",
"chars": 1316,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Plugins\\Concerns;\n\n/**\n * @internal\n */\ntrait HandleArguments\n{\n /**\n"
},
{
"path": "src/Plugins/Configuration.php",
"chars": 2460,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Plugins;\n\nuse DOMDocument;\nuse Pest\\Contracts\\Plugins\\HandlesArguments;\n"
},
{
"path": "src/Plugins/Coverage.php",
"chars": 6072,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Plugins;\n\nuse Pest\\Contracts\\Plugins\\AddsOutput;\nuse Pest\\Contracts\\Plug"
},
{
"path": "src/Plugins/Environment.php",
"chars": 1056,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Plugins;\n\nuse Pest\\Contracts\\Plugins\\HandlesArguments;\n\n/**\n * @internal"
},
{
"path": "src/Plugins/Help.php",
"chars": 7773,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Plugins;\n\nuse Pest\\Contracts\\Plugins\\HandlesArguments;\nuse Pest\\Support\\"
},
{
"path": "src/Plugins/Init.php",
"chars": 3058,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Plugins;\n\nuse Composer\\InstalledVersions;\nuse Pest\\Console\\Thanks;\nuse P"
},
{
"path": "src/Plugins/Memory.php",
"chars": 1162,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Plugins;\n\nuse Pest\\Contracts\\Plugins\\AddsOutput;\nuse Pest\\Contracts\\Plug"
},
{
"path": "src/Plugins/Only.php",
"chars": 2302,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Plugins;\n\nuse Pest\\Contracts\\Plugins\\Terminable;\nuse Pest\\Factories\\Attr"
},
{
"path": "src/Plugins/Parallel/Contracts/HandlersWorkerArguments.php",
"chars": 279,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Plugins\\Parallel\\Contracts;\n\ninterface HandlersWorkerArguments\n{\n /**"
},
{
"path": "src/Plugins/Parallel/Handlers/Laravel.php",
"chars": 3076,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Plugins\\Parallel\\Handlers;\n\nuse Closure;\nuse Composer\\InstalledVersions;"
},
{
"path": "src/Plugins/Parallel/Handlers/Parallel.php",
"chars": 912,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Plugins\\Parallel\\Handlers;\n\nuse Pest\\Contracts\\Plugins\\HandlesArguments;"
},
{
"path": "src/Plugins/Parallel/Handlers/Pest.php",
"chars": 529,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Plugins\\Parallel\\Handlers;\n\nuse Pest\\Plugins\\Concerns\\HandleArguments;\nu"
},
{
"path": "src/Plugins/Parallel/Paratest/CleanConsoleOutput.php",
"chars": 704,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Plugins\\Parallel\\Paratest;\n\nuse Symfony\\Component\\Console\\Output\\Console"
},
{
"path": "src/Plugins/Parallel/Paratest/ResultPrinter.php",
"chars": 6444,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Plugins\\Parallel\\Paratest;\n\nuse ParaTest\\Options;\nuse Pest\\Plugins\\Paral"
},
{
"path": "src/Plugins/Parallel/Paratest/WrapperRunner.php",
"chars": 17344,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Plugins\\Parallel\\Paratest;\n\nuse const DIRECTORY_SEPARATOR;\n\nuse NunoMadu"
},
{
"path": "src/Plugins/Parallel/Support/CompactPrinter.php",
"chars": 4877,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Plugins\\Parallel\\Support;\n\nuse NunoMaduro\\Collision\\Adapters\\Phpunit\\Sta"
},
{
"path": "src/Plugins/Parallel.php",
"chars": 6030,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Plugins;\n\nuse ParaTest\\ParaTestCommand;\nuse Pest\\Contracts\\Plugins\\Handl"
},
{
"path": "src/Plugins/Printer.php",
"chars": 591,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Plugins;\n\nuse Pest\\Contracts\\Plugins\\HandlesArguments;\n\n/**\n * @internal"
},
{
"path": "src/Plugins/ProcessIsolation.php",
"chars": 564,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Plugins;\n\nuse Pest\\Contracts\\Plugins\\HandlesArguments;\nuse Pest\\Exceptio"
},
{
"path": "src/Plugins/Profile.php",
"chars": 664,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Plugins;\n\nuse Pest\\Contracts\\Plugins\\HandlesArguments;\nuse Pest\\Exceptio"
},
{
"path": "src/Plugins/Retry.php",
"chars": 842,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Plugins;\n\nuse Pest\\Contracts\\Plugins\\HandlesArguments;\nuse Pest\\Exceptio"
},
{
"path": "src/Plugins/Shard.php",
"chars": 4846,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Plugins;\n\nuse Pest\\Contracts\\Plugins\\AddsOutput;\nuse Pest\\Contracts\\Plug"
},
{
"path": "src/Plugins/Snapshot.php",
"chars": 800,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Plugins;\n\nuse Pest\\Contracts\\Plugins\\HandlesArguments;\nuse Pest\\Exceptio"
},
{
"path": "src/Plugins/Verbose.php",
"chars": 814,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Plugins;\n\nuse Pest\\Contracts\\Plugins\\HandlesArguments;\n\n/**\n * @internal"
},
{
"path": "src/Plugins/Version.php",
"chars": 586,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Plugins;\n\nuse Pest\\Contracts\\Plugins\\HandlesArguments;\nuse Pest\\Support\\"
},
{
"path": "src/Preset.php",
"chars": 3943,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest;\n\nuse Closure;\nuse Pest\\Arch\\Support\\Composer;\nuse Pest\\ArchPresets\\Abst"
},
{
"path": "src/Repositories/AfterAllRepository.php",
"chars": 1094,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Repositories;\n\nuse Closure;\nuse Pest\\Exceptions\\AfterAllAlreadyExist;\nus"
},
{
"path": "src/Repositories/AfterEachRepository.php",
"chars": 1517,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Repositories;\n\nuse Closure;\nuse Mockery;\nuse Pest\\PendingCalls\\AfterEach"
},
{
"path": "src/Repositories/BeforeAllRepository.php",
"chars": 1125,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Repositories;\n\nuse Closure;\nuse Pest\\Exceptions\\BeforeAllAlreadyExist;\nu"
},
{
"path": "src/Repositories/BeforeEachRepository.php",
"chars": 1471,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Repositories;\n\nuse Closure;\nuse Pest\\PendingCalls\\BeforeEachCall;\nuse Pe"
},
{
"path": "src/Repositories/DatasetsRepository.php",
"chars": 7197,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Repositories;\n\nuse Closure;\nuse Generator;\nuse Pest\\Exceptions\\DatasetAl"
},
{
"path": "src/Repositories/SnapshotRepository.php",
"chars": 4363,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Repositories;\n\nuse Pest\\Exceptions\\ShouldNotHappen;\nuse Pest\\TestSuite;\n"
},
{
"path": "src/Repositories/TestRepository.php",
"chars": 6410,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Repositories;\n\nuse Closure;\nuse Pest\\Contracts\\TestCaseFilter;\nuse Pest\\"
},
{
"path": "src/Result.php",
"chars": 990,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest;\n\nuse PHPUnit\\TestRunner\\TestResult\\TestResult;\nuse PHPUnit\\TextUI\\Confi"
},
{
"path": "src/Runner/Filter/EnsureTestCaseIsInitiatedFilter.php",
"chars": 792,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Runner\\Filter;\n\nuse Pest\\Contracts\\HasPrintableTestCaseName;\nuse PHPUnit"
},
{
"path": "src/Subscribers/EnsureConfigurationIsAvailable.php",
"chars": 525,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Subscribers;\n\nuse Pest\\Support\\Container;\nuse PHPUnit\\Event\\TestRunner\\C"
},
{
"path": "src/Subscribers/EnsureIgnorableTestCasesAreIgnored.php",
"chars": 1313,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Subscribers;\n\nuse PHPUnit\\Event\\TestRunner\\Started;\nuse PHPUnit\\Event\\Te"
},
{
"path": "src/Subscribers/EnsureKernelDumpIsFlushed.php",
"chars": 552,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Subscribers;\n\nuse Pest\\KernelDump;\nuse Pest\\Support\\Container;\nuse PHPUn"
},
{
"path": "src/Subscribers/EnsureTeamCityEnabled.php",
"chars": 1216,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Subscribers;\n\nuse Pest\\Logging\\Converter;\nuse Pest\\Logging\\TeamCity\\Team"
},
{
"path": "src/Support/Arr.php",
"chars": 2203,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Support;\n\n/**\n * @internal\n */\nfinal class Arr\n{\n /**\n * Checks i"
},
{
"path": "src/Support/Backtrace.php",
"chars": 3276,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Support;\n\nuse Pest\\Exceptions\\ShouldNotHappen;\n\n/**\n * @internal\n */\nfin"
},
{
"path": "src/Support/ChainableClosure.php",
"chars": 2263,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Support;\n\nuse Closure;\nuse Pest\\Exceptions\\ShouldNotHappen;\n\n/**\n * @int"
},
{
"path": "src/Support/Closure.php",
"chars": 821,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Support;\n\nuse Closure as BaseClosure;\nuse Pest\\Exceptions\\ShouldNotHappe"
},
{
"path": "src/Support/Container.php",
"chars": 2848,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Support;\n\nuse Pest\\Exceptions\\ShouldNotHappen;\nuse ReflectionClass;\nuse "
},
{
"path": "src/Support/Coverage.php",
"chars": 6238,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Support;\n\nuse Pest\\Exceptions\\ShouldNotHappen;\nuse SebastianBergmann\\Cod"
},
{
"path": "src/Support/DatasetInfo.php",
"chars": 945,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Support;\n\nuse function Pest\\testDirectory;\n\n/**\n * @internal\n */\nfinal c"
},
{
"path": "src/Support/Description.php",
"chars": 390,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Support;\n\nfinal readonly class Description implements \\Stringable\n{\n "
},
{
"path": "src/Support/ExceptionTrace.php",
"chars": 1373,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Support;\n\nuse Closure;\nuse PHPUnit\\Framework\\TestCase;\nuse Throwable;\n\n/"
},
{
"path": "src/Support/ExpectationPipeline.php",
"chars": 1670,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Support;\n\nuse Closure;\n\n/**\n * @internal\n */\nfinal class ExpectationPipe"
},
{
"path": "src/Support/Exporter.php",
"chars": 2068,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Support;\n\nuse SebastianBergmann\\Exporter\\Exporter as BaseExporter;\nuse S"
},
{
"path": "src/Support/HigherOrderCallables.php",
"chars": 1436,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Support;\n\nuse Closure;\nuse Pest\\Expectation;\n\n/**\n * @internal\n */\nfinal"
},
{
"path": "src/Support/HigherOrderMessage.php",
"chars": 2906,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Support;\n\nuse Closure;\nuse ReflectionClass;\nuse Throwable;\n\n/**\n * @inte"
},
{
"path": "src/Support/HigherOrderMessageCollection.php",
"chars": 1848,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Support;\n\n/**\n * @internal\n */\nfinal class HigherOrderMessageCollection\n"
},
{
"path": "src/Support/HigherOrderTapProxy.php",
"chars": 1471,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Support;\n\nuse PHPUnit\\Framework\\TestCase;\nuse ReflectionClass;\n\n/**\n * @"
},
{
"path": "src/Support/NullClosure.php",
"chars": 289,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Support;\n\nuse Closure;\n\n/**\n * @internal\n */\nfinal class NullClosure\n{\n "
},
{
"path": "src/Support/Reflection.php",
"chars": 9349,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Pest\\Support;\n\nuse Closure;\nuse InvalidArgumentException;\nuse Pest\\Exceptions"
}
]
// ... and 360 more files (download for full content)
About this extraction
This page contains the full source code of the pestphp/pest GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 560 files (870.5 KB), approximately 232.2k tokens, and a symbol index with 1136 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.