From c588824fb2a6614919b3f48fa1a024480fd5410d Mon Sep 17 00:00:00 2001 From: Norbert Orzechowicz Date: Thu, 3 Dec 2026 14:41:56 -0600 Subject: [PATCH] chore(flow-php/flow): replace pcov with turbocov - phpunit 13.3 with the turbocov coverage driver - turbocov nix derivation, coverage on PHP 8.6 - CI installs turbocov with PIE - expectExceptionMessage() renamed to expectExceptionMessageIsOrContains() - DSL functions and vendor directories excluded from coverage --- .github/actions/setup-php/action.yml | 13 +- .github/workflows/test.yml | 28 +- .nix/php/lib/pcov.ini.dist | 6 - .nix/pkgs/flow-php/package.nix | 14 +- .nix/pkgs/php-turbocov/package.nix | 19 + Justfile | 2 +- documentation/contributing/benchmarks.md | 4 +- documentation/contributing/environment.md | 8 +- documentation/contributing/nix.md | 17 +- phpbench.json.dist | 3 +- phpunit.xml.dist | 15 + shell.nix | 10 +- .../Avro/Tests/Integration/AvroTest.php | 2 +- .../IO/Loader/ChartJSLoaderTest.php | 4 +- .../IO/Extractor/CSVExtractorTest.php | 16 +- .../IO/Extractor/RustCSVOpenSourceTest.php | 2 +- .../Integration/IO/FileFormatContractTest.php | 4 +- .../CSV/Tests/Unit/IO/CSVDialectTest.php | 2 +- .../Unit/IO/Extractor/CSVReadOptionsTest.php | 2 +- .../Unit/IO/Extractor/CSVRecordResyncTest.php | 2 +- .../Unit/IO/Extractor/Detector/OptionTest.php | 2 +- .../Tests/Unit/IO/Loader/CSVLoaderTest.php | 4 +- .../Unit/IO/Loader/CSVWriteOptionsTest.php | 2 +- .../Dialects/MySQLKeySetExtractorTest.php | 4 +- .../PostgreSQLKeySetExtractorTest.php | 4 +- .../Dialects/SqliteKeySetExtractorTest.php | 2 +- .../IO/Extractor/DbalKeySetExtractorTest.php | 8 +- .../DbalLimitOffsetExtractorTest.php | 2 +- .../Integration/IO/Loader/DbalLoaderTest.php | 4 +- .../IO/Extractor/DbalKeySetExtractorTest.php | 14 +- .../IO/Extractor/DbalResultSchemaTest.php | 8 +- .../Extractor/Pagination/KeySetPageTest.php | 22 +- .../IO/Extractor/Pagination/KeySetTest.php | 2 +- .../IO/Extractor/Pagination/KeyValuesTest.php | 8 +- .../Unit/IO/Extractor/TypedColumnsTest.php | 4 +- .../Tests/Unit/Values/Schema/TypesMapTest.php | 14 +- .../IO/Extractor/ExcelExtractorTest.php | 22 +- .../IO/Extractor/ExcelFormatDetectorTest.php | 4 +- .../IO/Extractor/Sheet/OpenSheetTest.php | 2 +- .../IO/Extractor/Sheet/XlsxSheetRowsTest.php | 2 +- .../IO/Extractor/WorkbookSheetTest.php | 4 +- .../Integration/IO/Loader/ExcelLoaderTest.php | 4 +- .../Unit/Functions/SheetNameAssertionTest.php | 2 +- .../Unit/IO/Extractor/ExcelExtractorTest.php | 6 +- .../IO/Extractor/ExcelReadOptionsTest.php | 4 +- .../IO/Extractor/GoogleSheetExtractorTest.php | 8 +- .../Tests/Unit/IO/Extractor/ColumnsTest.php | 2 +- .../IO/Extractor/GoogleSheetExtractorTest.php | 12 +- .../IO/Extractor/GoogleSheetReaderTest.php | 4 +- .../Unit/IO/Extractor/SheetRangeTest.php | 2 +- .../PsrHttpClientPaginatedExtractorTest.php | 2 +- .../PsrHttpClientStaticExtractorTest.php | 4 +- .../Unit/IO/Extractor/HttpDecoderTest.php | 2 +- .../IO/Extractor/JsonExtractorTest.php | 16 +- .../IO/Extractor/JsonFileReaderTest.php | 6 +- .../IO/Extractor/JsonLinesExtractorTest.php | 8 +- .../Tests/Integration/RustJsonRefusalTest.php | 4 +- .../Unit/IO/Loader/JsonLinesLoaderTest.php | 2 +- .../Tests/Unit/IO/Loader/JsonLoaderTest.php | 4 +- .../Unit/IO/Loader/PhpJsonEncoderTest.php | 4 +- .../Unit/IO/Loader/RustJsonEncoderTest.php | 2 +- .../JsonSchema/ReferenceResolverTest.php | 14 +- .../Unit/IO/Schema/SchemaConverterTest.php | 30 +- .../IO/Extractor/ParquetExtractorTest.php | 4 +- .../Parquet/Tests/Integration/ParquetTest.php | 2 +- .../Integration/ProjectionPushdownTest.php | 2 +- .../Unit/IO/ConfiguredParquetEngineTest.php | 4 +- .../IO/Extractor/ParquetSourceFileTest.php | 2 +- .../IO/Extractor/PhpParquetOpenSourceTest.php | 4 +- .../Extractor/RustParquetOpenSourceTest.php | 2 +- .../Loader/ParquetFileWriterFactoryTest.php | 2 +- .../IO/Loader/RustParquetFileWriterTest.php | 4 +- .../Values/Schema/FlowToParquetSchemaTest.php | 6 +- .../PostgreSqlCursorExtractorTest.php | 2 +- .../PostgreSqlKeySetExtractorTest.php | 8 +- .../Extractor/Pagination/KeySetPageTest.php | 22 +- .../IO/Extractor/Pagination/KeyValuesTest.php | 8 +- .../Extractor/Pagination/PaginationTest.php | 2 +- .../PostgreSqlCursorExtractorTest.php | 14 +- .../PostgreSqlKeySetExtractorTest.php | 24 +- .../PostgreSqlLimitOffsetExtractorTest.php | 22 +- .../Tests/Unit/IO/Extractor/ReadQueryTest.php | 4 +- .../Unit/IO/Extractor/ResultSchemaTest.php | 2 +- .../Unit/IO/Loader/PostgreSqlLoaderTest.php | 8 +- .../QueryBuilder/DeleteQueryBuilderTest.php | 4 +- .../QueryBuilder/InsertQueryBuilderTest.php | 2 +- .../QueryBuilder/UpdateQueryBuilderTest.php | 4 +- .../Tests/Unit/IO/Loader/SealLoaderTest.php | 4 +- .../Values/Schema/SchemaConverterTest.php | 4 +- .../IO/Extractor/TextExtractorTest.php | 2 +- .../Tests/Unit/IO/Loader/TextEncoderTest.php | 6 +- .../IO/Extractor/XMLParserExtractorTest.php | 6 +- .../Unit/IO/Extractor/XMLNodeCursorTest.php | 2 +- .../Tests/Unit/IO/Loader/XMLEncoderTest.php | 4 +- .../XML/Tests/Unit/IO/Loader/XMLNodeTest.php | 2 +- .../Loader/XMLWriter/StringXMLWriterTest.php | 4 +- .../Integration/AsyncAWSS3FilesystemTest.php | 2 +- .../Tests/Unit/AsyncAWSS3FilesystemTest.php | 2 +- .../Tests/Unit/ConfiguredS3ClientTest.php | 8 +- .../AsyncAWS/Tests/Unit/OptionsTest.php | 2 +- .../Integration/AzureBlobFilesystemTest.php | 2 +- .../Tests/Unit/AzureBlobFilesystemTest.php | 2 +- .../Tests/Unit/ConfiguredBlobServiceTest.php | 10 +- .../Bridge/Azure/Tests/Unit/OptionsTest.php | 4 +- .../Tests/Integration/SFTPFilesystemTest.php | 4 +- .../Tests/Integration/SFTPLostSessionTest.php | 4 +- .../Tests/Unit/ConfiguredSFTPClientTest.php | 12 +- .../Bridge/SFTP/Tests/Unit/OptionsTest.php | 4 +- .../Tests/Unit/SFTPBlockLifecycleTest.php | 4 +- .../SFTP/Tests/Unit/SFTPFilesystemTest.php | 6 +- .../SFTP/Tests/Unit/SFTPPrivateKeyTest.php | 2 +- .../SFTP/Tests/Unit/WriteOffsetTest.php | 4 +- .../Tests/Unit/Config/RequestConfigTest.php | 8 +- .../Tests/Unit/Config/ResponseConfigTest.php | 8 +- .../Http/Tests/Unit/Sanitization/MaskTest.php | 4 +- .../Sanitization/SanitizerFactoryTest.php | 8 +- .../Tests/Unit/SeverityMapperTest.php | 2 +- .../Tests/Unit/FlowToOpenAPIConverterTest.php | 2 +- .../Tests/Unit/OpenAPIConverterTest.php | 2 +- .../Tests/Unit/OpenAPIToFlowConverterTest.php | 10 +- .../Tests/Unit/ConfigurationTest.php | 70 +- .../Tests/Unit/PSR18TraceableClientTest.php | 2 +- .../Tests/Unit/SeverityMapperTest.php | 2 +- .../Tests/Unit/RequestCarrierTest.php | 2 +- .../Tests/Integration/MountDecorationTest.php | 2 +- .../Tests/Unit/Command/FstabResolverTest.php | 2 +- .../Compiler/BuildFstabsPassTelemetryTest.php | 4 +- .../Compiler/BuildFstabsPassTest.php | 4 +- .../RegisterFilesystemFactoriesPassTest.php | 4 +- .../ResolveFilesystemArgumentsPassTest.php | 10 +- .../AsyncAwsS3FilesystemFactoryTest.php | 38 +- .../AzureBlobFilesystemFactoryTest.php | 38 +- .../Factory/MemoryFilesystemFactoryTest.php | 2 +- .../NativeLocalFilesystemFactoryTest.php | 2 +- .../Factory/StdoutFilesystemFactoryTest.php | 2 +- .../FilesystemFactoryRegistryTest.php | 10 +- .../Tests/Unit/QueryCarrierTest.php | 2 +- .../Tests/Unit/RequestCarrierTest.php | 2 +- .../Integration/FlowBufferedResponseTest.php | 2 +- .../Integration/FlowStreamedResponseTest.php | 2 +- .../Tests/Unit/DataStreamTest.php | 2 +- .../FlowPostgreSqlExtensionTest.php | 10 +- .../Profiler/FlowPostgreSqlProfilerTest.php | 2 +- .../ConnectionParametersFactoryTest.php | 4 +- .../DependencyInjection/ConfigurationTest.php | 4 +- .../FlowPostgreSqlTransportFactoryTest.php | 6 +- .../Profiler/QueryRecorderOptionsTest.php | 7 +- .../Tests/Unit/ConnectionTest.php | 2 +- .../Tests/Unit/FlowPostgreSqlSenderTest.php | 2 +- .../Unit/FlowPostgreSqlSessionHandlerTest.php | 6 +- .../FlowTelemetryExtensionTest.php | 16 +- .../Profiler/FlowTelemetryProfilerTest.php | 2 +- .../Compiler/ChannelLoggerPassTest.php | 6 +- .../DependencyInjection/ConfigurationTest.php | 32 +- .../TagAwareTraceableCacheAdapterTest.php | 4 +- .../Logger/ConsoleVerbosityLevelsTest.php | 4 +- .../AsyncCurlTransportOptionsTest.php | 10 +- .../Unit/Transport/AsyncCurlTransportTest.php | 6 +- .../Transport/CurlTransportOptionsTest.php | 8 +- .../Unit/Transport/CurlTransportTest.php | 8 +- .../Unit/Transport/GrpcTransportTest.php | 10 +- .../Unit/Transport/StreamTransportTest.php | 8 +- .../DatabaseTableListCommandTest.php | 2 +- .../DatabaseTableSchemaCommandTest.php | 2 +- .../Integration/FileConvertCommandTest.php | 4 +- .../Tests/Integration/FileReadCommandTest.php | 2 +- .../Integration/Options/ConfigOptionTest.php | 2 +- .../Integration/PipelineRunCommandTest.php | 4 +- .../Integration/SchemaFormatCommandTest.php | 2 +- .../Unit/Options/FileFormatOptionTest.php | 2 +- .../CLI/Tests/Unit/PipelineFactoryTest.php | 4 +- .../DataFrame/AliasedReferenceTest.php | 2 +- .../Integration/DataFrame/BranchingTest.php | 2 +- .../DataFrame/ConfigBuilderTest.php | 6 +- .../Integration/DataFrame/ConstraintTest.php | 10 +- .../Integration/DataFrame/EmptySourceTest.php | 4 +- .../Integration/DataFrame/FilterTest.php | 2 +- .../Tests/Integration/DataFrame/JoinTest.php | 2 +- .../Tests/Integration/DataFrame/LimitTest.php | 4 +- .../Integration/DataFrame/OffsetTest.php | 2 +- .../DataFrame/PartitioningTest.php | 4 +- .../Integration/DataFrame/PlanBindTest.php | 8 +- .../Integration/DataFrame/SinglePlanTest.php | 2 +- .../TemporalStringComparisonTest.php | 4 +- ...ransformedBranchBlockingOperationsTest.php | 2 +- .../Functions/ArrayKeysStyleConvertTest.php | 2 +- .../IO/Extractor/CacheExtractorTest.php | 4 +- .../IO/Extractor/FileSourceFilesystemTest.php | 2 +- .../IO/Filesystem/ConfigIsolationTest.php | 4 +- .../IO/Filesystem/FileWritePropertiesTest.php | 4 +- .../Integration/IO/Floe/FloeExtractorTest.php | 2 +- .../Loader/File/FileCommit/FileCommitTest.php | 2 +- .../Partitioned/PartitionPlaceholdersTest.php | 2 +- .../Integration/Pipeline/PipelineTest.php | 6 +- .../Storage/Floe/FloeWriteContractTest.php | 2 +- .../Window/WindowFunctionsTest.php | 2 +- .../Bucketing/BucketingConfigBuilderTest.php | 6 +- .../API/Config/Join/HashJoinBuilderTest.php | 2 +- .../Config/Sort/ExternalSortBuilderTest.php | 2 +- .../Flow/ETL/Tests/Unit/API/DataFrameTest.php | 24 +- .../Tests/Unit/API/GroupedDataFrameTest.php | 6 +- .../ETL/Tests/Unit/API/TransactionalTest.php | 4 +- .../Unit/API/Transformation/AggregateTest.php | 2 +- .../Unit/API/Transformation/BatchByTest.php | 2 +- .../Unit/Comparator/ColumnComparatorTest.php | 4 +- .../Unit/Comparator/RowsComparatorTest.php | 2 +- .../Unit/Context/CacheDirContextTest.php | 4 +- .../ETL/Tests/Unit/DSL/ArrayToRowsTest.php | 6 +- .../Unit/DSL/DateIntervalFunctionsTest.php | 6 +- .../Tests/Unit/DSL/DefinitionFromTypeTest.php | 6 +- .../Foundation/Calculator/CalculatorTest.php | 10 +- .../Calculator/NumberNormalizerTest.php | 4 +- .../Clock/HighResolutionTimeTest.php | 2 +- .../Describe/ConfiguredFilesystemTest.php | 2 +- .../Describe/DescribableRoundTripTest.php | 2 +- .../Foundation/Describe/DescriptionTest.php | 8 +- .../Unit/Foundation/Describe/JsonTest.php | 4 +- .../Unit/Foundation/Describe/RebuildTest.php | 12 +- .../Unit/Foundation/FlowPhpExtensionTest.php | 6 +- .../Foundation/Hash/HashAlgorithmTest.php | 2 +- .../AllFunctionsDeclareTheirTypeTest.php | 2 +- .../ETL/Tests/Unit/Functions/AppendTest.php | 4 +- .../Tests/Unit/Functions/ArrayExpandTest.php | 4 +- .../Tests/Unit/Functions/ArrayFilterTest.php | 6 +- .../Unit/Functions/ArrayGetCollectionTest.php | 8 +- .../ETL/Tests/Unit/Functions/ArrayGetTest.php | 20 +- .../Tests/Unit/Functions/ArrayKeepTest.php | 6 +- .../Unit/Functions/ArrayKeyRenameTest.php | 4 +- .../Functions/ArrayKeysStyleConverterTest.php | 8 +- .../Tests/Unit/Functions/ArrayKeysTest.php | 8 +- .../Functions/ArrayMergeCollectionTest.php | 8 +- .../Tests/Unit/Functions/ArrayMergeTest.php | 10 +- .../Tests/Unit/Functions/ArrayReverseTest.php | 6 +- .../Tests/Unit/Functions/ArraySortTest.php | 6 +- .../Tests/Unit/Functions/ArrayUnpackTest.php | 4 +- .../Tests/Unit/Functions/ArrayValuesTest.php | 8 +- .../ETL/Tests/Unit/Functions/AsciiTest.php | 2 +- .../ETL/Tests/Unit/Functions/BetweenTest.php | 8 +- .../Unit/Functions/BinaryComparisonsTest.php | 2 +- .../Tests/Unit/Functions/BinaryLengthTest.php | 2 +- .../Tests/Unit/Functions/CallUserFuncTest.php | 2 +- .../Tests/Unit/Functions/CapitalizeTest.php | 2 +- .../ETL/Tests/Unit/Functions/CastTest.php | 20 +- .../ETL/Tests/Unit/Functions/ChunkTest.php | 8 +- .../ETL/Tests/Unit/Functions/CoalesceTest.php | 4 +- .../Unit/Functions/CodePointLengthTest.php | 2 +- .../Unit/Functions/CollapseWhitespaceTest.php | 2 +- .../ETL/Tests/Unit/Functions/CombineTest.php | 18 +- .../Tests/Unit/Functions/ComparisonTest.php | 8 +- .../DOMElementAttributeValueTest.php | 2 +- .../DOMElementAttributesCountTest.php | 2 +- .../DOMElementNamespaceValueTest.php | 2 +- .../Unit/Functions/DOMElementParentTest.php | 4 +- .../Unit/Functions/DateTimeFormatTest.php | 2 +- .../Tests/Unit/Functions/DenseRankTest.php | 4 +- .../Tests/Unit/Functions/EnsureEndTest.php | 2 +- .../Tests/Unit/Functions/EnsureStartTest.php | 2 +- .../ETL/Tests/Unit/Functions/EnumNameTest.php | 2 +- .../Tests/Unit/Functions/EnumValueTest.php | 4 +- .../Unit/Functions/Evaluation/FilterTest.php | 4 +- .../Unit/Functions/ExpandingFunctionsTest.php | 4 +- .../ETL/Tests/Unit/Functions/GreatestTest.php | 4 +- .../Functions/HTMLQuerySelectorAllTest.php | 2 +- .../Unit/Functions/HTMLQuerySelectorTest.php | 2 +- .../Tests/Unit/Functions/IndexOfLastTest.php | 4 +- .../ETL/Tests/Unit/Functions/IndexOfTest.php | 4 +- .../ETL/Tests/Unit/Functions/IsInTest.php | 8 +- .../Unit/Functions/Join/Condition/AllTest.php | 2 +- .../Unit/Functions/Join/Condition/AnyTest.php | 2 +- .../Functions/Join/Condition/EqualTest.php | 2 +- .../Tests/Unit/Functions/JsonDecodeTest.php | 8 +- .../ETL/Tests/Unit/Functions/LeastTest.php | 4 +- .../ETL/Tests/Unit/Functions/LiteralTest.php | 4 +- .../Tests/Unit/Functions/LiteralValueTest.php | 2 +- .../Tests/Unit/Functions/MatchCasesTest.php | 8 +- .../ETL/Tests/Unit/Functions/MathTest.php | 4 +- .../ETL/Tests/Unit/Functions/MinusTest.php | 6 +- .../Unit/Functions/ModifyDateTimeTest.php | 4 +- .../ETL/Tests/Unit/Functions/MultiplyTest.php | 6 +- .../Tests/Unit/Functions/MultisetHashTest.php | 6 +- .../Functions/MultisetHashesByGroupTest.php | 6 +- .../Flow/ETL/Tests/Unit/Functions/NowTest.php | 2 +- .../Tests/Unit/Functions/NumberFormatTest.php | 6 +- .../Functions/OnEachElementSchemaTest.php | 6 +- .../ETL/Tests/Unit/Functions/OnEachTest.php | 8 +- .../Tests/Unit/Functions/ParameterTest.php | 2 +- .../ETL/Tests/Unit/Functions/PlusTest.php | 4 +- .../ETL/Tests/Unit/Functions/PowerTest.php | 12 +- .../ETL/Tests/Unit/Functions/PrependTest.php | 2 +- .../ETL/Tests/Unit/Functions/RankTest.php | 4 +- .../Unit/Functions/ReferenceResolverTest.php | 10 +- .../ETL/Tests/Unit/Functions/RegexAllTest.php | 8 +- .../Unit/Functions/RegexMatchAllTest.php | 6 +- .../Tests/Unit/Functions/RegexMatchTest.php | 4 +- .../Tests/Unit/Functions/RegexReplaceTest.php | 8 +- .../ETL/Tests/Unit/Functions/RegexTest.php | 12 +- .../ETL/Tests/Unit/Functions/RepeatTest.php | 8 +- .../ETL/Tests/Unit/Functions/ReverseTest.php | 2 +- .../ETL/Tests/Unit/Functions/RoundTest.php | 6 +- .../ETL/Tests/Unit/Functions/RowHashTest.php | 6 +- .../ETL/Tests/Unit/Functions/SanitizeTest.php | 4 +- .../ETL/Tests/Unit/Functions/SlugTest.php | 2 +- .../ETL/Tests/Unit/Functions/SplitTest.php | 8 +- .../ETL/Tests/Unit/Functions/SprintfTest.php | 4 +- .../ETL/Tests/Unit/Functions/StrPadTest.php | 2 +- .../Tests/Unit/Functions/StrReplaceTest.php | 4 +- .../Unit/Functions/StringAfterLastTest.php | 2 +- .../Tests/Unit/Functions/StringAfterTest.php | 2 +- .../Unit/Functions/StringBeforeLastTest.php | 2 +- .../Tests/Unit/Functions/StringBeforeTest.php | 2 +- .../Unit/Functions/StringContainsAnyTest.php | 2 +- .../Tests/Unit/Functions/StringFoldTest.php | 2 +- .../Unit/Functions/StringMatchAllTest.php | 4 +- .../Tests/Unit/Functions/StringMatchTest.php | 4 +- .../Unit/Functions/StringNormalizeTest.php | 2 +- .../Tests/Unit/Functions/StringStyleTest.php | 2 +- .../Tests/Unit/Functions/StringTitleTest.php | 2 +- .../Tests/Unit/Functions/StringWidthTest.php | 2 +- .../Unit/Functions/StructureSelectTest.php | 2 +- .../Tests/Unit/Functions/StructureTest.php | 8 +- .../Unit/Functions/StructureValuesTest.php | 2 +- .../ETL/Tests/Unit/Functions/ToDateTest.php | 4 +- .../Tests/Unit/Functions/ToDateTimeTest.php | 2 +- .../ETL/Tests/Unit/Functions/ToLowerTest.php | 2 +- .../Tests/Unit/Functions/ToTimeZoneTest.php | 6 +- .../ETL/Tests/Unit/Functions/ToUpperTest.php | 2 +- .../ETL/Tests/Unit/Functions/TrimTest.php | 2 +- .../ETL/Tests/Unit/Functions/TruncateTest.php | 2 +- .../ETL/Tests/Unit/Functions/UlidTest.php | 2 +- .../Unit/Functions/UnicodeLengthTest.php | 2 +- .../ETL/Tests/Unit/Functions/UuidTest.php | 2 +- .../ETL/Tests/Unit/Functions/WhenTest.php | 2 +- .../Unit/Functions/Window/FrameBoundTest.php | 12 +- .../ETL/Tests/Unit/Functions/WordwrapTest.php | 2 +- .../Unit/IO/Extractor/ArrayExtractorTest.php | 22 +- .../Unit/IO/Extractor/ChainExtractorTest.php | 2 +- .../Tests/Unit/IO/Extractor/CriteriaTest.php | 10 +- .../Unit/IO/Extractor/File/ByteUnitTest.php | 2 +- .../IO/Extractor/File/DerivedSchemaTest.php | 2 +- .../IO/Extractor/File/FileColumnsTest.php | 6 +- .../Unit/IO/Extractor/File/FileSplitTest.php | 6 +- .../Extractor/File/FooterStatisticsTest.php | 2 +- .../IO/Extractor/File/InferredColumnsTest.php | 2 +- .../IO/Extractor/File/PartitionTypesTest.php | 4 +- .../Unit/IO/Extractor/File/ReadWindowTest.php | 4 +- .../Unit/IO/Extractor/File/RowRangeTest.php | 4 +- .../IO/Extractor/File/SkippedRowsTest.php | 2 +- .../IO/Extractor/FileListingExtractorTest.php | 2 +- .../IO/Extractor/Memory/SpilledRowsTest.php | 6 +- .../Unit/IO/Extractor/RowsExtractorTest.php | 2 +- .../IO/Extractor/SequenceExtractorTest.php | 6 +- .../NumberSequenceGeneratorTest.php | 4 +- .../Filesystem/ScalarFunctionFilterTest.php | 4 +- .../Tests/Unit/IO/Floe/FloeExtractorTest.php | 6 +- .../ETL/Tests/Unit/IO/Floe/FloeLoaderTest.php | 4 +- .../Schema/PHPFormatter/TypeFormatterTest.php | 2 +- .../Unit/IO/Inference/ColumnTypesTest.php | 2 +- .../Unit/IO/Inference/InferredTypesTest.php | 4 +- .../Tests/Unit/IO/Inference/SampleTest.php | 2 +- .../Inference/SchemaInferenceBuilderTest.php | 8 +- .../Unit/IO/Inference/SchemaInferenceTest.php | 2 +- .../Unit/IO/Inference/SniffedColumnsTest.php | 2 +- .../Unit/IO/Loader/File/FileCommitTest.php | 16 +- .../Unit/IO/Loader/File/FileWriteTest.php | 2 +- .../Tests/Unit/IO/Loader/File/PartTest.php | 4 +- .../IO/Loader/File/PartitionRouterTest.php | 4 +- .../Tests/Unit/IO/Loader/PartitioningTest.php | 2 +- .../Unit/IO/Loader/RowPartitionsTest.php | 6 +- .../IO/Loader/SchemaValidationLoaderTest.php | 4 +- .../Tests/Unit/IO/Loader/StreamLoaderTest.php | 2 +- .../Kernels/Bucketing/HashBucketingTest.php | 4 +- .../Unit/Kernels/HashJoin/JoinerTest.php | 4 +- .../Unit/Kernels/Sort/ExternalSortTest.php | 2 +- .../Operators/GroupBy/AggregatorsTest.php | 4 +- .../GroupBy/DeclaredPivotValuesTest.php | 4 +- .../GroupBy/DiscoveredPivotValuesTest.php | 10 +- .../Operators/GroupBy/GroupByShapeTest.php | 4 +- .../Unit/Operators/GroupBy/PivotShapeTest.php | 6 +- .../Operators/GroupBy/PivotedTableTest.php | 2 +- .../ETL/Tests/Unit/Operators/GroupByTest.php | 12 +- .../Unit/Operators/Join/CrossJoinTest.php | 2 +- .../Unit/Operators/Join/HashJoinTest.php | 2 +- .../Processor/BatchingByProcessorTest.php | 4 +- .../Processor/BatchingProcessorTest.php | 2 +- .../Processor/BoundExpansionTest.php | 2 +- .../Processor/ConstrainedProcessorTest.php | 2 +- .../Processor/DistinctProcessorTest.php | 2 +- .../Processor/ExpandingProcessorTest.php | 10 +- .../Processor/OffsetProcessorTest.php | 2 +- .../Processor/PivotProcessorTest.php | 4 +- .../Operators/Processor/TopNProcessorTest.php | 4 +- .../Processor/WindowProcessorTest.php | 6 +- .../AddRowIndexTransformerTest.php | 2 +- .../Transformer/DerivedColumnsTest.php | 2 +- .../DuplicateRowTransformerTest.php | 8 +- .../JoinEachRowsTransformerTest.php | 8 +- .../Transformer/LimitTransformerTest.php | 2 +- .../RenameEachColumnTransformerTest.php | 2 +- .../ScalarFunctionFilterTransformerTest.php | 6 +- .../ScalarFunctionTransformerTest.php | 10 +- .../SelectColumnsTransformerTest.php | 6 +- .../UnserializeTransformerTest.php | 2 +- .../Transformer/UntilTransformerTest.php | 4 +- .../Unit/Planning/Logical/LogicalPlanTest.php | 10 +- .../Planning/Logical/Node/BatchByTest.php | 2 +- .../Planning/Logical/Node/CrossJoinTest.php | 4 +- .../Planning/Logical/Node/DistinctTest.php | 2 +- .../Unit/Planning/Logical/Node/JoinTest.php | 4 +- .../Unit/Planning/Logical/Node/LimitTest.php | 2 +- .../Unit/Planning/Logical/Node/OffsetTest.php | 2 +- .../Planning/Logical/Node/OutputsTest.php | 6 +- .../Unit/Planning/Logical/Node/ReadTest.php | 8 +- .../Planning/Logical/Node/RenameEachTest.php | 2 +- .../Unit/Planning/Logical/Node/TopNTest.php | 2 +- .../Planning/Logical/Node/TransactionTest.php | 4 +- .../Planning/Logical/ReplaceNodesTest.php | 8 +- .../Unit/Planning/Optimizer/OptimizerTest.php | 6 +- .../Rule/PushFilterIntoSourceTest.php | 4 +- .../Rule/PushLimitIntoSourceTest.php | 4 +- .../Planning/Physical/NodeTranslatorTest.php | 4 +- .../Planning/Physical/PhysicalPlanTest.php | 2 +- .../Planning/Physical/PlannedNodesTest.php | 2 +- .../Unit/Planning/Physical/PlannerTest.php | 12 +- .../Planning/Physical/WritePlannerTest.php | 8 +- .../ErrorHandler/ErrorHandlingTest.php | 2 +- .../Unit/Runtime/Executor/ExecutorTest.php | 4 +- .../Executor/PartitionedOutputHasherTest.php | 10 +- .../Unit/Runtime/Executor/RunCountsTest.php | 6 +- .../Unit/Runtime/Executor/StepRunnerTest.php | 4 +- .../Executor/WholeOutputHasherTest.php | 2 +- .../Runtime/Heartbeat/HeartbeatStageTest.php | 2 +- .../Heartbeat/ScheduledHeartbeatTest.php | 4 +- .../Unit/Runtime/Metrics/DatasetHashTest.php | 12 +- .../Tests/Unit/Runtime/Metrics/HashTest.php | 4 +- .../Runtime/Metrics/PartitionHashTest.php | 6 +- .../Metrics/Statistics/ColumnsTest.php | 2 +- .../Telemetry/TraceableRowsStorageTest.php | 2 +- .../Unit/Storage/ApcuRowsStorageTest.php | 2 +- .../Storage/FilesystemRowsStorageTest.php | 2 +- .../Tests/Unit/Storage/Floe/FloeFilesTest.php | 46 +- .../Unit/Storage/Floe/FloeMergerTest.php | 18 +- .../Unit/Storage/Floe/FloeSerializerTest.php | 10 +- .../Storage/Floe/FloeStreamReaderTest.php | 2 +- .../Storage/Floe/FloeStreamWriterTest.php | 18 +- .../Unit/Storage/Floe/FooterReaderTest.php | 10 +- .../Storage/Floe/FooterStatisticsTest.php | 4 +- .../Tests/Unit/Storage/Floe/FooterTest.php | 10 +- .../Tests/Unit/Storage/Floe/FormatTest.php | 14 +- .../Unit/Storage/Memory/ArrayMemoryTest.php | 6 +- .../Tests/Unit/Storage/PsrRowsStorageTest.php | 2 +- .../ETL/Tests/Unit/Values/BatchSizeTest.php | 2 +- .../ETL/Tests/Unit/Values/CardinalityTest.php | 6 +- .../Values/Column/AdaptiveBackendTest.php | 4 +- .../Values/Column/CanonicalEncodingTest.php | 4 +- .../Unit/Values/Column/ColumnConcatTest.php | 2 +- .../Unit/Values/Column/ColumnWithTypeTest.php | 12 +- .../Column/Layout/BooleanLayoutTest.php | 4 +- .../Values/Column/Layout/BufferLayoutTest.php | 8 +- .../Unit/Values/Column/Layout/BuffersTest.php | 2 +- .../Column/Layout/FixedBinary16LayoutTest.php | 4 +- .../Column/Layout/Float64LayoutTest.php | 4 +- .../Values/Column/Layout/Int32LayoutTest.php | 4 +- .../Values/Column/Layout/Int64LayoutTest.php | 2 +- .../Unit/Values/Column/Layout/OffsetsTest.php | 10 +- .../Values/Column/Layout/Utf8LayoutTest.php | 2 +- .../Values/Column/Layout/ValidityTest.php | 2 +- .../Unit/Values/Column/MultisetDigestTest.php | 2 +- .../Column/Php/CastingColumnBuilderTest.php | 10 +- .../Values/Column/Php/ColumnDecoderTest.php | 10 +- .../Values/Column/Php/ConstantColumnTest.php | 2 +- .../Unit/Values/Column/Php/ListColumnTest.php | 2 +- .../Unit/Values/Column/Php/MapColumnTest.php | 2 +- .../Column/Php/PhpGroupedCountsTest.php | 2 +- .../Php/PhpGroupedMultisetHashesTest.php | 2 +- .../Column/Php/PhpGroupedTotalsTest.php | 2 +- .../Unit/Values/Column/PhpBackendTest.php | 44 +- .../Column/Physical/DatePhysicalTest.php | 2 +- .../Column/Physical/DateTimePhysicalTest.php | 2 +- .../Physical/HtmlElementPhysicalTest.php | 4 +- .../Column/Physical/PhysicalForTest.php | 6 +- .../Column/Physical/TimePhysicalTest.php | 6 +- .../Physical/XmlDocumentPhysicalTest.php | 2 +- .../Physical/XmlElementPhysicalTest.php | 2 +- .../Tests/Unit/Values/Column/RetypeTest.php | 2 +- .../Unit/Values/Column/TextValuesTest.php | 2 +- .../Unit/Values/Column/ValueColumnTest.php | 6 +- .../Unit/Values/Column/ValueEqualityTest.php | 10 +- .../Unit/Values/Grouping/GroupTableTest.php | 2 +- .../Unit/Values/Grouping/KeyEncoderTest.php | 2 +- .../ETL/Tests/Unit/Values/Memory/UnitTest.php | 2 +- .../Unit/Values/Rows/RecordBatchTest.php | 8 +- .../Unit/Values/Rows/RowsBuilderTest.php | 48 +- .../Flow/ETL/Tests/Unit/Values/RowsTest.php | 60 +- .../Definition/BooleanDefinitionTest.php | 2 +- .../Schema/Definition/DateDefinitionTest.php | 2 +- .../Definition/DateTimeDefinitionTest.php | 2 +- .../Schema/Definition/EnumDefinitionTest.php | 2 +- .../Schema/Definition/FloatDefinitionTest.php | 2 +- .../Schema/Definition/HTMLDefinitionTest.php | 2 +- .../Definition/HTMLElementDefinitionTest.php | 2 +- .../Definition/IntegerDefinitionTest.php | 2 +- .../Schema/Definition/JsonDefinitionTest.php | 4 +- .../Schema/Definition/ListDefinitionTest.php | 4 +- .../Schema/Definition/MapDefinitionTest.php | 4 +- .../Schema/Definition/NullDefinitionTest.php | 2 +- .../Definition/StringDefinitionTest.php | 2 +- .../Definition/StructureDefinitionTest.php | 4 +- .../Schema/Definition/TimeDefinitionTest.php | 2 +- .../Definition/TimeZoneDefinitionTest.php | 2 +- .../Schema/Definition/TypeProjectionTest.php | 4 +- .../Schema/Definition/UuidDefinitionTest.php | 2 +- .../Schema/Definition/XMLDefinitionTest.php | 2 +- .../Definition/XMLElementDefinitionTest.php | 2 +- .../Unit/Values/Schema/DefinitionTest.php | 2 +- .../Unit/Values/Schema/DefinitionsTest.php | 4 +- .../Tests/Unit/Values/Schema/MetadataTest.php | 4 +- .../Flow/ETL/Tests/Unit/Values/SchemaTest.php | 18 +- .../Tests/Unit/Values/Sort/RowOrderTest.php | 2 +- .../ArrayDot/Tests/Unit/ArrayDotGetTest.php | 22 +- .../Tests/Unit/ArrayDotRenameTest.php | 4 +- .../ArrayDot/Tests/Unit/ArrayDotSetTest.php | 2 +- .../ArrayDot/Tests/Unit/ArrayDotStepsTest.php | 6 +- .../Flow/ArrayDot/Tests/Unit/PathTest.php | 6 +- .../Tests/Unit/Step/MultimatchTest.php | 4 +- .../Unit/BlobService/ListBlobs/BlobTest.php | 10 +- .../Azure/SDK/Tests/Unit/BlobServiceTest.php | 2 +- .../Tests/Integration/MySqlBulkInsertTest.php | 2 +- .../Integration/PostgreSqlBulkInsertTest.php | 2 +- .../Integration/PostgreSqlBulkUpdateTest.php | 4 +- .../Integration/SqliteBulkInsertTest.php | 2 +- .../Doctrine/Bulk/Tests/Unit/BulkDataTest.php | 18 +- .../Doctrine/Bulk/Tests/Unit/ColumnsTest.php | 4 +- .../Bulk/Tests/Unit/DbalPlatformTest.php | 2 +- .../Tests/Unit/Dialect/MySQLDialectTest.php | 2 +- .../Tests/Unit/Dialect/SqliteDialectTest.php | 2 +- .../Bulk/Tests/Unit/TableDefinitionTest.php | 18 +- .../Local/MemoryFilesystemTest.php | 6 +- .../Local/StdOutFilesystemTest.php | 20 +- .../Integration/NativeLocalFilesystemTest.php | 6 +- .../NativeLocalSourceStreamTest.php | 6 +- .../Tests/Unit/FilesystemTableTest.php | 8 +- .../Tests/Unit/Local/PermissionsTest.php | 4 +- .../Unit/Operations/OperationOptionsTest.php | 4 +- .../Filesystem/Tests/Unit/PartitionTest.php | 8 +- .../Filesystem/Tests/Unit/PartitionsTest.php | 2 +- .../Tests/Unit/Path/UnixPathTest.php | 10 +- .../Tests/Unit/Path/WindowsPathTest.php | 8 +- .../Flow/Filesystem/Tests/Unit/PathTest.php | 8 +- .../Stream/BlockCachedSourceStreamTest.php | 2 +- .../Tests/Unit/Stream/BlockTest.php | 2 +- .../Tests/Unit/Stream/BlocksTest.php | 2 +- .../Unit/Stream/RangeSourceStreamTest.php | 4 +- .../TraceableDestinationStreamTest.php | 2 +- .../Telemetry/TraceableFilesystemTest.php | 10 +- .../Telemetry/TraceableSourceStreamTest.php | 4 +- .../Testing/InterceptedFilesystemTest.php | 2 +- .../Integration/Engine/RustLibParityTest.php | 6 +- .../Engine/RustLibRegressionTest.php | 2 +- .../Engine/RustLibWriteParityTest.php | 2 +- .../Tests/Integration/IO/PaginationTest.php | 4 +- .../Tests/Integration/IO/WriterTest.php | 10 +- .../Integration/IO/WriterValidatorTest.php | 14 +- .../Parquet/Tests/Integration/OptionsTest.php | 8 +- .../Tests/Unit/Binary/ByteConverterTest.php | 2 +- .../Unit/Binary/DecimalFunctionsTest.php | 4 +- .../BloomFilter/BloomFilterOptionsTest.php | 6 +- .../BloomFilter/BloomFilterReaderTest.php | 4 +- .../Tests/Unit/BloomFilter/SbbfTest.php | 2 +- .../Data/DeltaBinaryPackedDecoderTest.php | 10 +- .../Data/DeltaBinaryPackedEncoderTest.php | 6 +- .../Unit/Data/DeltaByteArrayDecoderTest.php | 4 +- .../Data/DeltaLengthByteArrayDecoderTest.php | 4 +- .../Tests/Unit/Data/PhysicalCodecTest.php | 2 +- .../Tests/Unit/Data/PhysicalOrderTest.php | 4 +- .../ColumnData/DefinitionConverterTest.php | 22 +- .../ColumnData/ReadFlatColumnValuesTest.php | 2 +- .../Unit/Dremel/ColumnData/StackTest.php | 2 +- .../Tests/Unit/Dremel/DremelFlatTest.php | 2 +- .../Tests/Unit/Dremel/DremelListsTest.php | 6 +- .../Tests/Unit/Dremel/DremelMapsTest.php | 20 +- .../Tests/Unit/Dremel/DremelShredderTest.php | 2 +- .../Unit/Dremel/DremelStructuresTest.php | 16 +- .../Validator/ColumnDataValidatorTest.php | 12 +- .../Unit/Engine/AdaptiveParquetEngineTest.php | 4 +- .../Engine/Arrow/OptionsConverterTest.php | 2 +- .../Engine/Arrow/ReadPlanConverterTest.php | 4 +- .../Engine/Arrow/RustRowGroupChunksTest.php | 6 +- .../Tests/Unit/Engine/ArrowExtensionTest.php | 6 +- .../Unit/Engine/PhpParquetEngineTest.php | 4 +- .../Unit/Engine/PhpParquetFileReaderTest.php | 4 +- .../Unit/Engine/PhpParquetFileWriterTest.php | 12 +- .../Unit/Engine/RustParquetEngineTest.php | 6 +- .../Unit/Filter/Binding/BoundFilterTest.php | 6 +- .../Tests/Unit/Filter/ColumnRefTest.php | 2 +- .../Filter/Evaluation/FilterEvaluatorTest.php | 8 +- .../Filter/Evaluation/RowEvaluatorTest.php | 8 +- .../Parquet/Tests/Unit/Filter/LiteralTest.php | 2 +- .../Parquet/Tests/Unit/Filter/NotTest.php | 4 +- .../Unit/ParquetFile/ColumnOrderTest.php | 2 +- .../Data/Converter/DecimalConverterTest.php | 2 +- .../Converter/Int64DateTimeConverterTest.php | 2 +- .../Converter/StoredTemporalConverterTest.php | 8 +- .../Converter/UnsignedInt32ConverterTest.php | 2 +- .../Converter/UnsignedInt64ConverterTest.php | 4 +- .../Data/Converter/UuidConverterTest.php | 6 +- .../ParquetFile/Data/DataConverterTest.php | 2 +- .../ParquetFile/Index/IndexLocationTest.php | 2 +- .../MetadataRowGroupChunksTest.php | 2 +- .../Tests/Unit/ParquetFile/MetadataTest.php | 4 +- .../ParquetFile/PageIndex/ColumnIndexTest.php | 2 +- .../ParquetFile/RowGroup/ColumnChunkTest.php | 4 +- .../ParquetFile/Schema/FlatColumnTest.php | 6 +- .../Schema/LogicalType/IntegerTest.php | 4 +- .../Unit/ParquetFile/Schema/TimeUnitTest.php | 2 +- .../Parquet/Tests/Unit/ParquetFileTest.php | 6 +- .../Flow/Parquet/Tests/Unit/QueryTest.php | 10 +- .../Tests/Unit/Reader/ColumnReaderTest.php | 2 +- .../Tests/Unit/Reader/FilteredBatchesTest.php | 2 +- .../Parquet/Tests/Unit/Reader/PageRunTest.php | 2 +- .../Unit/Reader/PageValuesDecoderTest.php | 12 +- .../Tests/Unit/Reader/ReadPlanTest.php | 18 +- .../Tests/Unit/Reader/RowSelectionTest.php | 10 +- .../Tests/Unit/Reader/RowSelectorTest.php | 2 +- .../Tests/Unit/Reader/SelectedPagesTest.php | 2 +- .../Tests/Unit/Reader/SkippedMatchesTest.php | 2 +- .../Tests/Unit/Thrift/CompactProtocolTest.php | 10 +- .../Tests/Unit/Thrift/MemoryBufferTest.php | 4 +- .../FlatColumnChunkBuilderTest.php | 2 +- .../RLEDictionaryChunkBuilderTest.php | 2 +- .../Writer/ColumnChunkBuilderFactoryTest.php | 10 +- .../Unit/Writer/ColumnChunkBuildersTest.php | 2 +- .../Unit/Writer/ColumnEncodingPolicyTest.php | 2 +- .../Tests/Unit/Writer/ColumnListsTest.php | 4 +- .../PageBuilder/DictionaryBuilderTest.php | 2 +- .../Tests/Unit/Writer/PageContainersTest.php | 2 +- .../Tests/Unit/Writer/RowGroupBuilderTest.php | 10 +- .../Unit/Writer/StatisticsCounterTest.php | 6 +- .../Unit/Writer/StatisticsOptionsTest.php | 2 +- .../Unit/Writer/StatisticsTruncationTest.php | 6 +- .../DeltaBinaryPackedValueStorageTest.php | 4 +- .../DeltaByteArrayValueStorageTest.php | 4 +- .../DeltaLengthByteArrayValueStorageTest.php | 8 +- .../Generator/DiffMigrationGeneratorTest.php | 2 +- .../Tests/Unit/MigrationContextTest.php | 2 +- .../Integration/Client/PgSqlClientTest.php | 10 +- .../Integration/Client/TransactionTest.php | 4 +- .../Tests/Unit/AST/Nodes/FromTest.php | 2 +- .../Tests/Unit/AST/Nodes/StatementsTest.php | 4 +- .../CountModifierEdgeCasesTest.php | 2 +- .../AST/Transformers/ExplainConfigTest.php | 14 +- .../AST/Transformers/ExplainModifierTest.php | 2 +- .../KeysetPaginationConfigTest.php | 2 +- .../KeysetPaginationEdgeCasesTest.php | 2 +- .../KeysetPaginationModifierTest.php | 16 +- .../AST/Transformers/KeysetSortClauseTest.php | 2 +- .../AST/Transformers/LimitedQueryTest.php | 2 +- .../OffsetPaginationEdgeCasesTest.php | 2 +- .../OffsetPaginationModifierTest.php | 4 +- .../Tests/Unit/AST/TraverserTest.php | 4 +- .../Unit/Client/ConnectionParametersTest.php | 10 +- .../Tests/Unit/Client/ContextTest.php | 2 +- .../Tests/Unit/Client/DsnParserTest.php | 6 +- .../RowMapper/ConstructorMapperTest.php | 4 +- .../RowMapper/StaticFactoryMapperTest.php | 8 +- .../Unit/Client/RowMapper/TypeMapperTest.php | 2 +- .../Client/Telemetry/TraceableClientTest.php | 6 +- .../Client/Telemetry/TraceableCursorTest.php | 2 +- .../Client/Types/ArrayLiteralParserTest.php | 2 +- .../Flow/PostgreSql/Tests/Unit/ParserTest.php | 2 +- .../Unit/QueryBuilder/Clause/CTETest.php | 6 +- .../Clause/ReturningClauseTest.php | 6 +- .../Condition/AndConditionTest.php | 4 +- .../QueryBuilder/Condition/BetweenTest.php | 4 +- .../QueryBuilder/Condition/ComparisonTest.php | 4 +- .../Condition/ConditionFactoryTest.php | 6 +- .../Unit/QueryBuilder/Condition/InTest.php | 8 +- .../QueryBuilder/Condition/IsNullTest.php | 2 +- .../Condition/NotConditionTest.php | 8 +- .../Condition/OrConditionTest.php | 4 +- .../Cursor/DeclareCursorBuilderTest.php | 6 +- .../QueryBuilder/Delete/DeleteBuilderTest.php | 12 +- .../Expression/ArrayExpressionTest.php | 2 +- .../Expression/BinaryExpressionTest.php | 10 +- .../QueryBuilder/Expression/CoalesceTest.php | 6 +- .../QueryBuilder/Expression/CollateTest.php | 10 +- .../QueryBuilder/Expression/ColumnTest.php | 2 +- .../QueryBuilder/Expression/GreatestTest.php | 8 +- .../QueryBuilder/Expression/LeastTest.php | 8 +- .../QueryBuilder/Expression/NullIfTest.php | 4 +- .../Expression/RowExpressionTest.php | 6 +- .../QueryBuilder/Expression/SubqueryTest.php | 2 +- .../QueryBuilder/Insert/BulkInsertTest.php | 6 +- .../QueryBuilder/Insert/InsertBuilderTest.php | 6 +- .../QueryBuilder/Merge/MergeBuilderTest.php | 6 +- .../QueryBuilder/Update/UpdateBuilderTest.php | 8 +- .../QueryBuilder/With/WithBuilderTest.php | 2 +- .../Tests/Unit/Schema/CatalogTest.php | 2 +- .../Tests/Unit/Schema/Diff/DomainDiffTest.php | 4 +- .../Tests/Unit/Schema/Diff/TableDiffTest.php | 12 +- .../Schema/ForeignKeyDependencyOrderTest.php | 2 +- .../MaterializedViewDependencyOrderTest.php | 2 +- .../Tests/Unit/Schema/SchemaTest.php | 4 +- .../Unit/Schema/ViewDependencyOrderTest.php | 2 +- .../Tests/Unit/Context/SpanIdTest.php | 4 +- .../Tests/Unit/Context/TraceFlagsTest.php | 4 +- .../Tests/Unit/Context/TraceIdTest.php | 4 +- .../Tests/Unit/Context/TraceStateTest.php | 4 +- .../Tests/Unit/Filter/AttributeFilterTest.php | 2 +- .../Unit/Meter/Instrument/CounterTest.php | 2 +- .../Telemetry/Tests/Unit/Meter/MeterTest.php | 2 +- .../Propagation/SuperglobalCarrierTest.php | 2 +- .../Provider/Console/ConsoleOutputTest.php | 2 +- .../Provider/Memory/MemoryExporterTest.php | 4 +- .../Sampler/TraceIdRatioBasedSamplerTest.php | 2 +- .../Tests/Unit/Tracer/TracerTest.php | 2 +- .../Unit/Type/Logical/DateTimeTypeTest.php | 4 +- .../Tests/Unit/Type/Logical/ListTypeTest.php | 2 +- .../Unit/Type/Logical/OptionalTypeTest.php | 2 +- .../Type/Logical/PositiveIntegerTypeTest.php | 2 +- .../Type/Logical/StructureElementTest.php | 2 +- .../Unit/Type/Logical/StructureTypeTest.php | 8 +- .../Tests/Unit/Type/Logical/TimeTypeTest.php | 2 +- .../Tests/Unit/Type/Native/ArrayTypeTest.php | 2 +- .../Unit/Type/Native/IntegerTypeTest.php | 2 +- .../Unit/Type/Native/IntersectionTypeTest.php | 8 +- .../Tests/Unit/Type/Native/UnionTypeTest.php | 4 +- .../Tests/Unit/Type/TypeDetectorTest.php | 2 +- .../Tests/Unit/Type/ValueComparatorTest.php | 10 +- .../Flow/Types/Tests/Unit/Value/JsonTest.php | 2 +- .../Flow/Types/Tests/Unit/Value/UuidTest.php | 4 +- tools/infection/phpunit.xml | 1 + tools/phpunit/composer.json | 6 +- tools/phpunit/composer.lock | 746 +++++++++++------- .../Tests/Integration/ExamplesTest.php | 14 +- .../Integration/FlowManifestRendererTest.php | 2 +- .../Unit/Service/Manifest/ManifestTest.php | 2 +- .../Service/Markdown/FlowCodeRendererTest.php | 2 +- .../Markdown/MermaidCodeRendererTest.php | 2 +- .../Tests/Unit/WorkShop/ListingsTest.php | 2 +- 739 files changed, 2616 insertions(+), 2147 deletions(-) delete mode 100644 .nix/php/lib/pcov.ini.dist create mode 100644 .nix/pkgs/php-turbocov/package.nix diff --git a/.github/actions/setup-php/action.yml b/.github/actions/setup-php/action.yml index dd3200bb0b..e0196e914c 100644 --- a/.github/actions/setup-php/action.yml +++ b/.github/actions/setup-php/action.yml @@ -22,7 +22,7 @@ inputs: required: false default: "" coverage: - description: "Coverage driver: none, pcov or xdebug" + description: "Coverage driver: none, turbocov or xdebug" required: false default: "none" @@ -70,8 +70,15 @@ runs: php-version: ${{ inputs.php-version }} extensions: ${{ inputs.extensions }} ini-values: ${{ inputs.ini-values }} - tools: ${{ inputs.tools }} - coverage: ${{ inputs.coverage }} + tools: ${{ inputs.coverage == 'turbocov' && (inputs.tools != '' && format('{0}, pie:1.6.1', inputs.tools) || 'pie:1.6.1') || inputs.tools }} + coverage: ${{ inputs.coverage == 'turbocov' && 'none' || inputs.coverage }} + + - name: "Install Turbocov" + if: ${{ inputs.coverage == 'turbocov' }} + shell: bash + run: | + sudo pie install shipmonk/turbocov:0.1.2 + php --ri turbocov # setup-php must not fall back to the other build without a failure - name: "Fail on a wrong thread safety" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 59f00e3cb5..df4b36a4a6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -218,7 +218,7 @@ jobs: uses: "./.github/actions/setup-php" with: php-version: "${{ matrix.php-version }}" - coverage: ${{ matrix.coverage && 'pcov' || 'none' }} + coverage: ${{ matrix.coverage && 'turbocov' || 'none' }} extensions: ':psr, apcu, bcmath, dom, hash, json, mbstring, xml, xmlwriter, xmlreader, zlib, curl, pgsql, grpc, protobuf, :redis' ini-values: 'memory_limit=-1, post_max_size=32M, upload_max_filesize=32M, apc.enable_cli=1' tools: 'composer:v2' @@ -376,7 +376,7 @@ jobs: uses: "./.github/actions/setup-php" with: php-version: "${{ matrix.php-version }}" - coverage: ${{ matrix.php-version == '8.5' && 'pcov' || 'none' }} + coverage: ${{ matrix.php-version == '8.5' && 'turbocov' || 'none' }} extensions: ':psr, bcmath, dom, hash, json, mbstring, xml, xmlwriter, xmlreader, zlib, brotli, lz4, zstd, snappy-https://github.com/kjdev/php-ext-snappy@0.2.1, :redis' ini-values: 'memory_limit=-1' tools: 'composer:v2' @@ -452,7 +452,7 @@ jobs: uses: "./.github/actions/setup-php" with: php-version: "${{ matrix.php-version }}" - coverage: ${{ matrix.php-version == '8.5' && 'pcov' || 'none' }} + coverage: ${{ (matrix.phpunit-version == '13' && matrix.php-version == '8.6') && 'turbocov' || 'none' }} extensions: ':psr, bcmath, dom, hash, json, mbstring, xml, xmlwriter, xmlreader, zlib, curl, pgsql, grpc, protobuf, :redis' ini-values: 'memory_limit=-1' tools: 'composer:v2' @@ -479,21 +479,27 @@ jobs: - *pg-query-enable - name: "Install PHPUnit ${{ matrix.phpunit-version }}" + env: + PHPUNIT_VERSION: ${{ matrix.phpunit-version }} run: | - composer config --working-dir=tools/phpunit --unset platform + composer config --working-dir=tools/phpunit --unset platform.php + if [ "$PHPUNIT_VERSION" != "13" ]; then + composer remove --working-dir=tools/phpunit --no-update --dev shipmonk/turbocov-phpunit + sed -i '/ now comes from `.env.dist` / `.env`. An old `phpunit.xml` keeps the old bootstrap and environment, and it does not > use the shared configuration. -For code coverage, install [pcov](https://pecl.php.net/package/pcov). +For code coverage, install [Turbocov](https://github.com/shipmonk-rnd/turbocov): -The tests pass without the pcov extension. Without it, you cannot run mutation tests. +```shell +pie install shipmonk/turbocov +``` + +Without it, the tests pass and you cannot run coverage or mutation tests. Run `just --list` to see all available tasks. diff --git a/documentation/contributing/nix.md b/documentation/contributing/nix.md index bd41972ee7..59f00236a8 100644 --- a/documentation/contributing/nix.md +++ b/documentation/contributing/nix.md @@ -49,19 +49,16 @@ The nix shell has a predefined php.ini. If it is not sufficient for you, create If that file is not there, the shell uses the default php.ini.dist from the same location. -## Pcov +## Turbocov -- `pcov`: necessary for code coverage +- `turbocov`: necessary for code coverage -To start the nix shell without the pcov extension, use the `--arg with-pcov false` flag: +To start the nix shell without the Turbocov extension, use the `--arg with-turbocov false` flag: ```shell - -nix-shell --arg with-pcov false +nix-shell --arg with-turbocov false ``` -To configure pcov, create a file `./.nix/php/lib/pcov.ini` with your pcov configuration. - ## Xdebug - `xdebug`: necessary for debugging @@ -138,13 +135,13 @@ it. ## Benchmarking PHP The default shell runs PHP with a development configuration. OPcache is off for the CLI, so the JIT is also off. -`zend.assertions` is `1`. pcov is loaded. To time Flow with a production configuration: +`zend.assertions` is `1`. Turbocov is loaded. To time Flow with a production configuration: ```shell nix-shell --arg with-php-benchmark true ``` -The flag removes pcov, xdebug and blackfire. If you combine the flag with one of them, the shell fails at evaluation. +The flag removes Turbocov, xdebug and blackfire. If you combine the flag with one of them, the shell fails at evaluation. The flag appends `./.nix/php/lib/benchmark.ini.dist` to `php.ini`: ```ini @@ -169,7 +166,7 @@ To change the PHP version, start the nix shell with the `--arg php-version 8.6` nix-shell --arg php-version 8.6 ``` -On PHP 8.6 the shell starts without pcov and protobuf, because nixpkgs does not build them for PHP 8.6 yet. +On PHP 8.6 the shell starts without protobuf, because nixpkgs does not build it for PHP 8.6 yet. > Usually, do not change the PHP version. Development must always use the lowest supported PHP version. > diff --git a/phpbench.json.dist b/phpbench.json.dist index ec16f18290..92f3c29aaf 100644 --- a/phpbench.json.dist +++ b/phpbench.json.dist @@ -9,8 +9,7 @@ "runner.php_config": { "memory_limit": "-1", "opcache.enable": "1", - "opcache.enable_cli": "1", - "pcov.enabled": "0" + "opcache.enable_cli": "1" }, "report.generators": { "flow-report": { diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 6b9e20f904..697ac80bc6 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -361,8 +361,23 @@ src/lib/azure-sdk/src/Flow/Azure/SDK/DSL/functions.php src/bridge/telemetry/otlp/src/Flow/Bridge/Telemetry/OTLP/DSL/functions.php src/bridge/postgresql/valinor/src/Flow/PostgreSql/Bridge/Valinor/DSL/functions.php + src/**/**/vendor + src/adapter/etl-adapter-postgresql/src/Flow/ETL/Adapter/PostgreSql/functions.php + src/bridge/monolog/telemetry/src/Flow/Bridge/Monolog/Telemetry/DSL/functions.php + src/bridge/phpunit/postgresql/src/Flow/Bridge/PHPUnit/PostgreSQL/DSL/functions.php + src/bridge/psr18/telemetry/src/Flow/Bridge/Psr18/Telemetry/DSL/functions.php + src/bridge/psr3/telemetry/src/Flow/Bridge/Psr3/Telemetry/DSL/functions.php + src/bridge/psr7/telemetry/src/Flow/Bridge/Psr7/Telemetry/DSL/functions.php + src/bridge/symfony/http-foundation-telemetry/src/Flow/Bridge/Symfony/HttpFoundationTelemetry/DSL/functions.php + src/bridge/symfony/telemetry-bundle/src/Flow/Bridge/Symfony/TelemetryBundle/DSL/functions.php + src/core/etl/src/Flow/Floe/DSL/functions.php + src/core/etl/src/Flow/Serializer/DSL/functions.php + src/lib/parquet/src/Flow/Parquet/Binary/functions.php + src/lib/parquet/src/Flow/Parquet/DSL/functions.php + src/lib/postgresql/src/Flow/PostgreSql/Migrations/DSL/functions.php + diff --git a/shell.nix b/shell.nix index 0ce2458bc4..705299022b 100644 --- a/shell.nix +++ b/shell.nix @@ -2,7 +2,7 @@ php-version ? 8.5, with-blackfire ? false, with-xdebug ? false, - with-pcov ? php-version != 8.6 && !with-blackfire && !with-php-benchmark, + with-turbocov ? !with-blackfire && !with-php-benchmark && !with-xdebug, with-php-benchmark ? false, with-duckdb ? false, with-polars ? false, @@ -22,7 +22,8 @@ assert (!(with-rust && with-arrow-ext)) || builtins.throw "Cannot use --arg with-rust true and --arg with-arrow-ext true together. Use: --arg with-arrow-ext false --arg with-rust true"; assert (!(with-rust && with-flow-php-ext)) || builtins.throw "Cannot use --arg with-rust true and --arg with-flow-php-ext true together. Use: --arg with-flow-php-ext false --arg with-rust true"; assert (!(with-c && with-pg-query-ext)) || builtins.throw "Cannot use --arg with-c true and --arg with-pg-query-ext true together. Use: --arg with-pg-query-ext false --arg with-c true"; -assert (!(with-php-benchmark && with-pcov)) || builtins.throw "Cannot use --arg with-php-benchmark true and --arg with-pcov true together: pcov distorts timings."; +assert (!(with-php-benchmark && with-turbocov)) || builtins.throw "Cannot use --arg with-php-benchmark true and --arg with-turbocov true together: Turbocov distorts timings."; +assert (!(with-turbocov && with-xdebug)) || builtins.throw "Turbocov cannot run together with Xdebug"; assert (!(with-php-benchmark && with-xdebug)) || builtins.throw "Cannot use --arg with-php-benchmark true and --arg with-xdebug true together: xdebug distorts timings."; assert (!(with-php-benchmark && with-blackfire)) || builtins.throw "Cannot use --arg with-php-benchmark true and --arg with-blackfire true together: time without the probe, profile with --arg with-blackfire true alone."; @@ -59,6 +60,7 @@ let throw "Unsupported php version, Flow supports 8.5 and 8.6"; php-brotli = pkgs.callPackage ./.nix/pkgs/php-brotli/package.nix { php = base-php; }; + php-turbocov = pkgs.callPackage ./.nix/pkgs/php-turbocov/package.nix { php = base-php; }; php-snappy = pkgs.callPackage ./.nix/pkgs/php-snappy/package.nix { php = base-php; }; php-lz4 = pkgs.callPackage ./.nix/pkgs/php-lz4/package.nix { php = base-php; }; php-zstd = pkgs.callPackage ./.nix/pkgs/php-zstd/package.nix { php = base-php; }; @@ -101,8 +103,8 @@ let php = pkgs.callPackage ./.nix/pkgs/flow-php/package.nix { php = base-php; - inherit php-snappy php-lz4 php-brotli php-zstd php-pg-query-ext php-arrow-ext php-flow-php-ext - with-pcov with-xdebug with-blackfire with-php-benchmark with-pg-query-ext with-arrow-ext with-flow-php-ext with-grpc with-protobuf; + inherit php-snappy php-lz4 php-brotli php-zstd php-turbocov php-pg-query-ext php-arrow-ext php-flow-php-ext + with-turbocov with-xdebug with-blackfire with-php-benchmark with-pg-query-ext with-arrow-ext with-flow-php-ext with-grpc with-protobuf; }; polars-python = pkgs.python3.withPackages (ps: [ ps.polars ps.pyarrow ]); diff --git a/src/adapter/etl-adapter-avro/tests/Flow/ETL/Adapter/Avro/Tests/Integration/AvroTest.php b/src/adapter/etl-adapter-avro/tests/Flow/ETL/Adapter/Avro/Tests/Integration/AvroTest.php index b9908bec38..e2f1ec1958 100644 --- a/src/adapter/etl-adapter-avro/tests/Flow/ETL/Adapter/Avro/Tests/Integration/AvroTest.php +++ b/src/adapter/etl-adapter-avro/tests/Flow/ETL/Adapter/Avro/Tests/Integration/AvroTest.php @@ -39,7 +39,7 @@ public function test_signal_stop(): void public function test_using_pattern_path(): void { - $this->expectExceptionMessage("AvroLoader path can't be pattern, given: /path/*/pattern.avro"); + $this->expectExceptionMessageIsOrContains("AvroLoader path can't be pattern, given: /path/*/pattern.avro"); to_avro(path('/path/*/pattern.avro')); } diff --git a/src/adapter/etl-adapter-chartjs/tests/Flow/ETL/Adapter/ChartJS/Tests/Integration/IO/Loader/ChartJSLoaderTest.php b/src/adapter/etl-adapter-chartjs/tests/Flow/ETL/Adapter/ChartJS/Tests/Integration/IO/Loader/ChartJSLoaderTest.php index 1d3b5fdbb2..10325fd656 100644 --- a/src/adapter/etl-adapter-chartjs/tests/Flow/ETL/Adapter/ChartJS/Tests/Integration/IO/Loader/ChartJSLoaderTest.php +++ b/src/adapter/etl-adapter-chartjs/tests/Flow/ETL/Adapter/ChartJS/Tests/Integration/IO/Loader/ChartJSLoaderTest.php @@ -36,7 +36,7 @@ final class ChartJSLoaderTest extends FlowTestCase public function test_chartjs_output_path_on_a_mismatched_filesystem_throws(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Filesystem Flow\\Filesystem\\Local\\NativeLocalFilesystem serves "file://" paths, ' + $this->expectExceptionMessageIsOrContains('Filesystem Flow\\Filesystem\\Local\\NativeLocalFilesystem serves "file://" paths, ' . 'given: "memory://chart.html".'); to_chartjs(bar_chart(ref('Date'), refs(ref('Revenue'))))->withOutputPath(path('memory://chart.html')); @@ -65,7 +65,7 @@ public function test_closure_reports_the_removal_the_template_read_and_the_write public function test_chartjs_output_path_without_an_extension_throws_at_build(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Stream path must have an extension, given: '); + $this->expectExceptionMessageIsOrContains('Stream path must have an extension, given: '); to_chartjs(bar_chart(ref('Date'), refs(ref('Revenue'))))->withOutputPath(path(__DIR__ . '/var/no-extension')); } diff --git a/src/adapter/etl-adapter-csv/tests/Flow/ETL/Adapter/CSV/Tests/Integration/IO/Extractor/CSVExtractorTest.php b/src/adapter/etl-adapter-csv/tests/Flow/ETL/Adapter/CSV/Tests/Integration/IO/Extractor/CSVExtractorTest.php index 29b9838e1d..a6bd09e1c4 100644 --- a/src/adapter/etl-adapter-csv/tests/Flow/ETL/Adapter/CSV/Tests/Integration/IO/Extractor/CSVExtractorTest.php +++ b/src/adapter/etl-adapter-csv/tests/Flow/ETL/Adapter/CSV/Tests/Integration/IO/Extractor/CSVExtractorTest.php @@ -163,7 +163,7 @@ public function test_a_value_that_does_not_cast_to_the_declared_type_is_a_corrup public function test_a_declared_column_the_header_lacks_is_a_schema_error(): void { $this->expectException(SchemaValidationException::class); - $this->expectExceptionMessage('"x"'); + $this->expectExceptionMessageIsOrContains('"x"'); ExtractedRows::of(from_csv( 'memory://source.csv', @@ -174,7 +174,7 @@ public function test_a_declared_column_the_header_lacks_is_a_schema_error(): voi public function test_an_empty_glob_refuses_to_infer_a_schema(): void { $this->expectException(InferredSchemaException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'from_csv() has nothing to infer a schema from: no file matching "memory://empty/*.csv" carries a column. ' . 'Declare the schema with ->withSchema(...).', ); @@ -185,7 +185,7 @@ public function test_an_empty_glob_refuses_to_infer_a_schema(): void public function test_an_empty_glob_with_metadata_columns_refuses_to_infer_a_schema(): void { $this->expectException(InferredSchemaException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'from_csv() has nothing to infer a schema from: no file matching "memory://empty/*.csv" carries a column. ' . 'Declare the schema with ->withSchema(...).', ); @@ -288,7 +288,7 @@ public function test_schema_appends_the_metadata_column(): void public function test_characters_read_in_line_must_be_greater_than_zero(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Characters read in line must be greater than 0'); + $this->expectExceptionMessageIsOrContains('Characters read in line must be greater than 0'); from_csv(CSVFixtureContext::path('two_rows.csv'))->withCharactersReadInLine(0); } @@ -759,7 +759,7 @@ public function test_an_empty_file_refuses_to_infer_a_schema_and_extracts_nothin ); $this->expectException(InferredSchemaException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'from_csv() has nothing to infer a schema from: no file matching "' . path_real(CSVFixtureContext::path('empty.csv'))->uri() . '" carries a column. Declare the schema with ->withSchema(...).', @@ -771,7 +771,7 @@ public function test_an_empty_file_refuses_to_infer_a_schema_and_extracts_nothin public function test_a_glob_of_only_empty_files_refuses_to_infer_a_schema(): void { $this->expectException(InferredSchemaException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'from_csv() has nothing to infer a schema from: no file matching "' . path_real(CSVFixtureContext::path('two_empty/*.csv'))->uri() . '" carries a column. Declare the schema with ->withSchema(...).', @@ -1251,7 +1251,7 @@ public function test_extracting_csv_files_without_header(): void public function test_extracting_csv_with_corrupted_row(): void { $this->expectException(CorruptedRecordException::class); - $this->expectExceptionMessage('5 fields, the header has 2'); + $this->expectExceptionMessageIsOrContains('5 fields, the header has 2'); df()->read(from_csv(__DIR__ . '/../../../Fixtures/corrupted_row.csv'))->fetch(); } @@ -1259,7 +1259,7 @@ public function test_extracting_csv_with_corrupted_row(): void public function test_extracting_csv_with_more_columns_than_headers(): void { $this->expectException(CorruptedRecordException::class); - $this->expectExceptionMessage('3 fields, the header has 2'); + $this->expectExceptionMessageIsOrContains('3 fields, the header has 2'); ExtractedRows::of(from_csv(__DIR__ . '/../../../Fixtures/more_columns_than_headers.csv')); } diff --git a/src/adapter/etl-adapter-csv/tests/Flow/ETL/Adapter/CSV/Tests/Integration/IO/Extractor/RustCSVOpenSourceTest.php b/src/adapter/etl-adapter-csv/tests/Flow/ETL/Adapter/CSV/Tests/Integration/IO/Extractor/RustCSVOpenSourceTest.php index f146991b5b..4bdbe500fb 100644 --- a/src/adapter/etl-adapter-csv/tests/Flow/ETL/Adapter/CSV/Tests/Integration/IO/Extractor/RustCSVOpenSourceTest.php +++ b/src/adapter/etl-adapter-csv/tests/Flow/ETL/Adapter/CSV/Tests/Integration/IO/Extractor/RustCSVOpenSourceTest.php @@ -364,7 +364,7 @@ public function test_sniff_refuses_a_negative_row_budget_like_the_php_lane(): vo $open = CSVFixtureContext::openNative('five_rows.csv'); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Row budget must be 0 or more. Use null for every row.'); + $this->expectExceptionMessageIsOrContains('Row budget must be 0 or more. Use null for every row.'); try { // @mago-expect analysis:invalid-argument diff --git a/src/adapter/etl-adapter-csv/tests/Flow/ETL/Adapter/CSV/Tests/Integration/IO/FileFormatContractTest.php b/src/adapter/etl-adapter-csv/tests/Flow/ETL/Adapter/CSV/Tests/Integration/IO/FileFormatContractTest.php index 5d190092cd..d49b21c72e 100644 --- a/src/adapter/etl-adapter-csv/tests/Flow/ETL/Adapter/CSV/Tests/Integration/IO/FileFormatContractTest.php +++ b/src/adapter/etl-adapter-csv/tests/Flow/ETL/Adapter/CSV/Tests/Integration/IO/FileFormatContractTest.php @@ -164,7 +164,7 @@ public function test_csv_header_is_written_exactly_once_across_batches(): void public function test_reading_a_remote_path_without_a_filesystem_throws_naming_the_argument(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Filesystem Flow\Filesystem\Local\NativeLocalFilesystem serves "file://" paths, ' . 'given: "aws-s3://bucket/orders.csv". Pass the filesystem that handles this scheme, ' . 'e.g. from_csv($path, filesystem: aws_s3_filesystem(...)).', @@ -176,7 +176,7 @@ public function test_reading_a_remote_path_without_a_filesystem_throws_naming_th public function test_writing_a_remote_path_without_a_filesystem_throws_naming_the_argument(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Filesystem Flow\Filesystem\Local\NativeLocalFilesystem serves "file://" paths, ' . 'given: "aws-s3://bucket/orders.csv". Pass the filesystem that handles this scheme, ' . 'e.g. to_csv($path, filesystem: aws_s3_filesystem(...)).', diff --git a/src/adapter/etl-adapter-csv/tests/Flow/ETL/Adapter/CSV/Tests/Unit/IO/CSVDialectTest.php b/src/adapter/etl-adapter-csv/tests/Flow/ETL/Adapter/CSV/Tests/Unit/IO/CSVDialectTest.php index 7a5c9c565c..e8734ba24f 100644 --- a/src/adapter/etl-adapter-csv/tests/Flow/ETL/Adapter/CSV/Tests/Unit/IO/CSVDialectTest.php +++ b/src/adapter/etl-adapter-csv/tests/Flow/ETL/Adapter/CSV/Tests/Unit/IO/CSVDialectTest.php @@ -14,7 +14,7 @@ final class CSVDialectTest extends TestCase public function test_a_separator_of_more_than_one_character_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Separator must be a single character'); + $this->expectExceptionMessageIsOrContains('Separator must be a single character'); new CSVDialect('||', '"', '\\'); } diff --git a/src/adapter/etl-adapter-csv/tests/Flow/ETL/Adapter/CSV/Tests/Unit/IO/Extractor/CSVReadOptionsTest.php b/src/adapter/etl-adapter-csv/tests/Flow/ETL/Adapter/CSV/Tests/Unit/IO/Extractor/CSVReadOptionsTest.php index 6b01672dbf..f707e7dd23 100644 --- a/src/adapter/etl-adapter-csv/tests/Flow/ETL/Adapter/CSV/Tests/Unit/IO/Extractor/CSVReadOptionsTest.php +++ b/src/adapter/etl-adapter-csv/tests/Flow/ETL/Adapter/CSV/Tests/Unit/IO/Extractor/CSVReadOptionsTest.php @@ -23,7 +23,7 @@ final class CSVReadOptionsTest extends TestCase public function test_a_dialect_value_that_is_not_a_single_byte_is_refused(array $options, string $message): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage($message); + $this->expectExceptionMessageIsOrContains($message); new CSVReadOptions(...$options); } diff --git a/src/adapter/etl-adapter-csv/tests/Flow/ETL/Adapter/CSV/Tests/Unit/IO/Extractor/CSVRecordResyncTest.php b/src/adapter/etl-adapter-csv/tests/Flow/ETL/Adapter/CSV/Tests/Unit/IO/Extractor/CSVRecordResyncTest.php index 330d607bf9..c628e7fba1 100644 --- a/src/adapter/etl-adapter-csv/tests/Flow/ETL/Adapter/CSV/Tests/Unit/IO/Extractor/CSVRecordResyncTest.php +++ b/src/adapter/etl-adapter-csv/tests/Flow/ETL/Adapter/CSV/Tests/Unit/IO/Extractor/CSVRecordResyncTest.php @@ -141,7 +141,7 @@ public function test_offset_zero_of_an_empty_stream_starts_nothing(): void public function test_it_refuses_a_count_below_one(int $fields, int $confirmations, string $message): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage($message); + $this->expectExceptionMessageIsOrContains($message); new CSVRecordResync(new CSVDialect(',', '"', '\\'), $fields, $confirmations); } diff --git a/src/adapter/etl-adapter-csv/tests/Flow/ETL/Adapter/CSV/Tests/Unit/IO/Extractor/Detector/OptionTest.php b/src/adapter/etl-adapter-csv/tests/Flow/ETL/Adapter/CSV/Tests/Unit/IO/Extractor/Detector/OptionTest.php index a510d02d6f..4216be6f1a 100644 --- a/src/adapter/etl-adapter-csv/tests/Flow/ETL/Adapter/CSV/Tests/Unit/IO/Extractor/Detector/OptionTest.php +++ b/src/adapter/etl-adapter-csv/tests/Flow/ETL/Adapter/CSV/Tests/Unit/IO/Extractor/Detector/OptionTest.php @@ -34,7 +34,7 @@ public function test_a_multibyte_separator_is_refused(): void public function test_an_escape_of_more_than_one_character_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Escape must be empty or a single character'); + $this->expectExceptionMessageIsOrContains('Escape must be empty or a single character'); new Option(',', '"', 'ab'); } diff --git a/src/adapter/etl-adapter-csv/tests/Flow/ETL/Adapter/CSV/Tests/Unit/IO/Loader/CSVLoaderTest.php b/src/adapter/etl-adapter-csv/tests/Flow/ETL/Adapter/CSV/Tests/Unit/IO/Loader/CSVLoaderTest.php index ab80f76ed9..65f36df83a 100644 --- a/src/adapter/etl-adapter-csv/tests/Flow/ETL/Adapter/CSV/Tests/Unit/IO/Loader/CSVLoaderTest.php +++ b/src/adapter/etl-adapter-csv/tests/Flow/ETL/Adapter/CSV/Tests/Unit/IO/Loader/CSVLoaderTest.php @@ -297,7 +297,7 @@ public function test_a_writer_without_a_header(): void public function test_a_flow_php_of_another_abi_is_refused(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('does not match flow-php/etl'); + $this->expectExceptionMessageIsOrContains('does not match flow-php/etl'); new CSVLoader( path('memory://out.csv'), @@ -309,7 +309,7 @@ public function test_a_flow_php_of_another_abi_is_refused(): void public function test_in_task_keeps_the_lane_override(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('does not match flow-php/etl'); + $this->expectExceptionMessageIsOrContains('does not match flow-php/etl'); new CSVLoader( path('memory://out.csv'), diff --git a/src/adapter/etl-adapter-csv/tests/Flow/ETL/Adapter/CSV/Tests/Unit/IO/Loader/CSVWriteOptionsTest.php b/src/adapter/etl-adapter-csv/tests/Flow/ETL/Adapter/CSV/Tests/Unit/IO/Loader/CSVWriteOptionsTest.php index 38e5587e42..6112f86cf2 100644 --- a/src/adapter/etl-adapter-csv/tests/Flow/ETL/Adapter/CSV/Tests/Unit/IO/Loader/CSVWriteOptionsTest.php +++ b/src/adapter/etl-adapter-csv/tests/Flow/ETL/Adapter/CSV/Tests/Unit/IO/Loader/CSVWriteOptionsTest.php @@ -43,7 +43,7 @@ public function test_a_malformed_dialect_is_refused( string $message, ): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage($message); + $this->expectExceptionMessageIsOrContains($message); new CSVWriteOptions($separator, $enclosure, $escape); } diff --git a/src/adapter/etl-adapter-doctrine/tests/Flow/ETL/Adapter/Doctrine/Tests/Integration/Dialects/MySQLKeySetExtractorTest.php b/src/adapter/etl-adapter-doctrine/tests/Flow/ETL/Adapter/Doctrine/Tests/Integration/Dialects/MySQLKeySetExtractorTest.php index 8e0576c143..7340126bca 100644 --- a/src/adapter/etl-adapter-doctrine/tests/Flow/ETL/Adapter/Doctrine/Tests/Integration/Dialects/MySQLKeySetExtractorTest.php +++ b/src/adapter/etl-adapter-doctrine/tests/Flow/ETL/Adapter/Doctrine/Tests/Integration/Dialects/MySQLKeySetExtractorTest.php @@ -422,7 +422,7 @@ public function test_case_insensitive_equal_keys_throw(): void $this->mysqlDatabaseContext->insert($table, ['id' => 3, 'k' => 'b']); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Keyset pagination expected the next page to start at the key'); + $this->expectExceptionMessageIsOrContains('Keyset pagination expected the next page to start at the key'); df() ->read(from_dbal_key_set_qb( @@ -452,7 +452,7 @@ public function test_null_in_secondary_key_throws_before_first_row(): void ->extract(flow_context()->backend(), new Criteria()); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Keyset pagination requires non-null keys, but a row has NULL in the key column(s) "a", "b"', ); diff --git a/src/adapter/etl-adapter-doctrine/tests/Flow/ETL/Adapter/Doctrine/Tests/Integration/Dialects/PostgreSQLKeySetExtractorTest.php b/src/adapter/etl-adapter-doctrine/tests/Flow/ETL/Adapter/Doctrine/Tests/Integration/Dialects/PostgreSQLKeySetExtractorTest.php index bfb7ccd4d2..cd8bac9322 100644 --- a/src/adapter/etl-adapter-doctrine/tests/Flow/ETL/Adapter/Doctrine/Tests/Integration/Dialects/PostgreSQLKeySetExtractorTest.php +++ b/src/adapter/etl-adapter-doctrine/tests/Flow/ETL/Adapter/Doctrine/Tests/Integration/Dialects/PostgreSQLKeySetExtractorTest.php @@ -450,7 +450,7 @@ public function test_null_in_secondary_key_throws_before_first_row(): void ->extract(flow_context()->backend(), new Criteria()); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Keyset pagination requires non-null keys, but a row has NULL in the key column(s) "a", "b"', ); @@ -474,7 +474,7 @@ public function test_null_keys_throw_at_every_batch_size(int $batchSize): void } $this->expectException(RuntimeException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Keyset pagination requires non-null keys, but a row has NULL in the key column(s) "k"', ); diff --git a/src/adapter/etl-adapter-doctrine/tests/Flow/ETL/Adapter/Doctrine/Tests/Integration/Dialects/SqliteKeySetExtractorTest.php b/src/adapter/etl-adapter-doctrine/tests/Flow/ETL/Adapter/Doctrine/Tests/Integration/Dialects/SqliteKeySetExtractorTest.php index 06a6ccc4ab..b566ad2525 100644 --- a/src/adapter/etl-adapter-doctrine/tests/Flow/ETL/Adapter/Doctrine/Tests/Integration/Dialects/SqliteKeySetExtractorTest.php +++ b/src/adapter/etl-adapter-doctrine/tests/Flow/ETL/Adapter/Doctrine/Tests/Integration/Dialects/SqliteKeySetExtractorTest.php @@ -427,7 +427,7 @@ public function test_null_in_secondary_key_throws_before_first_row(): void ->extract(flow_context()->backend(), new Criteria()); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Keyset pagination requires non-null keys, but a row has NULL in the key column(s) "a", "b"', ); diff --git a/src/adapter/etl-adapter-doctrine/tests/Flow/ETL/Adapter/Doctrine/Tests/Integration/IO/Extractor/DbalKeySetExtractorTest.php b/src/adapter/etl-adapter-doctrine/tests/Flow/ETL/Adapter/Doctrine/Tests/Integration/IO/Extractor/DbalKeySetExtractorTest.php index 356d0ac986..20f3e590a0 100644 --- a/src/adapter/etl-adapter-doctrine/tests/Flow/ETL/Adapter/Doctrine/Tests/Integration/IO/Extractor/DbalKeySetExtractorTest.php +++ b/src/adapter/etl-adapter-doctrine/tests/Flow/ETL/Adapter/Doctrine/Tests/Integration/IO/Extractor/DbalKeySetExtractorTest.php @@ -30,7 +30,7 @@ public function test_throws_exception_for_empty_key_set(): void )); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('KeySet requires at least one key'); + $this->expectExceptionMessageIsOrContains('KeySet requires at least one key'); from_dbal_key_set_qb( $this->pgsqlDatabaseContext->connection(), @@ -52,7 +52,7 @@ public function test_throws_exception_for_invalid_maximum(): void $this->pgsqlDatabaseContext->insert($table, ['id' => 1, 'name' => 'name_1']); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Maximum must be greater than 0, got -1'); + $this->expectExceptionMessageIsOrContains('Maximum must be greater than 0, got -1'); data_frame() ->read(from_dbal_key_set_qb( @@ -76,7 +76,7 @@ public function test_throws_exception_for_invalid_batch_size(): void $this->pgsqlDatabaseContext->insert($table, ['id' => 1, 'name' => 'name_1']); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Batch size must be greater than 0, got 0'); + $this->expectExceptionMessageIsOrContains('Batch size must be greater than 0, got 0'); data_frame() ->read(from_dbal_key_set_qb( @@ -98,7 +98,7 @@ public function test_throws_exception_for_pre_existing_order_by_in_query_builder )); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Keyset pagination cannot be used with an ORDER BY clause, please remove OrderBy from Query Builder', ); diff --git a/src/adapter/etl-adapter-doctrine/tests/Flow/ETL/Adapter/Doctrine/Tests/Integration/IO/Extractor/DbalLimitOffsetExtractorTest.php b/src/adapter/etl-adapter-doctrine/tests/Flow/ETL/Adapter/Doctrine/Tests/Integration/IO/Extractor/DbalLimitOffsetExtractorTest.php index 9dc6677f25..156d34383d 100644 --- a/src/adapter/etl-adapter-doctrine/tests/Flow/ETL/Adapter/Doctrine/Tests/Integration/IO/Extractor/DbalLimitOffsetExtractorTest.php +++ b/src/adapter/etl-adapter-doctrine/tests/Flow/ETL/Adapter/Doctrine/Tests/Integration/IO/Extractor/DbalLimitOffsetExtractorTest.php @@ -84,7 +84,7 @@ public function test_creating_limit_offset_extractor_for_table(): void public function test_creating_limit_offset_extractor_for_table_without_order_by(): void { - $this->expectExceptionMessage('There must be at least one column to order by, zero given'); + $this->expectExceptionMessageIsOrContains('There must be at least one column to order by, zero given'); from_dbal_limit_offset($this->pgsqlDatabaseContext->connection(), new Table('table', ['id', 'name']), []); } diff --git a/src/adapter/etl-adapter-doctrine/tests/Flow/ETL/Adapter/Doctrine/Tests/Integration/IO/Loader/DbalLoaderTest.php b/src/adapter/etl-adapter-doctrine/tests/Flow/ETL/Adapter/Doctrine/Tests/Integration/IO/Loader/DbalLoaderTest.php index a3f6bc1c7a..89860ea8e5 100644 --- a/src/adapter/etl-adapter-doctrine/tests/Flow/ETL/Adapter/Doctrine/Tests/Integration/IO/Loader/DbalLoaderTest.php +++ b/src/adapter/etl-adapter-doctrine/tests/Flow/ETL/Adapter/Doctrine/Tests/Integration/IO/Loader/DbalLoaderTest.php @@ -35,7 +35,7 @@ public function test_create_loader_with_invalid_operation(): void ); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Operation can be insert, update, or delete, invalid given.'); + $this->expectExceptionMessageIsOrContains('Operation can be insert, update, or delete, invalid given.'); new DbalLoader($table, $this->postgresqlConnectionParams())->withOperation('invalid'); } @@ -54,7 +54,7 @@ public function test_create_loader_with_invalid_operation_from_connection(): voi ); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Operation can be insert, update, or delete, invalid given.'); + $this->expectExceptionMessageIsOrContains('Operation can be insert, update, or delete, invalid given.'); DbalLoader::fromConnection( $this->pgsqlDatabaseContext->connection(), diff --git a/src/adapter/etl-adapter-doctrine/tests/Flow/ETL/Adapter/Doctrine/Tests/Unit/IO/Extractor/DbalKeySetExtractorTest.php b/src/adapter/etl-adapter-doctrine/tests/Flow/ETL/Adapter/Doctrine/Tests/Unit/IO/Extractor/DbalKeySetExtractorTest.php index c56a7cc9bb..f82545e5fa 100644 --- a/src/adapter/etl-adapter-doctrine/tests/Flow/ETL/Adapter/Doctrine/Tests/Unit/IO/Extractor/DbalKeySetExtractorTest.php +++ b/src/adapter/etl-adapter-doctrine/tests/Flow/ETL/Adapter/Doctrine/Tests/Unit/IO/Extractor/DbalKeySetExtractorTest.php @@ -224,7 +224,7 @@ public function test_duplicate_keys_throw_at_every_batch_size(int $batchSize): v ); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Keyset pagination requires unique keys, but two rows share the key'); + $this->expectExceptionMessageIsOrContains('Keyset pagination requires unique keys, but two rows share the key'); iterator_to_array(new DbalKeySetExtractor( $connection, @@ -245,7 +245,7 @@ public function test_duplicate_keys_within_the_maximum_throw(int $batchSize): vo ); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Keyset pagination requires unique keys, but two rows share the key'); + $this->expectExceptionMessageIsOrContains('Keyset pagination requires unique keys, but two rows share the key'); iterator_to_array( new DbalKeySetExtractor( @@ -268,7 +268,7 @@ public function test_equal_keys_under_a_case_insensitive_collation_throw(): void ); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Keyset pagination expected the next page to start at the key'); + $this->expectExceptionMessageIsOrContains('Keyset pagination expected the next page to start at the key'); iterator_to_array(new DbalKeySetExtractor( $connection, @@ -287,7 +287,7 @@ public function test_mixed_direction_composite_duplicate_keys_throw(): void ); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Keyset pagination requires unique keys, but two rows share the key'); + $this->expectExceptionMessageIsOrContains('Keyset pagination requires unique keys, but two rows share the key'); iterator_to_array(new DbalKeySetExtractor( $connection, @@ -338,7 +338,7 @@ public function test_null_key_throws_with_one_query_at_every_batch_size(int $bat $counter->reset(); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Keyset pagination requires non-null keys, but a row has NULL in the key column(s) "k"', ); @@ -354,7 +354,7 @@ public function test_query_first_result_is_rejected(): void $connection = InMemorySqlite::connection(); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Keyset pagination sets its own LIMIT and OFFSET, please remove setMaxResults()/setFirstResult() from Query Builder and use withMaximum() or DataFrame::limit()', ); @@ -370,7 +370,7 @@ public function test_query_max_results_is_rejected(): void $connection = InMemorySqlite::connection(); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Keyset pagination sets its own LIMIT and OFFSET'); + $this->expectExceptionMessageIsOrContains('Keyset pagination sets its own LIMIT and OFFSET'); new DbalKeySetExtractor( $connection, diff --git a/src/adapter/etl-adapter-doctrine/tests/Flow/ETL/Adapter/Doctrine/Tests/Unit/IO/Extractor/DbalResultSchemaTest.php b/src/adapter/etl-adapter-doctrine/tests/Flow/ETL/Adapter/Doctrine/Tests/Unit/IO/Extractor/DbalResultSchemaTest.php index 210f4ce42d..34a0518455 100644 --- a/src/adapter/etl-adapter-doctrine/tests/Flow/ETL/Adapter/Doctrine/Tests/Unit/IO/Extractor/DbalResultSchemaTest.php +++ b/src/adapter/etl-adapter-doctrine/tests/Flow/ETL/Adapter/Doctrine/Tests/Unit/IO/Extractor/DbalResultSchemaTest.php @@ -23,7 +23,7 @@ final class DbalResultSchemaTest extends FlowTestCase public function test_a_missing_sqlite_column_rethrows_what_the_read_throws(): void { $this->expectException(DriverException::class); - $this->expectExceptionMessage('no such column: nope'); + $this->expectExceptionMessageIsOrContains('no such column: nope'); new DbalResultSchema()->of( InMemorySqlite::withUsers(InMemorySqlite::connection(), 1), @@ -67,7 +67,9 @@ public function test_a_pdo_connection_that_is_not_sqlite_is_refused(): void // pdo_pgsql and pdo_mysql hand out a plain PDO with no arm; describing them as all-string // would be a wrong schema, which is worse than none. $this->expectException(SchemaNotDerivableException::class); - $this->expectExceptionMessage('reports no column types for a query result, so this query cannot be typed'); + $this->expectExceptionMessageIsOrContains( + 'reports no column types for a query result, so this query cannot be typed', + ); new DbalResultSchema()->of( InMemorySqlite::withUsers(InMemorySqlite::connection(new NativeHandleStub(new NonSqlitePdo())), 1), @@ -79,7 +81,7 @@ public function test_a_pdo_connection_that_is_not_sqlite_is_refused(): void public function test_an_unsupported_driver_is_refused_by_name(): void { $this->expectException(SchemaNotDerivableException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'the stdClass driver reports no column types for a query result, so this query cannot be typed', ); diff --git a/src/adapter/etl-adapter-doctrine/tests/Flow/ETL/Adapter/Doctrine/Tests/Unit/IO/Extractor/Pagination/KeySetPageTest.php b/src/adapter/etl-adapter-doctrine/tests/Flow/ETL/Adapter/Doctrine/Tests/Unit/IO/Extractor/Pagination/KeySetPageTest.php index 3b4d87886a..932d54a89b 100644 --- a/src/adapter/etl-adapter-doctrine/tests/Flow/ETL/Adapter/Doctrine/Tests/Unit/IO/Extractor/Pagination/KeySetPageTest.php +++ b/src/adapter/etl-adapter-doctrine/tests/Flow/ETL/Adapter/Doctrine/Tests/Unit/IO/Extractor/Pagination/KeySetPageTest.php @@ -18,7 +18,7 @@ final class KeySetPageTest extends FlowTestCase public function test_a_composite_tie_with_mixed_directions_is_rejected(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Keyset pagination requires unique keys, but two rows share the key (a = 2, b = 1)', ); @@ -47,7 +47,7 @@ public function test_a_page_not_starting_at_the_lookahead_is_rejected(): void $keySet = pagination_key_set(pagination_key_asc('k')); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( "Keyset pagination expected the next page to start at the key (k = 'A'), but it did not.", ); @@ -72,7 +72,7 @@ public function test_a_short_page_is_the_last(): void public function test_a_tie_inside_the_page_is_rejected(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Keyset pagination requires unique keys, but two rows share the key (id = 1); add a unique column (for example the primary key) to the key set as its least significant key', ); @@ -88,7 +88,9 @@ public function test_a_tie_inside_the_page_is_rejected(): void public function test_a_tie_with_the_lookahead_is_rejected(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Keyset pagination requires unique keys, but two rows share the key (id = 2)'); + $this->expectExceptionMessageIsOrContains( + 'Keyset pagination requires unique keys, but two rows share the key (id = 2)', + ); KeySetPage::of( pagination_key_set(pagination_key_asc('id')), @@ -104,7 +106,7 @@ public function test_an_empty_page_after_a_lookahead_is_rejected(): void $keySet = pagination_key_set(pagination_key_asc('id')); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Keyset pagination expected the next page to start at the key (id = 3), but it did not.', ); @@ -133,7 +135,7 @@ public function test_a_composite_key_differing_only_in_the_last_key_is_accepted( public function test_a_missing_key_column_in_a_middle_row_is_rejected(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Column "id" not found in result row for keyset pagination'); + $this->expectExceptionMessageIsOrContains('Column "id" not found in result row for keyset pagination'); KeySetPage::of( pagination_key_set(pagination_key_asc('id')), @@ -147,7 +149,7 @@ public function test_a_missing_key_column_in_a_middle_row_is_rejected(): void public function test_a_null_key_in_a_middle_row_is_rejected(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'NULL value found in column "id" for keyset pagination; key columns must be non-null', ); @@ -163,7 +165,7 @@ public function test_a_null_key_in_a_middle_row_is_rejected(): void public function test_an_invalid_key_after_a_tie_is_rejected_before_the_tie(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'NULL value found in column "id" for keyset pagination; key columns must be non-null', ); @@ -179,7 +181,9 @@ public function test_an_invalid_key_after_a_tie_is_rejected_before_the_tie(): vo public function test_an_unsupported_key_type_in_a_middle_row_is_rejected(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Unsupported value type "array" in column "id" for keyset pagination'); + $this->expectExceptionMessageIsOrContains( + 'Unsupported value type "array" in column "id" for keyset pagination', + ); KeySetPage::of( pagination_key_set(pagination_key_asc('id')), diff --git a/src/adapter/etl-adapter-doctrine/tests/Flow/ETL/Adapter/Doctrine/Tests/Unit/IO/Extractor/Pagination/KeySetTest.php b/src/adapter/etl-adapter-doctrine/tests/Flow/ETL/Adapter/Doctrine/Tests/Unit/IO/Extractor/Pagination/KeySetTest.php index 229aeb8566..df7da23ecc 100644 --- a/src/adapter/etl-adapter-doctrine/tests/Flow/ETL/Adapter/Doctrine/Tests/Unit/IO/Extractor/Pagination/KeySetTest.php +++ b/src/adapter/etl-adapter-doctrine/tests/Flow/ETL/Adapter/Doctrine/Tests/Unit/IO/Extractor/Pagination/KeySetTest.php @@ -28,7 +28,7 @@ public function test_keys_are_reversed_into_a_list(): void public function test_requires_at_least_one_key(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('KeySet requires at least one key'); + $this->expectExceptionMessageIsOrContains('KeySet requires at least one key'); pagination_key_set(); } diff --git a/src/adapter/etl-adapter-doctrine/tests/Flow/ETL/Adapter/Doctrine/Tests/Unit/IO/Extractor/Pagination/KeyValuesTest.php b/src/adapter/etl-adapter-doctrine/tests/Flow/ETL/Adapter/Doctrine/Tests/Unit/IO/Extractor/Pagination/KeyValuesTest.php index 14813d242d..1a111d1170 100644 --- a/src/adapter/etl-adapter-doctrine/tests/Flow/ETL/Adapter/Doctrine/Tests/Unit/IO/Extractor/Pagination/KeyValuesTest.php +++ b/src/adapter/etl-adapter-doctrine/tests/Flow/ETL/Adapter/Doctrine/Tests/Unit/IO/Extractor/Pagination/KeyValuesTest.php @@ -57,7 +57,7 @@ public function test_equals_is_strict(): void public function test_missing_alias_is_rejected(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Column "id" not found in result row for keyset pagination'); + $this->expectExceptionMessageIsOrContains('Column "id" not found in result row for keyset pagination'); KeyValues::of(pagination_key_set(pagination_key_asc('id')), ['key_id'], ['id' => 1]); } @@ -65,7 +65,7 @@ public function test_missing_alias_is_rejected(): void public function test_null_value_is_rejected(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'NULL value found in column "id" for keyset pagination; key columns must be non-null', ); @@ -75,7 +75,9 @@ public function test_null_value_is_rejected(): void public function test_unsupported_value_type_is_rejected(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Unsupported value type "array" in column "id" for keyset pagination'); + $this->expectExceptionMessageIsOrContains( + 'Unsupported value type "array" in column "id" for keyset pagination', + ); KeyValues::of(pagination_key_set(pagination_key_asc('id')), ['key_id'], ['key_id' => [1]]); } diff --git a/src/adapter/etl-adapter-doctrine/tests/Flow/ETL/Adapter/Doctrine/Tests/Unit/IO/Extractor/TypedColumnsTest.php b/src/adapter/etl-adapter-doctrine/tests/Flow/ETL/Adapter/Doctrine/Tests/Unit/IO/Extractor/TypedColumnsTest.php index 832449dbfa..7eb29e4df4 100644 --- a/src/adapter/etl-adapter-doctrine/tests/Flow/ETL/Adapter/Doctrine/Tests/Unit/IO/Extractor/TypedColumnsTest.php +++ b/src/adapter/etl-adapter-doctrine/tests/Flow/ETL/Adapter/Doctrine/Tests/Unit/IO/Extractor/TypedColumnsTest.php @@ -25,7 +25,7 @@ final class TypedColumnsTest extends FlowTestCase public function test_a_driver_type_without_a_flow_type_is_refused(): void { $this->expectException(SchemaNotDerivableException::class); - $this->expectExceptionMessage('column "tags" has driver type "_text", which Flow has no type for'); + $this->expectExceptionMessageIsOrContains('column "tags" has driver type "_text", which Flow has no type for'); new TypedColumns()->schema( [new ResultColumn('id', 'int4'), new ResultColumn('tags', '_text')], @@ -37,7 +37,7 @@ public function test_a_driver_type_without_a_flow_type_is_refused(): void public function test_a_mysqli_constant_without_a_flow_type_is_refused(): void { $this->expectException(SchemaNotDerivableException::class); - $this->expectExceptionMessage('column "flags" has driver type "16", which Flow has no type for'); + $this->expectExceptionMessageIsOrContains('column "flags" has driver type "16", which Flow has no type for'); new TypedColumns()->schema([new ResultColumn('flags', MYSQLI_TYPE_BIT)], new MysqliTypesMap(), self::class); } diff --git a/src/adapter/etl-adapter-doctrine/tests/Flow/ETL/Adapter/Doctrine/Tests/Unit/Values/Schema/TypesMapTest.php b/src/adapter/etl-adapter-doctrine/tests/Flow/ETL/Adapter/Doctrine/Tests/Unit/Values/Schema/TypesMapTest.php index a98a03ec8a..1bfa0548ad 100644 --- a/src/adapter/etl-adapter-doctrine/tests/Flow/ETL/Adapter/Doctrine/Tests/Unit/Values/Schema/TypesMapTest.php +++ b/src/adapter/etl-adapter-doctrine/tests/Flow/ETL/Adapter/Doctrine/Tests/Unit/Values/Schema/TypesMapTest.php @@ -71,7 +71,7 @@ public function test_constructor_accepts_a_dbal_type_name_registered_only_on_a_c public function test_constructor_refuses_an_empty_dbal_type_name(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Doctrine DBAL type name for "' . StringType::class . '" must be a non-empty string.', ); @@ -83,7 +83,7 @@ public function test_constructor_refuses_an_empty_dbal_type_name(): void public function test_constructor_validates_flow_type_class_names(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('"InvalidClass" is not a valid type.'); + $this->expectExceptionMessageIsOrContains('"InvalidClass" is not a valid type.'); new TypesMap([ 'InvalidClass' => Types::STRING, @@ -93,7 +93,7 @@ public function test_constructor_validates_flow_type_class_names(): void public function test_constructor_validates_flow_type_with_non_string_key(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('"stdClass" is not a valid type.'); + $this->expectExceptionMessageIsOrContains('"stdClass" is not a valid type.'); new TypesMap([ stdClass::class => Types::STRING, @@ -128,7 +128,7 @@ public function test_constructor_with_empty_map_uses_default_flow_types(): void public function test_constructor_with_mixed_valid_and_invalid_types(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('"InvalidFlowType" is not a valid type.'); + $this->expectExceptionMessageIsOrContains('"InvalidFlowType" is not a valid type.'); new TypesMap([ StringType::class => Types::TEXT, @@ -149,7 +149,7 @@ public function test_custom_mapping_overrides_default_behavior(): void static::assertSame(Types::BIGINT, $typesMap->toDbalType(IntegerType::class)); $this->expectException(BaseInvalidArgumentException::class); - $this->expectExceptionMessage('"' . BooleanType::class . '" is not a valid type.'); + $this->expectExceptionMessageIsOrContains('"' . BooleanType::class . '" is not a valid type.'); $typesMap->toDbalType(BooleanType::class); } @@ -226,7 +226,7 @@ public function test_to_dbal_type_throws_exception_for_unknown_flow_type(): void ]); $this->expectException(BaseInvalidArgumentException::class); - $this->expectExceptionMessage('"' . IntegerType::class . '" is not a valid type.'); + $this->expectExceptionMessageIsOrContains('"' . IntegerType::class . '" is not a valid type.'); $typesMap->toDbalType(IntegerType::class); } @@ -256,7 +256,7 @@ public function test_to_flow_type_throws_exception_for_unknown_dbal_type(): void $typesMap = new TypesMap([]); $this->expectException(BaseInvalidArgumentException::class); - $this->expectExceptionMessage('"UnknownType" is not a valid Doctrine DBAL type.'); + $this->expectExceptionMessageIsOrContains('"UnknownType" is not a valid Doctrine DBAL type.'); $typesMap->toFlowType('UnknownType'); } diff --git a/src/adapter/etl-adapter-excel/tests/Flow/ETL/Adapter/Excel/Tests/Integration/IO/Extractor/ExcelExtractorTest.php b/src/adapter/etl-adapter-excel/tests/Flow/ETL/Adapter/Excel/Tests/Integration/IO/Extractor/ExcelExtractorTest.php index afbbfdef8f..8a93f0a8ed 100644 --- a/src/adapter/etl-adapter-excel/tests/Flow/ETL/Adapter/Excel/Tests/Integration/IO/Extractor/ExcelExtractorTest.php +++ b/src/adapter/etl-adapter-excel/tests/Flow/ETL/Adapter/Excel/Tests/Integration/IO/Extractor/ExcelExtractorTest.php @@ -117,7 +117,7 @@ public function test_a_corrupted_row_after_skipped_empty_rows_reports_its_sheet_ public function test_a_declared_column_the_header_lacks_is_a_schema_error(): void { $this->expectException(SchemaValidationException::class); - $this->expectExceptionMessage('"x"'); + $this->expectExceptionMessageIsOrContains('"x"'); ExtractedRows::of( from_excel(CraftedWorkbook::with(CraftedWorkbook::sheet( @@ -130,7 +130,7 @@ public function test_a_declared_column_the_header_lacks_is_a_schema_error(): voi public function test_an_empty_glob_refuses_to_infer_a_schema(): void { $this->expectException(InferredSchemaException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'from_excel() has nothing to infer a schema from: no file matching "' . path_real(ExcelFixtureContext::file('*.no-match'))->uri() . '" carries a column. Declare the schema with ->withSchema(...).', @@ -142,7 +142,7 @@ public function test_an_empty_glob_refuses_to_infer_a_schema(): void public function test_an_empty_glob_with_metadata_columns_refuses_to_infer_a_schema(): void { $this->expectException(InferredSchemaException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'from_excel() has nothing to infer a schema from: no file matching "' . path_real(ExcelFixtureContext::file('*.no-match'))->uri() . '" carries a column. Declare the schema with ->withSchema(...).', @@ -242,7 +242,7 @@ public function test_extract_excel_file_with_selected_sheet_name(string $fixture public function test_extract_excel_file_with_unknown_sheet_name(string $fixtureName): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage("Sheet with name: 'unknown' not found."); + $this->expectExceptionMessageIsOrContains("Sheet with name: 'unknown' not found."); df()->read(from_excel($fixtureName)->withSheetName('unknown'))->fetch()->toArray(); } @@ -277,7 +277,7 @@ public function test_extract_excel_nullable_file(string $fixtureName): void public function test_extract_excel_refuses_a_declared_nullable_column_the_sheet_lacks(string $fixtureName): void { $this->expectException(SchemaValidationException::class); - $this->expectExceptionMessage('Columns "missing" declared by the schema are not in the header of'); + $this->expectExceptionMessageIsOrContains('Columns "missing" declared by the schema are not in the header of'); df() ->read(from_excel($fixtureName)->withSchema(schema( @@ -293,7 +293,7 @@ public function test_extract_excel_refuses_a_declared_nullable_column_the_sheet_ public function test_extract_excel_refuses_a_declared_column_the_sheet_lacks(string $fixtureName): void { $this->expectException(SchemaValidationException::class); - $this->expectExceptionMessage('Columns "missing" declared by the schema are not in the header of'); + $this->expectExceptionMessageIsOrContains('Columns "missing" declared by the schema are not in the header of'); df() ->read(from_excel($fixtureName)->withSchema(schema( @@ -332,7 +332,7 @@ public function test_extract_with_explicit_xlsx_reader(): void public function test_extract_with_unknown_file(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Unsupported file format: n/a'); + $this->expectExceptionMessageIsOrContains('Unsupported file format: n/a'); df() ->read(from_excel(__DIR__ . '/../../../Fixtures/empty_file')) @@ -343,7 +343,7 @@ public function test_extract_with_unknown_file(): void public function test_extract_with_wrongly_selected_reader(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Failed to open file: Could not open'); + $this->expectExceptionMessageIsOrContains('Failed to open file: Could not open'); df() ->read(from_excel(__DIR__ . '/../../../Fixtures/fixture.xlsx')->withReader(ExcelReader::ODS)) @@ -512,7 +512,7 @@ public function test_a_value_past_the_sample_that_does_not_fit_fails_naming_colu static::assertEquals(schema(int_schema('v', nullable: true)), $extractor->schema()); $this->expectException(InferredSchemaException::class); - $this->expectExceptionMessage('column "v"'); + $this->expectExceptionMessageIsOrContains('column "v"'); df()->read($extractor)->fetch(); } @@ -564,7 +564,7 @@ public function test_an_empty_sheet_refuses_to_infer_a_schema_and_extracts_nothi ); $this->expectException(InferredSchemaException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'from_excel() has nothing to infer a schema from: no file matching "' . path_real(ExcelFixtureContext::file($fixture))->uri() . '" carries a column. Declare the schema with ->withSchema(...).', @@ -1145,7 +1145,7 @@ public function test_splits_preserve_source_order(): void public function test_a_split_whose_header_diverges_from_the_inferred_schema_is_refused(): void { $this->expectException(InferredSchemaException::class); - $this->expectExceptionMessage('unexpected [zip], missing []'); + $this->expectExceptionMessageIsOrContains('unexpected [zip], missing []'); SplitCoverage::rowCountPerSplit( from_excel(ExcelFixtureContext::file('diverging_header/*.xlsx')), diff --git a/src/adapter/etl-adapter-excel/tests/Flow/ETL/Adapter/Excel/Tests/Integration/IO/Extractor/ExcelFormatDetectorTest.php b/src/adapter/etl-adapter-excel/tests/Flow/ETL/Adapter/Excel/Tests/Integration/IO/Extractor/ExcelFormatDetectorTest.php index 7006f64c26..0d84c924da 100644 --- a/src/adapter/etl-adapter-excel/tests/Flow/ETL/Adapter/Excel/Tests/Integration/IO/Extractor/ExcelFormatDetectorTest.php +++ b/src/adapter/etl-adapter-excel/tests/Flow/ETL/Adapter/Excel/Tests/Integration/IO/Extractor/ExcelFormatDetectorTest.php @@ -18,7 +18,7 @@ final class ExcelFormatDetectorTest extends FlowTestCase public function test_a_zip_signed_file_that_cannot_be_opened_is_an_unsupported_format(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Unsupported file format: n/a'); + $this->expectExceptionMessageIsOrContains('Unsupported file format: n/a'); new ExcelFormatDetector(native_local_filesystem())->detect(ExcelFixtureContext::path('corrupt_zip')); } @@ -60,7 +60,7 @@ public function test_detects_xlsx_from_the_zip_signature(): void public function test_refuses_an_unknown_format(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Unsupported file format: n/a'); + $this->expectExceptionMessageIsOrContains('Unsupported file format: n/a'); new ExcelFormatDetector(native_local_filesystem())->detect(ExcelFixtureContext::path('empty_file')); } diff --git a/src/adapter/etl-adapter-excel/tests/Flow/ETL/Adapter/Excel/Tests/Integration/IO/Extractor/Sheet/OpenSheetTest.php b/src/adapter/etl-adapter-excel/tests/Flow/ETL/Adapter/Excel/Tests/Integration/IO/Extractor/Sheet/OpenSheetTest.php index 43750558ac..f867f68a71 100644 --- a/src/adapter/etl-adapter-excel/tests/Flow/ETL/Adapter/Excel/Tests/Integration/IO/Extractor/Sheet/OpenSheetTest.php +++ b/src/adapter/etl-adapter-excel/tests/Flow/ETL/Adapter/Excel/Tests/Integration/IO/Extractor/Sheet/OpenSheetTest.php @@ -44,7 +44,7 @@ public function test_closing_it_closes_the_reader_it_was_given(): void )->close(); $this->expectException(ReaderNotOpenedException::class); - $this->expectExceptionMessage('Reader should be opened first.'); + $this->expectExceptionMessageIsOrContains('Reader should be opened first.'); $reader->getSheetIterator(); } diff --git a/src/adapter/etl-adapter-excel/tests/Flow/ETL/Adapter/Excel/Tests/Integration/IO/Extractor/Sheet/XlsxSheetRowsTest.php b/src/adapter/etl-adapter-excel/tests/Flow/ETL/Adapter/Excel/Tests/Integration/IO/Extractor/Sheet/XlsxSheetRowsTest.php index ca723da007..b1e2cb95a9 100644 --- a/src/adapter/etl-adapter-excel/tests/Flow/ETL/Adapter/Excel/Tests/Integration/IO/Extractor/Sheet/XlsxSheetRowsTest.php +++ b/src/adapter/etl-adapter-excel/tests/Flow/ETL/Adapter/Excel/Tests/Integration/IO/Extractor/Sheet/XlsxSheetRowsTest.php @@ -151,7 +151,7 @@ public function test_a_malformed_sheet_is_refused_with_the_libxml_error(): void try { foreach ($reader->getSheetIterator() as $sheet) { $this->expectException(XMLProcessingException::class); - $this->expectExceptionMessage('Opening and ending tag mismatch: c line 1 and row'); + $this->expectExceptionMessageIsOrContains('Opening and ending tag mismatch: c line 1 and row'); iterator_to_array(new XlsxSheetRows($sheet)->values(), false); } diff --git a/src/adapter/etl-adapter-excel/tests/Flow/ETL/Adapter/Excel/Tests/Integration/IO/Extractor/WorkbookSheetTest.php b/src/adapter/etl-adapter-excel/tests/Flow/ETL/Adapter/Excel/Tests/Integration/IO/Extractor/WorkbookSheetTest.php index 96391bda44..59fe0e97e8 100644 --- a/src/adapter/etl-adapter-excel/tests/Flow/ETL/Adapter/Excel/Tests/Integration/IO/Extractor/WorkbookSheetTest.php +++ b/src/adapter/etl-adapter-excel/tests/Flow/ETL/Adapter/Excel/Tests/Integration/IO/Extractor/WorkbookSheetTest.php @@ -95,7 +95,7 @@ public function test_an_empty_sheet_has_no_columns_and_no_rows(): void public function test_a_format_the_workbook_is_not_is_reported_as_a_failed_open(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Failed to open file: Could not open'); + $this->expectExceptionMessageIsOrContains('Failed to open file: Could not open'); ExcelFixtureContext::sheet('fixture.xlsx', options: new ExcelReadOptions(format: ExcelReader::ODS))->columns(); } @@ -180,7 +180,7 @@ public function test_rows_resolve_the_columns_without_a_columns_call_first(): vo public function test_an_unknown_sheet_name_names_the_sheet_it_looked_for(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage("Sheet with name: 'unknown' not found."); + $this->expectExceptionMessageIsOrContains("Sheet with name: 'unknown' not found."); ExcelFixtureContext::sheet('fixture.xlsx', options: new ExcelReadOptions(sheetName: 'unknown'))->columns(); } diff --git a/src/adapter/etl-adapter-excel/tests/Flow/ETL/Adapter/Excel/Tests/Integration/IO/Loader/ExcelLoaderTest.php b/src/adapter/etl-adapter-excel/tests/Flow/ETL/Adapter/Excel/Tests/Integration/IO/Loader/ExcelLoaderTest.php index 11772b6ca9..d46488668d 100644 --- a/src/adapter/etl-adapter-excel/tests/Flow/ETL/Adapter/Excel/Tests/Integration/IO/Loader/ExcelLoaderTest.php +++ b/src/adapter/etl-adapter-excel/tests/Flow/ETL/Adapter/Excel/Tests/Integration/IO/Loader/ExcelLoaderTest.php @@ -425,7 +425,7 @@ public function test_round_trip_without_header(ExcelWriter $writer, string $exte public function test_sheet_name_and_sheet_name_from_entry_are_mutually_exclusive(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Cannot set both sheetName and sheetNameFromColumn'); + $this->expectExceptionMessageIsOrContains('Cannot set both sheetName and sheetNameFromColumn'); to_excel('/tmp/test.xlsx')->withSheetName('MySheet')->withSheetNameFromColumn('category'); } @@ -433,7 +433,7 @@ public function test_sheet_name_and_sheet_name_from_entry_are_mutually_exclusive public function test_sheet_name_from_entry_and_sheet_name_are_mutually_exclusive(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Cannot set both sheetName and sheetNameFromColumn'); + $this->expectExceptionMessageIsOrContains('Cannot set both sheetName and sheetNameFromColumn'); to_excel('/tmp/test.xlsx')->withSheetNameFromColumn('category')->withSheetName('MySheet'); } diff --git a/src/adapter/etl-adapter-excel/tests/Flow/ETL/Adapter/Excel/Tests/Unit/Functions/SheetNameAssertionTest.php b/src/adapter/etl-adapter-excel/tests/Flow/ETL/Adapter/Excel/Tests/Unit/Functions/SheetNameAssertionTest.php index 5540eeb9e7..70a993be7b 100644 --- a/src/adapter/etl-adapter-excel/tests/Flow/ETL/Adapter/Excel/Tests/Unit/Functions/SheetNameAssertionTest.php +++ b/src/adapter/etl-adapter-excel/tests/Flow/ETL/Adapter/Excel/Tests/Unit/Functions/SheetNameAssertionTest.php @@ -33,7 +33,7 @@ public function test_assert_passes_for_valid_name(string $validName): void public function test_assert_throws_for_invalid_name(string $invalidName): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Sheet name must be a valid Excel sheet name'); + $this->expectExceptionMessageIsOrContains('Sheet name must be a valid Excel sheet name'); SheetNameAssertion::assert($invalidName); } diff --git a/src/adapter/etl-adapter-excel/tests/Flow/ETL/Adapter/Excel/Tests/Unit/IO/Extractor/ExcelExtractorTest.php b/src/adapter/etl-adapter-excel/tests/Flow/ETL/Adapter/Excel/Tests/Unit/IO/Extractor/ExcelExtractorTest.php index affe03678a..7ab13a6c2f 100644 --- a/src/adapter/etl-adapter-excel/tests/Flow/ETL/Adapter/Excel/Tests/Unit/IO/Extractor/ExcelExtractorTest.php +++ b/src/adapter/etl-adapter-excel/tests/Flow/ETL/Adapter/Excel/Tests/Unit/IO/Extractor/ExcelExtractorTest.php @@ -20,7 +20,7 @@ final class ExcelExtractorTest extends FlowTestCase public function test_invalid_sheet_name(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Sheet name must be a valid Excel sheet name'); + $this->expectExceptionMessageIsOrContains('Sheet name must be a valid Excel sheet name'); from_excel(__DIR__ . '/../../../Fixtures/unknown')->withSheetName( 'This is veeeeeery long excel sheet name, longer than 32 characters', @@ -30,7 +30,7 @@ public function test_invalid_sheet_name(): void public function test_non_local_file(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Filesystem Flow\\Filesystem\\Local\\NativeLocalFilesystem serves "file://" paths, ' . 'given: "remote://unknown_file.xlsx".', ); @@ -42,7 +42,7 @@ public function test_non_local_path_on_a_matching_filesystem_still_reaches_the_o { // the supports() guard passes because the mount matches; isLocal() is what rejects it $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'ExcelExtractor reads local files only: OpenSpout opens them with ZipArchive, which needs a local path. ' . 'Copy the file to a local path first.', ); diff --git a/src/adapter/etl-adapter-excel/tests/Flow/ETL/Adapter/Excel/Tests/Unit/IO/Extractor/ExcelReadOptionsTest.php b/src/adapter/etl-adapter-excel/tests/Flow/ETL/Adapter/Excel/Tests/Unit/IO/Extractor/ExcelReadOptionsTest.php index 65bad32fc7..8dce289cea 100644 --- a/src/adapter/etl-adapter-excel/tests/Flow/ETL/Adapter/Excel/Tests/Unit/IO/Extractor/ExcelReadOptionsTest.php +++ b/src/adapter/etl-adapter-excel/tests/Flow/ETL/Adapter/Excel/Tests/Unit/IO/Extractor/ExcelReadOptionsTest.php @@ -25,7 +25,7 @@ public function test_defaults_read_the_first_sheet_with_a_header(): void public function test_an_invalid_sheet_name_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Sheet name must be a valid Excel sheet name'); + $this->expectExceptionMessageIsOrContains('Sheet name must be a valid Excel sheet name'); new ExcelReadOptions(sheetName: 'This is veeeeeery long excel sheet name, longer than 32 characters'); } @@ -33,7 +33,7 @@ public function test_an_invalid_sheet_name_is_refused(): void public function test_an_invalid_sheet_name_is_refused_by_the_wither_too(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Sheet name must be a valid Excel sheet name'); + $this->expectExceptionMessageIsOrContains('Sheet name must be a valid Excel sheet name'); new ExcelReadOptions()->withSheetName('This is veeeeeery long excel sheet name, longer than 32 characters'); } diff --git a/src/adapter/etl-adapter-google-sheet/tests/Flow/ETL/Adapter/GoogleSheet/Tests/Integration/IO/Extractor/GoogleSheetExtractorTest.php b/src/adapter/etl-adapter-google-sheet/tests/Flow/ETL/Adapter/GoogleSheet/Tests/Integration/IO/Extractor/GoogleSheetExtractorTest.php index 930b26ea87..8c147ff8a8 100644 --- a/src/adapter/etl-adapter-google-sheet/tests/Flow/ETL/Adapter/GoogleSheet/Tests/Integration/IO/Extractor/GoogleSheetExtractorTest.php +++ b/src/adapter/etl-adapter-google-sheet/tests/Flow/ETL/Adapter/GoogleSheet/Tests/Integration/IO/Extractor/GoogleSheetExtractorTest.php @@ -64,7 +64,7 @@ public function test_extract_expand_missing_columns(): void public function test_extract_refuses_a_declared_column_the_sheet_lacks(bool $nullable): void { $this->expectException(SchemaValidationException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Columns "id" declared by the schema are not in the header of google-sheet://1234567890/Sheet', ); @@ -147,7 +147,7 @@ public function test_extract_with_batches_without_header(): void public function test_extract_refuses_a_row_with_an_extra_cell(): void { $this->expectException(CorruptedRecordException::class); - $this->expectExceptionMessage('4 fields, the header has 3'); + $this->expectExceptionMessageIsOrContains('4 fields, the header has 3'); df() ->read(from_google_sheet( @@ -179,7 +179,7 @@ public function test_extract_with_limit(): void public function test_missing_columns_as_null_still_refuses_a_row_with_an_extra_cell(): void { $this->expectException(CorruptedRecordException::class); - $this->expectExceptionMessage('4 fields, the header has 3'); + $this->expectExceptionMessageIsOrContains('4 fields, the header has 3'); df() ->read(from_google_sheet( @@ -273,7 +273,7 @@ public function test_an_empty_sheet_refuses_to_infer_a_schema_and_extracts_nothi static::assertCount(0, iterator_to_array($extractor->extract(flow_context()->backend(), new Criteria()))); $this->expectException(InferredSchemaException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'from_google_sheet() has nothing to infer a schema from: spreadsheet "1234567890" sheet "Sheet" carries no ' . 'column. Declare the schema with ->withSchema(...).', ); diff --git a/src/adapter/etl-adapter-google-sheet/tests/Flow/ETL/Adapter/GoogleSheet/Tests/Unit/IO/Extractor/ColumnsTest.php b/src/adapter/etl-adapter-google-sheet/tests/Flow/ETL/Adapter/GoogleSheet/Tests/Unit/IO/Extractor/ColumnsTest.php index 818eb56fb8..ddfde3ab16 100644 --- a/src/adapter/etl-adapter-google-sheet/tests/Flow/ETL/Adapter/GoogleSheet/Tests/Unit/IO/Extractor/ColumnsTest.php +++ b/src/adapter/etl-adapter-google-sheet/tests/Flow/ETL/Adapter/GoogleSheet/Tests/Unit/IO/Extractor/ColumnsTest.php @@ -72,7 +72,7 @@ public function test_assertions( string $expectedExceptionMessage, ): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage($expectedExceptionMessage); + $this->expectExceptionMessageIsOrContains($expectedExceptionMessage); new Columns($sheetName, $startColumn, $endColumn); } diff --git a/src/adapter/etl-adapter-google-sheet/tests/Flow/ETL/Adapter/GoogleSheet/Tests/Unit/IO/Extractor/GoogleSheetExtractorTest.php b/src/adapter/etl-adapter-google-sheet/tests/Flow/ETL/Adapter/GoogleSheet/Tests/Unit/IO/Extractor/GoogleSheetExtractorTest.php index 19087a6923..9001624c64 100644 --- a/src/adapter/etl-adapter-google-sheet/tests/Flow/ETL/Adapter/GoogleSheet/Tests/Unit/IO/Extractor/GoogleSheetExtractorTest.php +++ b/src/adapter/etl-adapter-google-sheet/tests/Flow/ETL/Adapter/GoogleSheet/Tests/Unit/IO/Extractor/GoogleSheetExtractorTest.php @@ -89,7 +89,7 @@ public function test_its_fails_if_sheet_not_found(): void ->withMetadataColumns(true); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Max rows "0" must be greater than 0'); + $this->expectExceptionMessageIsOrContains('Max rows "0" must be greater than 0'); iterator_to_array(FlowTestCase::extracted($extractor, flow_context()->backend(), new Criteria())); } @@ -97,7 +97,7 @@ public function test_its_fails_if_sheet_not_found(): void public function test_schema_fails_the_same_way_for_a_missing_sheet(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Max rows "0" must be greater than 0'); + $this->expectExceptionMessageIsOrContains('Max rows "0" must be greater than 0'); GoogleSheetFixtureContext::extractor( GoogleSheetFixtureContext::serviceWithoutSheets(GoogleSheetFixtureContext::values()), @@ -107,7 +107,7 @@ public function test_schema_fails_the_same_way_for_a_missing_sheet(): void public function test_schema_of_everything_fails_on_a_missing_sheet(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('End row "0" must be greater than 0'); + $this->expectExceptionMessageIsOrContains('End row "0" must be greater than 0'); GoogleSheetFixtureContext::extractor( GoogleSheetFixtureContext::serviceWithoutSheets(GoogleSheetFixtureContext::values()), @@ -136,7 +136,7 @@ public function test_a_row_whose_cell_count_differs_from_the_header_is_refused(a public function test_a_declared_column_the_header_lacks_is_a_schema_error(): void { $this->expectException(SchemaValidationException::class); - $this->expectExceptionMessage('"x"'); + $this->expectExceptionMessageIsOrContains('"x"'); ExtractedRows::of(GoogleSheetFixtureContext::extractor(GoogleSheetFixtureContext::service(100, GoogleSheetFixtureContext::valuesAndBatches([], [ SheetValuesMother::batch([[['a', 'b', 'c'], ['1', '2', '3']]]), @@ -167,7 +167,7 @@ public function test_its_stop_fetching_data_if_processed_row_count_is_less_then_ public function test_rows_in_batch_must_be_positive_integer(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Rows per page must be greater than 0'); + $this->expectExceptionMessageIsOrContains('Rows per page must be greater than 0'); GoogleSheetFixtureContext::extractor(new Sheets())->withRowsPerPage(0); } @@ -563,7 +563,7 @@ public function test_works_for_no_data(): void ); $this->expectException(InferredSchemaException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'from_google_sheet() has nothing to infer a schema from: spreadsheet "spread-id" sheet "sheet" carries no ' . 'column. Declare the schema with ->withSchema(...).', ); diff --git a/src/adapter/etl-adapter-google-sheet/tests/Flow/ETL/Adapter/GoogleSheet/Tests/Unit/IO/Extractor/GoogleSheetReaderTest.php b/src/adapter/etl-adapter-google-sheet/tests/Flow/ETL/Adapter/GoogleSheet/Tests/Unit/IO/Extractor/GoogleSheetReaderTest.php index dd9e492565..e939975cbe 100644 --- a/src/adapter/etl-adapter-google-sheet/tests/Flow/ETL/Adapter/GoogleSheet/Tests/Unit/IO/Extractor/GoogleSheetReaderTest.php +++ b/src/adapter/etl-adapter-google-sheet/tests/Flow/ETL/Adapter/GoogleSheet/Tests/Unit/IO/Extractor/GoogleSheetReaderTest.php @@ -145,7 +145,7 @@ public function test_sample_of_an_empty_range_has_neither(): void public function test_sample_of_an_absent_sheet_fails(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Max rows "0" must be greater than 0'); + $this->expectExceptionMessageIsOrContains('Max rows "0" must be greater than 0'); GoogleSheetFixtureContext::reader( GoogleSheetFixtureContext::serviceWithoutSheets(GoogleSheetFixtureContext::values()), @@ -155,7 +155,7 @@ public function test_sample_of_an_absent_sheet_fails(): void public function test_sample_of_everything_on_an_absent_sheet_fails(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('End row "0" must be greater than 0'); + $this->expectExceptionMessageIsOrContains('End row "0" must be greater than 0'); GoogleSheetFixtureContext::reader( GoogleSheetFixtureContext::serviceWithoutSheets(GoogleSheetFixtureContext::values()), diff --git a/src/adapter/etl-adapter-google-sheet/tests/Flow/ETL/Adapter/GoogleSheet/Tests/Unit/IO/Extractor/SheetRangeTest.php b/src/adapter/etl-adapter-google-sheet/tests/Flow/ETL/Adapter/GoogleSheet/Tests/Unit/IO/Extractor/SheetRangeTest.php index 62e5f93772..4ca6929961 100644 --- a/src/adapter/etl-adapter-google-sheet/tests/Flow/ETL/Adapter/GoogleSheet/Tests/Unit/IO/Extractor/SheetRangeTest.php +++ b/src/adapter/etl-adapter-google-sheet/tests/Flow/ETL/Adapter/GoogleSheet/Tests/Unit/IO/Extractor/SheetRangeTest.php @@ -68,7 +68,7 @@ public static function invalid_cases(): Generator #[DataProvider('invalid_cases')] public function test_assertions(int $startRow, int $endRow, int $maxRows, string $expectedExceptionMessage): void { - $this->expectExceptionMessage($expectedExceptionMessage); + $this->expectExceptionMessageIsOrContains($expectedExceptionMessage); $this->expectException(InvalidArgumentException::class); new SheetRange(new Columns('Sheet2', 'A', 'B'), $startRow, $endRow, $maxRows); diff --git a/src/adapter/etl-adapter-http/tests/Flow/ETL/Adapter/Http/Tests/Integration/IO/Extractor/PsrHttpClientPaginatedExtractorTest.php b/src/adapter/etl-adapter-http/tests/Flow/ETL/Adapter/Http/Tests/Integration/IO/Extractor/PsrHttpClientPaginatedExtractorTest.php index f16fdbfb6f..634d45178e 100644 --- a/src/adapter/etl-adapter-http/tests/Flow/ETL/Adapter/Http/Tests/Integration/IO/Extractor/PsrHttpClientPaginatedExtractorTest.php +++ b/src/adapter/etl-adapter-http/tests/Flow/ETL/Adapter/Http/Tests/Integration/IO/Extractor/PsrHttpClientPaginatedExtractorTest.php @@ -395,7 +395,7 @@ public function test_schema_typed_response_body_with_missing_field(): void $client->addResponse(PaginationMother::jsonResponse(['login' => 'flow-php'])); $this->expectException(SchemaMismatchException::class); - $this->expectExceptionMessage('Rows do not match their schema: column "response_body" (row 0)'); + $this->expectExceptionMessageIsOrContains('Rows do not match their schema: column "response_body" (row 0)'); iterator_to_array(from_http_paginated( $client, diff --git a/src/adapter/etl-adapter-http/tests/Flow/ETL/Adapter/Http/Tests/Integration/IO/Extractor/PsrHttpClientStaticExtractorTest.php b/src/adapter/etl-adapter-http/tests/Flow/ETL/Adapter/Http/Tests/Integration/IO/Extractor/PsrHttpClientStaticExtractorTest.php index 796e106190..bdee9a4589 100644 --- a/src/adapter/etl-adapter-http/tests/Flow/ETL/Adapter/Http/Tests/Integration/IO/Extractor/PsrHttpClientStaticExtractorTest.php +++ b/src/adapter/etl-adapter-http/tests/Flow/ETL/Adapter/Http/Tests/Integration/IO/Extractor/PsrHttpClientStaticExtractorTest.php @@ -147,7 +147,7 @@ public function test_schema_typed_response_body_with_empty_body(): void $client->addResponse(new Response(200, ['Content-Type' => 'application/json'], '{}')); $this->expectException(SchemaMismatchException::class); - $this->expectExceptionMessage('Rows do not match their schema: column "response_body" (row 0)'); + $this->expectExceptionMessageIsOrContains('Rows do not match their schema: column "response_body" (row 0)'); from_static_http_requests( $client, @@ -170,7 +170,7 @@ public function test_schema_typed_response_body_with_missing_field(): void ], JSON_THROW_ON_ERROR))); $this->expectException(SchemaMismatchException::class); - $this->expectExceptionMessage('Rows do not match their schema: column "response_body" (row 0)'); + $this->expectExceptionMessageIsOrContains('Rows do not match their schema: column "response_body" (row 0)'); from_static_http_requests( $client, diff --git a/src/adapter/etl-adapter-http/tests/Flow/ETL/Adapter/Http/Tests/Unit/IO/Extractor/HttpDecoderTest.php b/src/adapter/etl-adapter-http/tests/Flow/ETL/Adapter/Http/Tests/Unit/IO/Extractor/HttpDecoderTest.php index 390bbaee83..68bdf5cb9d 100644 --- a/src/adapter/etl-adapter-http/tests/Flow/ETL/Adapter/Http/Tests/Unit/IO/Extractor/HttpDecoderTest.php +++ b/src/adapter/etl-adapter-http/tests/Flow/ETL/Adapter/Http/Tests/Unit/IO/Extractor/HttpDecoderTest.php @@ -131,7 +131,7 @@ public function test_a_row_carries_an_undecodable_body_as_text(): void public function test_invalid_json_body_throws_runtime_exception(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('status 503'); + $this->expectExceptionMessageIsOrContains('status 503'); new HttpDecoder()->structuredBody(new Response(503, ['Content-Type' => 'application/json'], 'not json {')); } diff --git a/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Integration/IO/Extractor/JsonExtractorTest.php b/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Integration/IO/Extractor/JsonExtractorTest.php index 98c14eacfa..8f867f9f15 100644 --- a/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Integration/IO/Extractor/JsonExtractorTest.php +++ b/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Integration/IO/Extractor/JsonExtractorTest.php @@ -62,7 +62,7 @@ final class JsonExtractorTest extends FlowTestCase public function test_a_key_first_seen_after_the_inference_sample_is_a_schema_error(): void { $this->expectException(InferredSchemaException::class); - $this->expectExceptionMessage('"c"'); + $this->expectExceptionMessageIsOrContains('"c"'); ExtractedRows::of(from_json( path('memory://source.json'), @@ -112,7 +112,7 @@ public function test_an_empty_array_lines_document_reads_no_rows(): void public function test_an_empty_glob_refuses_to_infer_a_schema(): void { $this->expectException(InferredSchemaException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'from_json() has nothing to infer a schema from: no file matching "memory://empty/*.json" carries a column. ' . 'Declare the schema with ->withSchema(...).', ); @@ -123,7 +123,7 @@ public function test_an_empty_glob_refuses_to_infer_a_schema(): void public function test_an_empty_glob_with_metadata_columns_refuses_to_infer_a_schema(): void { $this->expectException(InferredSchemaException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'from_json() has nothing to infer a schema from: no file matching "memory://empty/*.json" carries a column. ' . 'Declare the schema with ->withSchema(...).', ); @@ -148,7 +148,7 @@ public function test_an_empty_glob_with_a_declared_schema_answers_it_and_extract public function test_an_empty_lines_glob_refuses_to_infer_a_schema(): void { $this->expectException(InferredSchemaException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'from_json_lines() has nothing to infer a schema from: no file matching "memory://empty/*.jsonl" carries a column. ' . 'Declare the schema with ->withSchema(...).', ); @@ -159,7 +159,7 @@ public function test_an_empty_lines_glob_refuses_to_infer_a_schema(): void public function test_an_empty_lines_glob_with_metadata_columns_refuses_to_infer_a_schema(): void { $this->expectException(InferredSchemaException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'from_json_lines() has nothing to infer a schema from: no file matching "memory://empty/*.jsonl" carries a column. ' . 'Declare the schema with ->withSchema(...).', ); @@ -561,7 +561,7 @@ public function test_files_to_sniff_bounds_the_sources_opened(): void public function test_a_key_first_seen_past_the_sample_is_a_schema_error(): void { $this->expectException(InferredSchemaException::class); - $this->expectExceptionMessage('column "extra" is not declared by the schema'); + $this->expectExceptionMessageIsOrContains('column "extra" is not declared by the schema'); df(config()) ->read( @@ -616,7 +616,7 @@ public function test_an_empty_document_refuses_to_infer_a_schema_and_extracts_no ); $this->expectException(InferredSchemaException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'from_json() has nothing to infer a schema from: no file matching "' . path_real(JsonFixtureContext::path($fixture))->uri() . '" carries a column. Declare the schema with ->withSchema(...).', @@ -730,7 +730,7 @@ public function test_source_is_the_path_it_was_given(): void public function test_the_filesystem_must_serve_the_paths_protocol(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Pass the filesystem that handles this scheme'); + $this->expectExceptionMessageIsOrContains('Pass the filesystem that handles this scheme'); from_json(JsonFixtureContext::path('five_rows.json'), filesystem: memory_filesystem()); } diff --git a/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Integration/IO/Extractor/JsonFileReaderTest.php b/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Integration/IO/Extractor/JsonFileReaderTest.php index d7b31ff34c..ad22ceed5d 100644 --- a/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Integration/IO/Extractor/JsonFileReaderTest.php +++ b/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Integration/IO/Extractor/JsonFileReaderTest.php @@ -125,7 +125,7 @@ public function test_a_bare_scalar_line_is_refused(): void $stream = $filesystem->readFrom(JsonFixtureContext::source('scalar_line.jsonl')->path); $this->expectException(SyntaxErrorException::class); - $this->expectExceptionMessage("Unexpected symbol '5'"); + $this->expectExceptionMessageIsOrContains("Unexpected symbol '5'"); try { iterator_to_array($reader->lineItems($stream), false); @@ -238,7 +238,7 @@ public function test_a_scalar_record_is_refused(string $content, ?string $pointe $reader = JsonFixtureContext::reader(JsonFraming::Array, $filesystem, pointer: $pointer); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'A JSON record must be an object or an array, int given in "memory://scalar.json".', ); @@ -252,7 +252,7 @@ public function test_a_nul_only_line_is_refused(): void $stream = $filesystem->readFrom(JsonFixtureContext::source('nul_line.jsonl')->path); $this->expectException(SyntaxErrorException::class); - $this->expectExceptionMessage('Unexpected symbol'); + $this->expectExceptionMessageIsOrContains('Unexpected symbol'); try { iterator_to_array($reader->lineItems($stream), false); diff --git a/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Integration/IO/Extractor/JsonLinesExtractorTest.php b/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Integration/IO/Extractor/JsonLinesExtractorTest.php index 1c0bfd5eb5..c6f34864b4 100644 --- a/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Integration/IO/Extractor/JsonLinesExtractorTest.php +++ b/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Integration/IO/Extractor/JsonLinesExtractorTest.php @@ -61,7 +61,7 @@ final class JsonLinesExtractorTest extends FlowTestCase public function test_a_key_first_seen_after_the_inference_sample_is_a_schema_error(): void { $this->expectException(InferredSchemaException::class); - $this->expectExceptionMessage('"c"'); + $this->expectExceptionMessageIsOrContains('"c"'); ExtractedRows::of(from_json_lines( path('memory://source.jsonl'), @@ -474,7 +474,7 @@ public function test_files_to_sniff_bounds_the_sources_opened(): void public function test_a_key_first_seen_past_the_sample_is_a_schema_error(): void { $this->expectException(InferredSchemaException::class); - $this->expectExceptionMessage('column "extra" is not declared by the schema'); + $this->expectExceptionMessageIsOrContains('column "extra" is not declared by the schema'); df(config()) ->read( @@ -527,7 +527,7 @@ public function test_an_empty_document_refuses_to_infer_a_schema_and_extracts_no ); $this->expectException(InferredSchemaException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'from_json_lines() has nothing to infer a schema from: no file matching "' . path_real(JsonFixtureContext::path('empty.jsonl'))->uri() . '" carries a column. Declare the schema with ->withSchema(...).', @@ -658,7 +658,7 @@ public function test_source_is_the_path_it_was_given(): void public function test_the_filesystem_must_serve_the_paths_protocol(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Pass the filesystem that handles this scheme'); + $this->expectExceptionMessageIsOrContains('Pass the filesystem that handles this scheme'); from_json_lines(JsonFixtureContext::path('five_rows.jsonl'), filesystem: memory_filesystem()); } diff --git a/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Integration/RustJsonRefusalTest.php b/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Integration/RustJsonRefusalTest.php index acfb56e7fb..cdb7ba062e 100644 --- a/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Integration/RustJsonRefusalTest.php +++ b/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Integration/RustJsonRefusalTest.php @@ -111,7 +111,9 @@ public function test_a_scalar_line_is_refused_as_a_scalar_record(): void ); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('A JSON record must be an object or an array, int given in "memory://a.jsonl".'); + $this->expectExceptionMessageIsOrContains( + 'A JSON record must be an object or an array, int given in "memory://a.jsonl".', + ); try { iterator_to_array($open->batches(schema(int_schema('id')), 2, new PhpBackend()), false); diff --git a/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Unit/IO/Loader/JsonLinesLoaderTest.php b/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Unit/IO/Loader/JsonLinesLoaderTest.php index 741309e228..3fa66a03d1 100644 --- a/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Unit/IO/Loader/JsonLinesLoaderTest.php +++ b/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Unit/IO/Loader/JsonLinesLoaderTest.php @@ -80,7 +80,7 @@ public function test_pretty_print_is_ignored_and_the_other_options_apply(): void public function test_rows_in_new_lines_is_refused_for_json_lines(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('withRowsInNewLines() applies to to_json(), not to_json_lines()'); + $this->expectExceptionMessageIsOrContains('withRowsInNewLines() applies to to_json(), not to_json_lines()'); to_json_lines(path('memory://out.jsonl'), filesystem: memory_filesystem())->withRowsInNewLines(true); } diff --git a/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Unit/IO/Loader/JsonLoaderTest.php b/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Unit/IO/Loader/JsonLoaderTest.php index ab4d6f80d8..51ca1658f7 100644 --- a/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Unit/IO/Loader/JsonLoaderTest.php +++ b/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Unit/IO/Loader/JsonLoaderTest.php @@ -339,7 +339,7 @@ public function test_a_flag_the_native_writer_does_not_render_is_written_through public function test_a_flow_php_of_another_abi_is_refused(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('does not match flow-php/etl'); + $this->expectExceptionMessageIsOrContains('does not match flow-php/etl'); new JsonLoader( path('memory://out.json'), @@ -352,7 +352,7 @@ public function test_a_flow_php_of_another_abi_is_refused(): void public function test_in_task_keeps_the_lane_override(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('does not match flow-php/etl'); + $this->expectExceptionMessageIsOrContains('does not match flow-php/etl'); new JsonLoader( path('memory://out.json'), diff --git a/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Unit/IO/Loader/PhpJsonEncoderTest.php b/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Unit/IO/Loader/PhpJsonEncoderTest.php index fd8fa17415..f2c7d58ef9 100644 --- a/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Unit/IO/Loader/PhpJsonEncoderTest.php +++ b/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Unit/IO/Loader/PhpJsonEncoderTest.php @@ -304,7 +304,7 @@ public function test_float_text_does_not_depend_on_serialize_precision(): void public function test_a_not_finite_float_is_refused(int $flags): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Failed to encode JSON: Inf and NaN cannot be JSON encoded'); + $this->expectExceptionMessageIsOrContains('Failed to encode JSON: Inf and NaN cannot be JSON encoded'); new PhpJsonEncoder($flags)->encode(array_to_rows([['f' => NAN]], schema(float_schema('f'))), ','); } @@ -312,7 +312,7 @@ public function test_a_not_finite_float_is_refused(int $flags): void public function test_malformed_utf8_is_refused(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Failed to encode JSON: Malformed UTF-8 characters, possibly incorrectly encoded', ); diff --git a/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Unit/IO/Loader/RustJsonEncoderTest.php b/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Unit/IO/Loader/RustJsonEncoderTest.php index 4d93ffa339..dd19df3e6f 100644 --- a/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Unit/IO/Loader/RustJsonEncoderTest.php +++ b/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Unit/IO/Loader/RustJsonEncoderTest.php @@ -92,7 +92,7 @@ public function test_a_batch_under_another_schema_is_rendered_by_that_schema(): public function test_the_writer_refuses_a_flag_it_does_not_render(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('flow_php JSON writer supports only the JSON_THROW_ON_ERROR'); + $this->expectExceptionMessageIsOrContains('flow_php JSON writer supports only the JSON_THROW_ON_ERROR'); JsonEncoderMother::native(JSON_PRETTY_PRINT); } diff --git a/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Unit/IO/Schema/JsonSchema/ReferenceResolverTest.php b/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Unit/IO/Schema/JsonSchema/ReferenceResolverTest.php index 202da4b295..1fab8c935d 100644 --- a/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Unit/IO/Schema/JsonSchema/ReferenceResolverTest.php +++ b/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Unit/IO/Schema/JsonSchema/ReferenceResolverTest.php @@ -50,7 +50,7 @@ public function test_load_honors_document_id_as_base_uri(): void public function test_resolve_anchor_reference_is_not_supported(): void { $this->expectException(UnsupportedKeywordException::class); - $this->expectExceptionMessage('JSON Schema keyword "$anchor"'); + $this->expectExceptionMessageIsOrContains('JSON Schema keyword "$anchor"'); new ReferenceResolver()->resolve('#address', '', ['$defs' => []]); } @@ -112,7 +112,7 @@ public function test_resolve_internal_pointer_via_legacy_definitions(): void public function test_resolve_pointer_to_missing_segment_throws_exception(): void { $this->expectException(UnresolvableReferenceException::class); - $this->expectExceptionMessage('pointer segment "missing" does not exist'); + $this->expectExceptionMessageIsOrContains('pointer segment "missing" does not exist'); new ReferenceResolver()->resolve('#/$defs/missing', '', ['$defs' => []]); } @@ -120,7 +120,7 @@ public function test_resolve_pointer_to_missing_segment_throws_exception(): void public function test_resolve_pointer_to_scalar_throws_exception(): void { $this->expectException(UnresolvableReferenceException::class); - $this->expectExceptionMessage('reference target is not a schema object'); + $this->expectExceptionMessageIsOrContains('reference target is not a schema object'); new ReferenceResolver()->resolve('#/$defs/name', '', ['$defs' => ['name' => 'scalar']]); } @@ -162,7 +162,7 @@ public function test_resolve_relative_file_reference_from_subdirectory_with_poin public function test_resolve_relative_reference_without_base_uri_throws_exception(): void { $this->expectException(UnresolvableReferenceException::class); - $this->expectExceptionMessage('relative reference cannot be resolved without a base URI'); + $this->expectExceptionMessageIsOrContains('relative reference cannot be resolved without a base URI'); new ReferenceResolver()->resolve('address.json#/properties/street', '', []); } @@ -220,7 +220,7 @@ public function test_resolve_remote_reference_returning_invalid_json_throws_exce $client->addResponse(new Response(200, [], '{invalid')); $this->expectException(UnresolvableReferenceException::class); - $this->expectExceptionMessage('is not a valid JSON object'); + $this->expectExceptionMessageIsOrContains('is not a valid JSON object'); new ReferenceResolver($client, new Psr17Factory())->resolve( 'https://example.com/common.json#/$defs/status', @@ -235,7 +235,7 @@ public function test_resolve_remote_reference_returning_non_200_status_throws_ex $client->addResponse(new Response(404, [], '')); $this->expectException(UnresolvableReferenceException::class); - $this->expectExceptionMessage('returned status code 404'); + $this->expectExceptionMessageIsOrContains('returned status code 404'); new ReferenceResolver($client, new Psr17Factory())->resolve( 'https://example.com/common.json#/$defs/status', @@ -247,7 +247,7 @@ public function test_resolve_remote_reference_returning_non_200_status_throws_ex public function test_resolve_remote_reference_without_client_throws_exception(): void { $this->expectException(UnresolvableReferenceException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'resolving remote references requires a PSR-18 http client and a PSR-17 request factory', ); diff --git a/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Unit/IO/Schema/SchemaConverterTest.php b/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Unit/IO/Schema/SchemaConverterTest.php index ff3fc8476e..14c9951add 100644 --- a/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Unit/IO/Schema/SchemaConverterTest.php +++ b/src/adapter/etl-adapter-json/tests/Flow/ETL/Adapter/JSON/Tests/Unit/IO/Schema/SchemaConverterTest.php @@ -79,7 +79,7 @@ public function test_to_flow_all_of_merges_object_schemas(): void public function test_to_flow_all_of_with_conflicting_types_throws_exception(): void { $this->expectException(UnsupportedKeywordException::class); - $this->expectExceptionMessage('JSON Schema keyword "allOf" at path "value"'); + $this->expectExceptionMessageIsOrContains('JSON Schema keyword "allOf" at path "value"'); new SchemaConverter()->toFlowSchema([ 'type' => 'object', @@ -163,7 +163,7 @@ public function test_to_flow_basic_types(): void public function test_to_flow_circular_reference_throws_exception(): void { $this->expectException(CircularReferenceException::class); - $this->expectExceptionMessage('Circular reference detected: "#/$defs/node"'); + $this->expectExceptionMessageIsOrContains('Circular reference detected: "#/$defs/node"'); new SchemaConverter()->toFlowSchema([ 'type' => 'object', @@ -196,7 +196,7 @@ public function test_to_flow_const_becomes_scalar_with_enum_metadata(): void public function test_to_flow_boolean_false_property_schema_throws_exception(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('JSON Schema "false" at path "nothing" rejects all values'); + $this->expectExceptionMessageIsOrContains('JSON Schema "false" at path "nothing" rejects all values'); new SchemaConverter()->toFlowSchema([ 'type' => 'object', @@ -286,7 +286,9 @@ public function test_to_flow_enum_with_homogeneous_values_becomes_scalar(): void public function test_to_flow_enum_with_non_scalar_values_throws_exception(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('JSON Schema "enum" at path "value" must contain only scalar or null values'); + $this->expectExceptionMessageIsOrContains( + 'JSON Schema "enum" at path "value" must contain only scalar or null values', + ); new SchemaConverter()->toFlowSchema([ 'type' => 'object', @@ -371,7 +373,7 @@ public function test_to_flow_internal_reference_via_legacy_definitions(): void public function test_to_flow_invalid_json_string_throws_exception(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('JSON Schema document is not valid JSON'); + $this->expectExceptionMessageIsOrContains('JSON Schema document is not valid JSON'); new SchemaConverter()->toFlowSchema('{invalid'); } @@ -411,7 +413,7 @@ public function test_to_flow_nested_structures_lists_and_maps(): void public function test_to_flow_nested_union_inside_structure_is_refused(): void { $this->expectException(UnsupportedUnionTypeException::class); - $this->expectExceptionMessage('Column "config" cannot hold elements of type "integer|string"'); + $this->expectExceptionMessageIsOrContains('Column "config" cannot hold elements of type "integer|string"'); new SchemaConverter()->toFlowSchema([ 'type' => 'object', @@ -431,7 +433,7 @@ public function test_to_flow_nested_union_inside_structure_is_refused(): void public function test_to_flow_items_any_of_is_refused(): void { $this->expectException(UnsupportedUnionTypeException::class); - $this->expectExceptionMessage('Column "tags" cannot hold elements of type "integer|string"'); + $this->expectExceptionMessageIsOrContains('Column "tags" cannot hold elements of type "integer|string"'); new SchemaConverter()->toFlowSchema([ 'type' => 'object', @@ -578,7 +580,7 @@ public function test_to_flow_raw_json_string_document(): void public function test_to_flow_remote_reference_without_client_throws_exception(): void { $this->expectException(UnresolvableReferenceException::class); - $this->expectExceptionMessage('resolving remote references requires a PSR-18 http client'); + $this->expectExceptionMessageIsOrContains('resolving remote references requires a PSR-18 http client'); new SchemaConverter()->toFlowSchema([ 'type' => 'object', @@ -591,7 +593,7 @@ public function test_to_flow_remote_reference_without_client_throws_exception(): public function test_to_flow_root_without_object_type_throws_exception(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('JSON Schema root must have type "object"'); + $this->expectExceptionMessageIsOrContains('JSON Schema root must have type "object"'); new SchemaConverter()->toFlowSchema(['type' => 'array', 'items' => ['type' => 'string']]); } @@ -599,7 +601,7 @@ public function test_to_flow_root_without_object_type_throws_exception(): void public function test_to_flow_root_without_properties_throws_exception(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('JSON Schema root must have "properties"'); + $this->expectExceptionMessageIsOrContains('JSON Schema root must have "properties"'); new SchemaConverter()->toFlowSchema(['type' => 'object']); } @@ -671,7 +673,7 @@ public function test_to_flow_type_null_becomes_null_definition(): void public function test_to_flow_unknown_type_throws_exception(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Unsupported JSON Schema type "money" at path "value"'); + $this->expectExceptionMessageIsOrContains('Unsupported JSON Schema type "money" at path "value"'); new SchemaConverter()->toFlowSchema([ 'type' => 'object', @@ -697,7 +699,7 @@ public function test_to_flow_unknown_type_throws_exception(): void public function test_to_flow_unsupported_keywords_throw_exception(string $keyword): void { $this->expectException(UnsupportedKeywordException::class); - $this->expectExceptionMessage(sprintf('JSON Schema keyword "%s" at path "value"', $keyword)); + $this->expectExceptionMessageIsOrContains(sprintf('JSON Schema keyword "%s" at path "value"', $keyword)); new SchemaConverter()->toFlowSchema([ 'type' => 'object', @@ -820,7 +822,7 @@ public function test_to_json_schema_any_marked_definition_with_annotations_keeps public function test_to_json_schema_empty_schema_throws_exception(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Cannot convert empty Flow schema to JSON Schema'); + $this->expectExceptionMessageIsOrContains('Cannot convert empty Flow schema to JSON Schema'); new SchemaConverter()->toJsonSchema(schema()); } @@ -924,7 +926,7 @@ public function test_to_json_schema_map_of_mixed_omits_additional_properties(): public function test_to_json_schema_map_with_non_string_keys_throws_exception(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Only maps with string keys can be converted to JSON Schema'); + $this->expectExceptionMessageIsOrContains('Only maps with string keys can be converted to JSON Schema'); new SchemaConverter()->toJsonSchema(schema(map_schema('lookup', type_map(type_integer(), type_string())))); } diff --git a/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Integration/IO/Extractor/ParquetExtractorTest.php b/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Integration/IO/Extractor/ParquetExtractorTest.php index f9707d3007..64242d5582 100644 --- a/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Integration/IO/Extractor/ParquetExtractorTest.php +++ b/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Integration/IO/Extractor/ParquetExtractorTest.php @@ -216,7 +216,7 @@ public function test_a_read_whose_path_filter_rejects_every_file_closes_the_file public function test_a_glob_without_files_refuses_to_infer(): void { $this->expectException(InferredSchemaException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'from_parquet() has nothing to infer a schema from: no file matching "' . $this->cacheDir->suffix('**/*.parquet')->uri() . '" carries a column. Declare the schema with ->withSchema(...).', @@ -762,7 +762,7 @@ public function test_a_later_file_with_other_columns_throws_naming_both_files(): ]); $this->expectException(InferredSchemaException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Columns of memory://glob/b.parquet do not match the schema read from memory://glob/a.parquet:', ); diff --git a/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Integration/ParquetTest.php b/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Integration/ParquetTest.php index e0e923ec17..6b427eb288 100644 --- a/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Integration/ParquetTest.php +++ b/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Integration/ParquetTest.php @@ -421,7 +421,7 @@ public function test_a_float_round_trips_exactly(?ParquetEngine $engine): void public function test_arrow_refuses_a_string_that_is_not_valid_utf8(): void { $this->expectException(ParquetRuntimeException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Parquet column "name" row 0 holds a string that is not valid UTF-8; Parquet STRING columns require UTF-8', ); diff --git a/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Integration/ProjectionPushdownTest.php b/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Integration/ProjectionPushdownTest.php index 54e2e8eb5e..194fdf5ae7 100644 --- a/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Integration/ProjectionPushdownTest.php +++ b/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Integration/ProjectionPushdownTest.php @@ -130,7 +130,7 @@ public function test_a_column_the_pushed_columns_leave_out_fails_as_missing_inst ParquetFilesContext::orders($memory, 'memory://orders/a.parquet'); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('"country"'); + $this->expectExceptionMessageIsOrContains('"country"'); foreach (FlowTestCase::extracted( from_parquet(path('memory://orders/a.parquet'), filesystem: $memory), diff --git a/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/IO/ConfiguredParquetEngineTest.php b/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/IO/ConfiguredParquetEngineTest.php index 2417ef64a7..2e6288df1c 100644 --- a/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/IO/ConfiguredParquetEngineTest.php +++ b/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/IO/ConfiguredParquetEngineTest.php @@ -96,7 +96,9 @@ public function test_an_engine_without_a_normal_form_does_not_describe(): void public function test_a_class_that_is_not_an_engine_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Flow\ETL\Foundation\Describe\Rebuild is not a concrete ParquetEngine'); + $this->expectExceptionMessageIsOrContains( + 'Flow\ETL\Foundation\Describe\Rebuild is not a concrete ParquetEngine', + ); ConfiguredParquetEngine::fromDescription(['engine' => Rebuild::class, 'configuration' => []], new Rebuild()); } diff --git a/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/IO/Extractor/ParquetSourceFileTest.php b/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/IO/Extractor/ParquetSourceFileTest.php index a468089f69..ea502e3b64 100644 --- a/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/IO/Extractor/ParquetSourceFileTest.php +++ b/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/IO/Extractor/ParquetSourceFileTest.php @@ -126,7 +126,7 @@ public function test_an_arrow_engine_file_opens_the_php_lane(): void public function test_a_flow_php_of_another_abi_is_refused(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('does not match flow-php/etl'); + $this->expectExceptionMessageIsOrContains('does not match flow-php/etl'); ParquetSourceFileContext::over( new NativeLocalFilesystem(), diff --git a/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/IO/Extractor/PhpParquetOpenSourceTest.php b/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/IO/Extractor/PhpParquetOpenSourceTest.php index 0570ad4af3..b22c43c002 100644 --- a/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/IO/Extractor/PhpParquetOpenSourceTest.php +++ b/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/IO/Extractor/PhpParquetOpenSourceTest.php @@ -211,7 +211,7 @@ public function test_a_column_the_file_lacks_is_refused(): void ParquetFilesContext::rowGroups($filesystem, 'memory://groups.parquet', 10, 4); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Parquet file has no column "missing"'); + $this->expectExceptionMessageIsOrContains('Parquet file has no column "missing"'); iterator_to_array(new PhpParquetOpenSource(new Reader( engine: new PhpParquetEngine(), @@ -229,7 +229,7 @@ public function test_a_batch_size_below_one_is_refused(): void ParquetFilesContext::rowGroups($filesystem, 'memory://groups.parquet', 10, 4); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Parquet batch size must be greater than 0'); + $this->expectExceptionMessageIsOrContains('Parquet batch size must be greater than 0'); iterator_to_array(new PhpParquetOpenSource(new Reader( engine: new PhpParquetEngine(), diff --git a/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/IO/Extractor/RustParquetOpenSourceTest.php b/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/IO/Extractor/RustParquetOpenSourceTest.php index b9b697e7d9..f53851f324 100644 --- a/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/IO/Extractor/RustParquetOpenSourceTest.php +++ b/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/IO/Extractor/RustParquetOpenSourceTest.php @@ -184,7 +184,7 @@ public function test_an_exception_the_stream_throws_while_opening_surfaces_as_it ParquetFilesContext::rowGroups($filesystem, 'memory://groups.parquet', 10, 4); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Reading "memory://groups.parquet" failed'); + $this->expectExceptionMessageIsOrContains('Reading "memory://groups.parquet" failed'); new RustParquetOpenSource(new FlowPhpParquetFileReader(new FailingReadSourceStream($filesystem->readFrom(path( 'memory://groups.parquet', diff --git a/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/IO/Loader/ParquetFileWriterFactoryTest.php b/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/IO/Loader/ParquetFileWriterFactoryTest.php index c22a74b0bf..aac0b19d8a 100644 --- a/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/IO/Loader/ParquetFileWriterFactoryTest.php +++ b/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/IO/Loader/ParquetFileWriterFactoryTest.php @@ -216,7 +216,7 @@ public function test_any_other_engine_writes_the_file(): void public function test_a_flow_php_of_another_abi_is_refused(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('does not match flow-php/etl'); + $this->expectExceptionMessageIsOrContains('does not match flow-php/etl'); new ParquetFileWriterFactory( schema(int_schema('id')), diff --git a/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/IO/Loader/RustParquetFileWriterTest.php b/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/IO/Loader/RustParquetFileWriterTest.php index abd0231736..a8ae0855b1 100644 --- a/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/IO/Loader/RustParquetFileWriterTest.php +++ b/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/IO/Loader/RustParquetFileWriterTest.php @@ -54,7 +54,7 @@ public function test_a_string_that_is_not_valid_utf8_is_refused_naming_column_an $writer = ParquetFilesContext::nativeWriter(memory_filesystem(), 'memory://out.parquet', $schema); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Parquet column "name" row 1 holds a string that is not valid UTF-8; Parquet STRING columns require UTF-8', ); @@ -79,7 +79,7 @@ public function test_an_exception_append_throws_surfaces_as_itself(): void $writer->write(array_to_rows([['id' => 1]], $schema)); $this->expectException(FilesystemRuntimeException::class); - $this->expectExceptionMessage('Appending to "memory://out.parquet" failed'); + $this->expectExceptionMessageIsOrContains('Appending to "memory://out.parquet" failed'); $writer->close(); } diff --git a/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/Values/Schema/FlowToParquetSchemaTest.php b/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/Values/Schema/FlowToParquetSchemaTest.php index f80c6a4fbd..3e9d62578f 100644 --- a/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/Values/Schema/FlowToParquetSchemaTest.php +++ b/src/adapter/etl-adapter-parquet/tests/Flow/ETL/Adapter/Parquet/Tests/Unit/Values/Schema/FlowToParquetSchemaTest.php @@ -90,7 +90,7 @@ public function test_convert_etl_entries_to_parquet_fields(): void public function test_converting_structure_with_optional_elements_throws(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Parquet schema does not support structure optional elements, given: structure{a: string, b?: string}', ); @@ -103,7 +103,7 @@ public function test_converting_structure_with_optional_elements_throws(): void public function test_converting_structure_with_an_interleaved_optional_element_throws(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Parquet schema does not support structure optional elements, given: structure{b?: string, a: string}', ); @@ -116,7 +116,7 @@ public function test_converting_structure_with_an_interleaved_optional_element_t public function test_converting_nested_structure_with_optional_elements_throws(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Parquet schema does not support structure optional elements, given: structure{b: string, c?: string}', ); diff --git a/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Integration/IO/Extractor/PostgreSqlCursorExtractorTest.php b/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Integration/IO/Extractor/PostgreSqlCursorExtractorTest.php index 44e5f920a9..297afefc1b 100644 --- a/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Integration/IO/Extractor/PostgreSqlCursorExtractorTest.php +++ b/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Integration/IO/Extractor/PostgreSqlCursorExtractorTest.php @@ -225,7 +225,7 @@ public function test_a_multi_statement_query_is_refused_before_any_round_trip(): { // raw SQL on purpose: the query builder cannot express two statements $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('reads exactly one read-only SELECT or VALUES statement'); + $this->expectExceptionMessageIsOrContains('reads exactly one read-only SELECT or VALUES statement'); df()->read(from_pgsql_cursor($this->client, 'SELECT id FROM ' . $this->tableName . '; SELECT 1'))->fetch(); } diff --git a/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Integration/IO/Extractor/PostgreSqlKeySetExtractorTest.php b/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Integration/IO/Extractor/PostgreSqlKeySetExtractorTest.php index ba26280292..4fd46ac398 100644 --- a/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Integration/IO/Extractor/PostgreSqlKeySetExtractorTest.php +++ b/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Integration/IO/Extractor/PostgreSqlKeySetExtractorTest.php @@ -408,7 +408,7 @@ public function test_duplicate_keys_throw(): void ); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Keyset pagination requires unique keys, but two rows share the key'); + $this->expectExceptionMessageIsOrContains('Keyset pagination requires unique keys, but two rows share the key'); df() ->read(from_pgsql_key_set( @@ -434,7 +434,7 @@ public function test_equal_numeric_keys_with_different_scale_throw(): void ); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Keyset pagination expected the next page to start at the key'); + $this->expectExceptionMessageIsOrContains('Keyset pagination expected the next page to start at the key'); df() ->read(from_pgsql_key_set( @@ -471,7 +471,7 @@ public function test_null_in_secondary_key_throws_before_first_row(): void ->extract(flow_context()->backend(), new Criteria()); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Keyset pagination requires non-null keys, but a row has NULL in the key column(s) "a", "b"', ); @@ -504,7 +504,7 @@ public function test_null_keys_throw_at_every_batch_size(int $batchSize): void ); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Keyset pagination requires non-null keys, but a row has NULL in the key column(s) "k"', ); diff --git a/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Extractor/Pagination/KeySetPageTest.php b/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Extractor/Pagination/KeySetPageTest.php index 412e236f57..050c0e660b 100644 --- a/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Extractor/Pagination/KeySetPageTest.php +++ b/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Extractor/Pagination/KeySetPageTest.php @@ -18,7 +18,7 @@ final class KeySetPageTest extends FlowTestCase public function test_a_composite_tie_with_mixed_directions_is_rejected(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Keyset pagination requires unique keys, but two rows share the key (a = 2, b = 1)', ); @@ -46,7 +46,7 @@ public function test_a_page_not_starting_at_the_lookahead_is_rejected(): void $keySet = pgsql_pagination_key_set(pgsql_pagination_key_asc('k')); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( "Keyset pagination expected the next page to start at the key (k = 'A'), but it did not.", ); @@ -70,7 +70,7 @@ public function test_a_short_page_is_the_last(): void public function test_a_tie_inside_the_page_is_rejected(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Keyset pagination requires unique keys, but two rows share the key (id = 1); add a unique column (for example the primary key) to the key set as its least significant key', ); @@ -85,7 +85,9 @@ public function test_a_tie_inside_the_page_is_rejected(): void public function test_a_tie_with_the_lookahead_is_rejected(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Keyset pagination requires unique keys, but two rows share the key (id = 2)'); + $this->expectExceptionMessageIsOrContains( + 'Keyset pagination requires unique keys, but two rows share the key (id = 2)', + ); KeySetPage::of( pgsql_pagination_key_set(pgsql_pagination_key_asc('id')), @@ -100,7 +102,7 @@ public function test_an_empty_page_after_a_lookahead_is_rejected(): void $keySet = pgsql_pagination_key_set(pgsql_pagination_key_asc('id')); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Keyset pagination expected the next page to start at the key (id = 3), but it did not.', ); @@ -120,7 +122,7 @@ public function test_a_composite_key_differing_only_in_the_last_key_is_accepted( public function test_a_missing_key_column_in_a_middle_row_is_rejected(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Column "id" not found in result row for keyset pagination'); + $this->expectExceptionMessageIsOrContains('Column "id" not found in result row for keyset pagination'); KeySetPage::of( pgsql_pagination_key_set(pgsql_pagination_key_asc('id')), @@ -133,7 +135,7 @@ public function test_a_missing_key_column_in_a_middle_row_is_rejected(): void public function test_a_null_key_in_a_middle_row_is_rejected(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'NULL value found in column "id" for keyset pagination; key columns must be non-null', ); @@ -148,7 +150,7 @@ public function test_a_null_key_in_a_middle_row_is_rejected(): void public function test_an_invalid_key_after_a_tie_is_rejected_before_the_tie(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'NULL value found in column "id" for keyset pagination; key columns must be non-null', ); @@ -163,7 +165,9 @@ public function test_an_invalid_key_after_a_tie_is_rejected_before_the_tie(): vo public function test_an_unsupported_key_type_in_a_middle_row_is_rejected(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Unsupported value type "array" in column "id" for keyset pagination'); + $this->expectExceptionMessageIsOrContains( + 'Unsupported value type "array" in column "id" for keyset pagination', + ); KeySetPage::of( pgsql_pagination_key_set(pgsql_pagination_key_asc('id')), diff --git a/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Extractor/Pagination/KeyValuesTest.php b/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Extractor/Pagination/KeyValuesTest.php index 04792a3291..48d3defac3 100644 --- a/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Extractor/Pagination/KeyValuesTest.php +++ b/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Extractor/Pagination/KeyValuesTest.php @@ -47,7 +47,7 @@ public function test_equals_is_strict(): void public function test_missing_column_is_rejected(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Column "id" not found in result row for keyset pagination'); + $this->expectExceptionMessageIsOrContains('Column "id" not found in result row for keyset pagination'); KeyValues::of(pgsql_pagination_key_set(pgsql_pagination_key_asc('u.id')), ['other' => 1]); } @@ -55,7 +55,7 @@ public function test_missing_column_is_rejected(): void public function test_null_value_is_rejected(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'NULL value found in column "id" for keyset pagination; key columns must be non-null', ); @@ -65,7 +65,9 @@ public function test_null_value_is_rejected(): void public function test_unsupported_value_type_is_rejected(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Unsupported value type "array" in column "id" for keyset pagination'); + $this->expectExceptionMessageIsOrContains( + 'Unsupported value type "array" in column "id" for keyset pagination', + ); KeyValues::of(pgsql_pagination_key_set(pgsql_pagination_key_asc('id')), ['id' => [1]]); } diff --git a/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Extractor/Pagination/PaginationTest.php b/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Extractor/Pagination/PaginationTest.php index 0840b40275..10b70034ef 100644 --- a/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Extractor/Pagination/PaginationTest.php +++ b/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Extractor/Pagination/PaginationTest.php @@ -62,7 +62,7 @@ public function test_key_name_is_the_last_identifier_part(): void public function test_keyset_requires_at_least_one_key(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('KeySet requires at least one key'); + $this->expectExceptionMessageIsOrContains('KeySet requires at least one key'); new KeySet(); } diff --git a/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Extractor/PostgreSqlCursorExtractorTest.php b/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Extractor/PostgreSqlCursorExtractorTest.php index b0b1a78ee8..938507e1b7 100644 --- a/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Extractor/PostgreSqlCursorExtractorTest.php +++ b/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Extractor/PostgreSqlCursorExtractorTest.php @@ -147,7 +147,7 @@ public function test_a_non_select_statement_is_refused_before_any_round_trip(): $client = new SpyClient(); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('reads exactly one read-only SELECT or VALUES statement'); + $this->expectExceptionMessageIsOrContains('reads exactly one read-only SELECT or VALUES statement'); try { iterator_to_array( @@ -325,7 +325,9 @@ public function test_extract_refuses_to_read_when_the_schema_cannot_be_derived() $client = new SpyClient()->willDescribe(ColumnMother::of(['location' => 'point'])); $this->expectException(SchemaNotDerivableException::class); - $this->expectExceptionMessage('column "location" has PostgreSQL type "point", which Flow has no type for'); + $this->expectExceptionMessageIsOrContains( + 'column "location" has PostgreSQL type "point", which Flow has no type for', + ); try { iterator_to_array(from_pgsql_cursor($client, 'SELECT location FROM t')->extract( @@ -381,7 +383,7 @@ public function test_the_derived_schema_is_memoised(): void public function test_with_batch_size_validates_negative_value(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Batch size must be greater than 0, got -1'); + $this->expectExceptionMessageIsOrContains('Batch size must be greater than 0, got -1'); from_pgsql_cursor(new SpyClient(), 'SELECT id FROM t')->withBatchSize(-1); } @@ -389,7 +391,7 @@ public function test_with_batch_size_validates_negative_value(): void public function test_with_batch_size_validates_positive_value(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Batch size must be greater than 0, got 0'); + $this->expectExceptionMessageIsOrContains('Batch size must be greater than 0, got 0'); from_pgsql_cursor(new SpyClient(), 'SELECT id FROM t')->withBatchSize(0); } @@ -425,7 +427,7 @@ public function test_with_schema_returns_the_same_extractor(): void public function test_with_maximum_validates_negative_value(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Maximum must be greater than 0, got -1'); + $this->expectExceptionMessageIsOrContains('Maximum must be greater than 0, got -1'); from_pgsql_cursor(new SpyClient(), 'SELECT id FROM t')->withMaximum(-1); } @@ -433,7 +435,7 @@ public function test_with_maximum_validates_negative_value(): void public function test_with_maximum_validates_positive_value(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Maximum must be greater than 0, got 0'); + $this->expectExceptionMessageIsOrContains('Maximum must be greater than 0, got 0'); from_pgsql_cursor(new SpyClient(), 'SELECT id FROM t')->withMaximum(0); } diff --git a/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Extractor/PostgreSqlKeySetExtractorTest.php b/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Extractor/PostgreSqlKeySetExtractorTest.php index 910e4201f1..9033af5d3b 100644 --- a/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Extractor/PostgreSqlKeySetExtractorTest.php +++ b/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Extractor/PostgreSqlKeySetExtractorTest.php @@ -123,7 +123,7 @@ public function test_a_non_select_statement_is_refused_before_any_round_trip(): $client = new SpyClient(); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('reads exactly one read-only SELECT or VALUES statement'); + $this->expectExceptionMessageIsOrContains('reads exactly one read-only SELECT or VALUES statement'); try { iterator_to_array( @@ -248,7 +248,9 @@ public function test_extract_refuses_to_read_when_the_schema_cannot_be_derived() $client = new SpyClient()->willDescribe(ColumnMother::of(['location' => 'point'])); $this->expectException(SchemaNotDerivableException::class); - $this->expectExceptionMessage('column "location" has PostgreSQL type "point", which Flow has no type for'); + $this->expectExceptionMessageIsOrContains( + 'column "location" has PostgreSQL type "point", which Flow has no type for', + ); try { iterator_to_array(from_pgsql_key_set( @@ -324,7 +326,7 @@ public function test_with_schema_returns_the_same_extractor(): void public function test_with_maximum_validates_negative_value(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Maximum must be greater than 0, got -1'); + $this->expectExceptionMessageIsOrContains('Maximum must be greater than 0, got -1'); from_pgsql_key_set( new SpyClient(), @@ -336,7 +338,7 @@ public function test_with_maximum_validates_negative_value(): void public function test_with_maximum_validates_positive_value(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Maximum must be greater than 0, got 0'); + $this->expectExceptionMessageIsOrContains('Maximum must be greater than 0, got 0'); from_pgsql_key_set( new SpyClient(), @@ -348,7 +350,7 @@ public function test_with_maximum_validates_positive_value(): void public function test_with_batch_size_validates_negative_value(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Batch size must be greater than 0, got -1'); + $this->expectExceptionMessageIsOrContains('Batch size must be greater than 0, got -1'); from_pgsql_key_set( new SpyClient(), @@ -360,7 +362,7 @@ public function test_with_batch_size_validates_negative_value(): void public function test_with_batch_size_validates_positive_value(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Batch size must be greater than 0, got 0'); + $this->expectExceptionMessageIsOrContains('Batch size must be greater than 0, got 0'); from_pgsql_key_set( new SpyClient(), @@ -476,7 +478,7 @@ public function test_extract_builds_through_the_config_backend(): void public function test_duplicate_keys_throw_at_every_batch_size(int $batchSize): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Keyset pagination requires unique keys, but two rows share the key'); + $this->expectExceptionMessageIsOrContains('Keyset pagination requires unique keys, but two rows share the key'); iterator_to_array( from_pgsql_key_set( @@ -507,7 +509,7 @@ public function test_null_key_throws_without_reading_a_page_at_every_batch_size( $client = new SortedRowsClient(['k'], $rows, 'k', $order); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Keyset pagination requires non-null keys, but a row has NULL in the key column(s) "k"', ); @@ -545,7 +547,9 @@ public function test_unique_keys_read_every_row_at_every_batch_size(int $batchSi public function test_duplicate_keys_within_the_maximum_throw(int $batchSize): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Keyset pagination requires unique keys, but two rows share the key (id = 2)'); + $this->expectExceptionMessageIsOrContains( + 'Keyset pagination requires unique keys, but two rows share the key (id = 2)', + ); iterator_to_array( from_pgsql_key_set( @@ -620,7 +624,7 @@ public function test_null_key_throws_before_any_page(): void ->willFindNullKey(); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Keyset pagination requires non-null keys, but a row has NULL in the key column(s) "created_at", "id"; filter them out with IS NOT NULL or choose non-null keys', ); diff --git a/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Extractor/PostgreSqlLimitOffsetExtractorTest.php b/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Extractor/PostgreSqlLimitOffsetExtractorTest.php index 4485dbb6cb..e4b030cf30 100644 --- a/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Extractor/PostgreSqlLimitOffsetExtractorTest.php +++ b/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Extractor/PostgreSqlLimitOffsetExtractorTest.php @@ -51,7 +51,7 @@ public function test_a_non_select_statement_is_refused_before_any_round_trip(): // the SELECT guard runs before the ORDER BY guard, so an INSERT is not told it lacks an ORDER BY $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('reads exactly one read-only SELECT or VALUES statement'); + $this->expectExceptionMessageIsOrContains('reads exactly one read-only SELECT or VALUES statement'); try { iterator_to_array( @@ -69,7 +69,9 @@ public function test_a_subquery_order_does_not_order_the_pages(): void $client = new SpyClient(); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('LIMIT/OFFSET pagination requires ORDER BY clause for deterministic results'); + $this->expectExceptionMessageIsOrContains( + 'LIMIT/OFFSET pagination requires ORDER BY clause for deterministic results', + ); try { iterator_to_array(from_pgsql_limit_offset( @@ -191,7 +193,9 @@ public function test_extract_refuses_to_read_when_the_schema_cannot_be_derived() $client = new SpyClient()->willDescribe(ColumnMother::of(['location' => 'point'])); $this->expectException(SchemaNotDerivableException::class); - $this->expectExceptionMessage('column "location" has PostgreSQL type "point", which Flow has no type for'); + $this->expectExceptionMessageIsOrContains( + 'column "location" has PostgreSQL type "point", which Flow has no type for', + ); try { iterator_to_array(from_pgsql_limit_offset($client, 'SELECT location FROM t ORDER BY location')->extract( @@ -229,7 +233,9 @@ public function test_the_derived_schema_is_memoised(): void public function test_throws_exception_when_query_has_no_order_by(): void { - $this->expectExceptionMessage('LIMIT/OFFSET pagination requires ORDER BY clause for deterministic results'); + $this->expectExceptionMessageIsOrContains( + 'LIMIT/OFFSET pagination requires ORDER BY clause for deterministic results', + ); iterator_to_array(from_pgsql_limit_offset(new SpyClient(), 'SELECT id FROM t')->extract( flow_context()->backend(), @@ -261,7 +267,7 @@ public function test_with_schema_returns_the_same_extractor(): void public function test_with_maximum_validates_negative_value(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Maximum must be greater than 0, got -1'); + $this->expectExceptionMessageIsOrContains('Maximum must be greater than 0, got -1'); from_pgsql_limit_offset(new SpyClient(), 'SELECT id FROM t ORDER BY id')->withMaximum(-1); } @@ -269,7 +275,7 @@ public function test_with_maximum_validates_negative_value(): void public function test_with_maximum_validates_positive_value(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Maximum must be greater than 0, got 0'); + $this->expectExceptionMessageIsOrContains('Maximum must be greater than 0, got 0'); from_pgsql_limit_offset(new SpyClient(), 'SELECT id FROM t ORDER BY id')->withMaximum(0); } @@ -277,7 +283,7 @@ public function test_with_maximum_validates_positive_value(): void public function test_with_batch_size_validates_negative_value(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Batch size must be greater than 0, got -1'); + $this->expectExceptionMessageIsOrContains('Batch size must be greater than 0, got -1'); from_pgsql_limit_offset(new SpyClient(), 'SELECT id FROM t ORDER BY id')->withBatchSize(-1); } @@ -285,7 +291,7 @@ public function test_with_batch_size_validates_negative_value(): void public function test_with_batch_size_validates_positive_value(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Batch size must be greater than 0, got 0'); + $this->expectExceptionMessageIsOrContains('Batch size must be greater than 0, got 0'); from_pgsql_limit_offset(new SpyClient(), 'SELECT id FROM t ORDER BY id')->withBatchSize(0); } diff --git a/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Extractor/ReadQueryTest.php b/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Extractor/ReadQueryTest.php index 2eebef5f09..ca6146c5ea 100644 --- a/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Extractor/ReadQueryTest.php +++ b/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Extractor/ReadQueryTest.php @@ -64,7 +64,7 @@ public function test_a_query_builder_is_read_as_its_sql(): void public function test_a_query_that_writes_is_refused(string $sql): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( self::class . ' reads exactly one read-only SELECT or VALUES statement: Expected a read-only SELECT - the query holds a data-modifying WITH or SELECT ... INTO', ); @@ -103,7 +103,7 @@ public function test_a_syntax_error_is_a_parser_exception(): void public function test_anything_but_one_select_is_refused(string $sql): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage(self::class + $this->expectExceptionMessageIsOrContains(self::class . ' reads exactly one read-only SELECT or VALUES statement: Expected exactly one SELECT or VALUES statement'); ReadQuery::of($sql, self::class); diff --git a/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Extractor/ResultSchemaTest.php b/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Extractor/ResultSchemaTest.php index 6444a8bb08..60fd6bcaa7 100644 --- a/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Extractor/ResultSchemaTest.php +++ b/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Extractor/ResultSchemaTest.php @@ -116,7 +116,7 @@ public function test_every_mapped_postgresql_type_becomes_a_nullable_definition( public function test_an_unmapped_postgresql_type_is_refused(string $type): void { $this->expectException(SchemaNotDerivableException::class); - $this->expectExceptionMessage(sprintf( + $this->expectExceptionMessageIsOrContains(sprintf( 'column "value" has PostgreSQL type "%s", which Flow has no type for', $type, )); diff --git a/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Loader/PostgreSqlLoaderTest.php b/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Loader/PostgreSqlLoaderTest.php index bf17222304..a7eaff84f4 100644 --- a/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Loader/PostgreSqlLoaderTest.php +++ b/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Loader/PostgreSqlLoaderTest.php @@ -39,7 +39,7 @@ public function test_load_delete_requires_delete_options(): void $loader->withOperation(Operation::DELETE); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('DeleteOptions must be set for DELETE operation'); + $this->expectExceptionMessageIsOrContains('DeleteOptions must be set for DELETE operation'); $loader->load(array_to_rows([['id' => 1]], schema(int_schema('id'))), flow_context()->backend()); } @@ -54,7 +54,7 @@ public function test_load_delete_requires_primary_keys(): void $loader->withDeleteOptions(new DeleteOptions([])); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Primary keys must be specified for DELETE operation'); + $this->expectExceptionMessageIsOrContains('Primary keys must be specified for DELETE operation'); $loader->load(array_to_rows([['id' => 1]], schema(int_schema('id'))), flow_context()->backend()); } @@ -69,7 +69,7 @@ public function test_load_update_requires_primary_keys(): void $loader->withUpdateOptions(new UpdateOptions([])); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Primary keys must be specified for UPDATE operation'); + $this->expectExceptionMessageIsOrContains('Primary keys must be specified for UPDATE operation'); $loader->load(array_to_rows([['id' => 1]], schema(int_schema('id'))), flow_context()->backend()); } @@ -83,7 +83,7 @@ public function test_load_update_requires_update_options(): void $loader->withOperation(Operation::UPDATE); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('UpdateOptions must be set for UPDATE operation'); + $this->expectExceptionMessageIsOrContains('UpdateOptions must be set for UPDATE operation'); $loader->load(array_to_rows([['id' => 1]], schema(int_schema('id'))), flow_context()->backend()); } diff --git a/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Loader/QueryBuilder/DeleteQueryBuilderTest.php b/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Loader/QueryBuilder/DeleteQueryBuilderTest.php index 7252eaed8b..ed30e00878 100644 --- a/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Loader/QueryBuilder/DeleteQueryBuilderTest.php +++ b/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Loader/QueryBuilder/DeleteQueryBuilderTest.php @@ -47,7 +47,7 @@ public function test_build_throws_when_no_primary_keys(): void $builder = new DeleteQueryBuilder('users', new TypesMap()); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Primary keys must be specified for DELETE operation'); + $this->expectExceptionMessageIsOrContains('Primary keys must be specified for DELETE operation'); $builder->build(['id' => 1], schema(int_schema('id')), new DeleteOptions([])); } @@ -57,7 +57,7 @@ public function test_build_throws_when_primary_key_not_in_row(): void $builder = new DeleteQueryBuilder('users', new TypesMap()); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Primary key "id" not found in row'); + $this->expectExceptionMessageIsOrContains('Primary key "id" not found in row'); $builder->build(['name' => 'Alice'], schema(str_schema('name')), new DeleteOptions(['id'])); } diff --git a/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Loader/QueryBuilder/InsertQueryBuilderTest.php b/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Loader/QueryBuilder/InsertQueryBuilderTest.php index 07e1c686e8..c13011ed37 100644 --- a/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Loader/QueryBuilder/InsertQueryBuilderTest.php +++ b/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Loader/QueryBuilder/InsertQueryBuilderTest.php @@ -103,7 +103,7 @@ public function test_build_with_upsert_on_constraint(): void public function test_build_refuses_a_column_of_another_length(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Column "name" holds 1 values, the insert 2 rows'); + $this->expectExceptionMessageIsOrContains('Column "name" holds 1 values, the insert 2 rows'); new InsertQueryBuilder('users', new TypesMap())->build( ['id' => [1, 2], 'name' => ['Alice']], diff --git a/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Loader/QueryBuilder/UpdateQueryBuilderTest.php b/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Loader/QueryBuilder/UpdateQueryBuilderTest.php index f62981a20c..dce7f46d8b 100644 --- a/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Loader/QueryBuilder/UpdateQueryBuilderTest.php +++ b/src/adapter/etl-adapter-postgresql/tests/Flow/ETL/Adapter/PostgreSql/Tests/Unit/IO/Loader/QueryBuilder/UpdateQueryBuilderTest.php @@ -70,7 +70,7 @@ public function test_build_throws_when_no_primary_keys(): void $builder = new UpdateQueryBuilder('users', new TypesMap()); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Primary keys must be specified for UPDATE operation'); + $this->expectExceptionMessageIsOrContains('Primary keys must be specified for UPDATE operation'); $builder->build( ['id' => 1, 'name' => 'Alice'], @@ -84,7 +84,7 @@ public function test_build_throws_when_primary_key_not_in_row(): void $builder = new UpdateQueryBuilder('users', new TypesMap()); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Primary key "id" not found in row'); + $this->expectExceptionMessageIsOrContains('Primary key "id" not found in row'); $builder->build(['name' => 'Alice'], schema(str_schema('name')), new UpdateOptions(['id'])); } diff --git a/src/adapter/etl-adapter-seal/tests/Flow/ETL/Adapter/Seal/Tests/Unit/IO/Loader/SealLoaderTest.php b/src/adapter/etl-adapter-seal/tests/Flow/ETL/Adapter/Seal/Tests/Unit/IO/Loader/SealLoaderTest.php index 7b0f83371f..ea1592aa1d 100644 --- a/src/adapter/etl-adapter-seal/tests/Flow/ETL/Adapter/Seal/Tests/Unit/IO/Loader/SealLoaderTest.php +++ b/src/adapter/etl-adapter-seal/tests/Flow/ETL/Adapter/Seal/Tests/Unit/IO/Loader/SealLoaderTest.php @@ -38,7 +38,9 @@ public function test_deleting_with_a_non_scalar_identifier_entry_throws(): void $engine = $this->sealContext()->engine(to_seal_schema(schema(str_schema('id')), 'users', 'id')); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Column "id" cannot be used as a document identifier for DELETE operation'); + $this->expectExceptionMessageIsOrContains( + 'Column "id" cannot be used as a document identifier for DELETE operation', + ); to_seal_delete($engine, 'users')->load(array_to_rows([['id' => [ '1', diff --git a/src/adapter/etl-adapter-seal/tests/Flow/ETL/Adapter/Seal/Tests/Unit/Values/Schema/SchemaConverterTest.php b/src/adapter/etl-adapter-seal/tests/Flow/ETL/Adapter/Seal/Tests/Unit/Values/Schema/SchemaConverterTest.php index 0f6336abf0..bb80b8b346 100644 --- a/src/adapter/etl-adapter-seal/tests/Flow/ETL/Adapter/Seal/Tests/Unit/Values/Schema/SchemaConverterTest.php +++ b/src/adapter/etl-adapter-seal/tests/Flow/ETL/Adapter/Seal/Tests/Unit/Values/Schema/SchemaConverterTest.php @@ -105,7 +105,7 @@ public function test_throws_when_no_identifier_is_provided(): void public function test_throws_when_structure_has_optional_elements(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Seal schema does not support structure optional elements, given: structure{name: string, nickname?: string}', ); @@ -124,7 +124,7 @@ public function test_throws_when_structure_has_optional_elements(): void public function test_structure_with_an_interleaved_optional_element_throws(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Seal schema does not support structure optional elements, given: structure{nickname?: string, name: string}', ); diff --git a/src/adapter/etl-adapter-text/tests/Flow/ETL/Adapter/Text/Tests/Integration/IO/Extractor/TextExtractorTest.php b/src/adapter/etl-adapter-text/tests/Flow/ETL/Adapter/Text/Tests/Integration/IO/Extractor/TextExtractorTest.php index 08571a0298..b736fd91f7 100644 --- a/src/adapter/etl-adapter-text/tests/Flow/ETL/Adapter/Text/Tests/Integration/IO/Extractor/TextExtractorTest.php +++ b/src/adapter/etl-adapter-text/tests/Flow/ETL/Adapter/Text/Tests/Integration/IO/Extractor/TextExtractorTest.php @@ -238,7 +238,7 @@ public function test_extract_builds_through_the_config_backend(): void public function test_a_schema_without_the_text_column_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'from_text() reads every line into the "text" column, the schema declares no such column: line', ); diff --git a/src/adapter/etl-adapter-text/tests/Flow/ETL/Adapter/Text/Tests/Unit/IO/Loader/TextEncoderTest.php b/src/adapter/etl-adapter-text/tests/Flow/ETL/Adapter/Text/Tests/Unit/IO/Loader/TextEncoderTest.php index a15bc7e960..f1a6c8452f 100644 --- a/src/adapter/etl-adapter-text/tests/Flow/ETL/Adapter/Text/Tests/Unit/IO/Loader/TextEncoderTest.php +++ b/src/adapter/etl-adapter-text/tests/Flow/ETL/Adapter/Text/Tests/Unit/IO/Loader/TextEncoderTest.php @@ -67,7 +67,7 @@ public function test_encode_writes_the_text_of_a_value_that_is_no_string(): void public function test_encode_refuses_a_nested_column(Definition $definition, mixed $value): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Text data loader supports only scalar values, got array'); + $this->expectExceptionMessageIsOrContains('Text data loader supports only scalar values, got array'); new TextEncoder()->encode(array_to_rows([['a' => $value]], schema($definition))); } @@ -86,7 +86,9 @@ public function test_encode_ends_every_line_with_the_configured_separator(): voi public function test_encode_throws_when_a_row_has_more_than_one_column(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Text data loader writes at most one column, the batch has 3 columns.'); + $this->expectExceptionMessageIsOrContains( + 'Text data loader writes at most one column, the batch has 3 columns.', + ); new TextEncoder()->encode(array_to_rows( [['a' => 1, 'b' => 2, 'c' => 3], ['a' => 4, 'b' => 5, 'c' => 6]], diff --git a/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Integration/IO/Extractor/XMLParserExtractorTest.php b/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Integration/IO/Extractor/XMLParserExtractorTest.php index c60c023a89..43b11fa0cf 100644 --- a/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Integration/IO/Extractor/XMLParserExtractorTest.php +++ b/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Integration/IO/Extractor/XMLParserExtractorTest.php @@ -269,7 +269,9 @@ public function test_reading_xml_with_schema(): void public function test_reading_xml_refuses_a_not_null_column_the_document_lacks(): void { $this->expectException(SchemaMismatchException::class); - $this->expectExceptionMessage('column "missing" (row 0) declared by the schema is missing from the row'); + $this->expectExceptionMessageIsOrContains( + 'column "missing" (row 0) declared by the schema is missing from the row', + ); df() ->read(from_xml(__DIR__ . '/../../../Fixtures/simple_items.xml')->withSchema(schema( @@ -354,7 +356,7 @@ public function test_schema_is_the_declared_one(): void public function test_a_schema_without_the_node_column_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'from_xml() reads every matched element into the "node" column, the schema declares no such column: name', ); diff --git a/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Unit/IO/Extractor/XMLNodeCursorTest.php b/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Unit/IO/Extractor/XMLNodeCursorTest.php index cdc3e695fd..e7bca58096 100644 --- a/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Unit/IO/Extractor/XMLNodeCursorTest.php +++ b/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Unit/IO/Extractor/XMLNodeCursorTest.php @@ -60,7 +60,7 @@ public function test_a_document_without_a_root_has_no_stops(string $xml): void public function test_a_malformed_document_is_refused_at_its_end(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('XML Error: Extra content at the end of the document at line 1'); + $this->expectExceptionMessageIsOrContains('XML Error: Extra content at the end of the document at line 1'); iterator_to_array(new XMLNodeCursor('root/item')->of( new StringSourceStream(path('memory://a.xml'), 'junk'), diff --git a/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Unit/IO/Loader/XMLEncoderTest.php b/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Unit/IO/Loader/XMLEncoderTest.php index ee68ed042c..e106ea48b4 100644 --- a/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Unit/IO/Loader/XMLEncoderTest.php +++ b/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Unit/IO/Loader/XMLEncoderTest.php @@ -208,7 +208,7 @@ public function test_encoding_structure_with_optional_elements_throws(): void $encoder = new XMLEncoder(new DOMDocumentWriter()); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'XML encoder does not support structure optional elements, given: structure{city: string, zip?: string}', ); @@ -225,7 +225,7 @@ public function test_encoding_structure_with_an_interleaved_optional_element_thr $encoder = new XMLEncoder(new DOMDocumentWriter()); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'XML encoder does not support structure optional elements, given: structure{zip?: string, city: string}', ); diff --git a/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Unit/IO/Loader/XMLNodeTest.php b/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Unit/IO/Loader/XMLNodeTest.php index 361c849c13..7a1ca4179f 100644 --- a/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Unit/IO/Loader/XMLNodeTest.php +++ b/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Unit/IO/Loader/XMLNodeTest.php @@ -40,7 +40,7 @@ public function test_nested_equals_the_same_node_built_by_appending(): void public function test_an_empty_name_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('XMLNode name can not be empty'); + $this->expectExceptionMessageIsOrContains('XMLNode name can not be empty'); XMLNode::nested(''); } diff --git a/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Unit/IO/Loader/XMLWriter/StringXMLWriterTest.php b/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Unit/IO/Loader/XMLWriter/StringXMLWriterTest.php index b8c7a41fae..ea64a4b294 100644 --- a/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Unit/IO/Loader/XMLWriter/StringXMLWriterTest.php +++ b/src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Unit/IO/Loader/XMLWriter/StringXMLWriterTest.php @@ -97,7 +97,7 @@ public static function nodesOlderLibxmlWritesDifferently(): Generator public function test_an_attribute_name_dom_refuses_is_refused_with_its_exception(string $name): void { $this->expectException(DOMException::class); - $this->expectExceptionMessage('Invalid Character Error'); + $this->expectExceptionMessageIsOrContains('Invalid Character Error'); new StringXMLWriter()->write(XMLNode::nested('row', new XMLAttribute($name, '1'))); } @@ -108,7 +108,7 @@ public function test_an_attribute_name_dom_refuses_is_refused_with_its_exception public function test_an_element_name_dom_refuses_is_refused_with_its_exception(string $name): void { $this->expectException(DOMException::class); - $this->expectExceptionMessage('Invalid Character Error'); + $this->expectExceptionMessageIsOrContains('Invalid Character Error'); new StringXMLWriter()->write(XMLNode::flatNode($name, '1')); } diff --git a/src/bridge/filesystem/async-aws/tests/Flow/Filesystem/Bridge/AsyncAWS/Tests/Integration/AsyncAWSS3FilesystemTest.php b/src/bridge/filesystem/async-aws/tests/Flow/Filesystem/Bridge/AsyncAWS/Tests/Integration/AsyncAWSS3FilesystemTest.php index decc8de279..8082943747 100644 --- a/src/bridge/filesystem/async-aws/tests/Flow/Filesystem/Bridge/AsyncAWS/Tests/Integration/AsyncAWSS3FilesystemTest.php +++ b/src/bridge/filesystem/async-aws/tests/Flow/Filesystem/Bridge/AsyncAWS/Tests/Integration/AsyncAWSS3FilesystemTest.php @@ -500,7 +500,7 @@ public function test_write_to_tmp_dir_as_to_a_file(): void { $fs = aws_s3_filesystem($this->bucket(), $this->s3Client()); - $this->expectExceptionMessage('Cannot write to system tmp directory'); + $this->expectExceptionMessageIsOrContains('Cannot write to system tmp directory'); $fs->writeTo($fs->getSystemTmpDir()); } diff --git a/src/bridge/filesystem/async-aws/tests/Flow/Filesystem/Bridge/AsyncAWS/Tests/Unit/AsyncAWSS3FilesystemTest.php b/src/bridge/filesystem/async-aws/tests/Flow/Filesystem/Bridge/AsyncAWS/Tests/Unit/AsyncAWSS3FilesystemTest.php index 2065064f5c..195b687d1b 100644 --- a/src/bridge/filesystem/async-aws/tests/Flow/Filesystem/Bridge/AsyncAWS/Tests/Unit/AsyncAWSS3FilesystemTest.php +++ b/src/bridge/filesystem/async-aws/tests/Flow/Filesystem/Bridge/AsyncAWS/Tests/Unit/AsyncAWSS3FilesystemTest.php @@ -28,7 +28,7 @@ final class AsyncAWSS3FilesystemTest extends TestCase public function test_append_to_rejects_mismatched_scheme(): void { $this->expectException(InvalidSchemeException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Scheme "file://" is not supported by this protocol. Expected scheme is "aws-s3://"', ); diff --git a/src/bridge/filesystem/async-aws/tests/Flow/Filesystem/Bridge/AsyncAWS/Tests/Unit/ConfiguredS3ClientTest.php b/src/bridge/filesystem/async-aws/tests/Flow/Filesystem/Bridge/AsyncAWS/Tests/Unit/ConfiguredS3ClientTest.php index a08aab833a..bce89232d6 100644 --- a/src/bridge/filesystem/async-aws/tests/Flow/Filesystem/Bridge/AsyncAWS/Tests/Unit/ConfiguredS3ClientTest.php +++ b/src/bridge/filesystem/async-aws/tests/Flow/Filesystem/Bridge/AsyncAWS/Tests/Unit/ConfiguredS3ClientTest.php @@ -101,7 +101,7 @@ public function test_max_duration_bounds_a_call_with_its_retries(): void public function test_unknown_http_key_is_rejected(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'S3 client "http" holds unknown keys: timeouts. Allowed: timeout, max_duration, max_retries', ); @@ -111,7 +111,7 @@ public function test_unknown_http_key_is_rejected(): void public function test_an_unknown_client_option_is_reported_by_async_aws(): void { $this->expectException(InvalidArgument::class); - $this->expectExceptionMessage('Invalid option(s) "regions"'); + $this->expectExceptionMessageIsOrContains('Invalid option(s) "regions"'); AsyncAWSS3Filesystem::fromArray([ 'protocol' => 'aws-s3', @@ -124,7 +124,7 @@ public function test_an_unknown_client_option_is_reported_by_async_aws(): void public function test_http_that_is_not_an_array_is_rejected(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'S3 client "http" must be an array of timeout, max_duration and max_retries, got string', ); @@ -160,7 +160,7 @@ public static function invalid_http_limits(): Generator public function test_invalid_http_limit_is_rejected(array $http, string $message): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage($message); + $this->expectExceptionMessageIsOrContains($message); new ConfiguredS3Client(['region' => 'x', 'http' => $http]); } diff --git a/src/bridge/filesystem/async-aws/tests/Flow/Filesystem/Bridge/AsyncAWS/Tests/Unit/OptionsTest.php b/src/bridge/filesystem/async-aws/tests/Flow/Filesystem/Bridge/AsyncAWS/Tests/Unit/OptionsTest.php index e0df33c426..f0fc6975c9 100644 --- a/src/bridge/filesystem/async-aws/tests/Flow/Filesystem/Bridge/AsyncAWS/Tests/Unit/OptionsTest.php +++ b/src/bridge/filesystem/async-aws/tests/Flow/Filesystem/Bridge/AsyncAWS/Tests/Unit/OptionsTest.php @@ -94,7 +94,7 @@ public function test_from_array_refuses_a_missing_key(): void public function test_copy_part_size_outside_5_mib_and_5_gb_is_rejected(int $bytes): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage("Copy part size must be between 5 MiB and 5 GB, got {$bytes} bytes"); + $this->expectExceptionMessageIsOrContains("Copy part size must be between 5 MiB and 5 GB, got {$bytes} bytes"); new Options()->withCopyPartSize($bytes); } diff --git a/src/bridge/filesystem/azure/tests/Flow/Filesystem/Bridge/Azure/Tests/Integration/AzureBlobFilesystemTest.php b/src/bridge/filesystem/azure/tests/Flow/Filesystem/Bridge/Azure/Tests/Integration/AzureBlobFilesystemTest.php index aaf635b951..c15f01a0d5 100644 --- a/src/bridge/filesystem/azure/tests/Flow/Filesystem/Bridge/Azure/Tests/Integration/AzureBlobFilesystemTest.php +++ b/src/bridge/filesystem/azure/tests/Flow/Filesystem/Bridge/Azure/Tests/Integration/AzureBlobFilesystemTest.php @@ -470,7 +470,7 @@ public function test_write_to_tmp_dir_as_to_a_file(): void { $fs = azure_filesystem($this->blobService('flow-php')); - $this->expectExceptionMessage('Cannot write to system tmp directory'); + $this->expectExceptionMessageIsOrContains('Cannot write to system tmp directory'); $fs->writeTo($fs->getSystemTmpDir()); } diff --git a/src/bridge/filesystem/azure/tests/Flow/Filesystem/Bridge/Azure/Tests/Unit/AzureBlobFilesystemTest.php b/src/bridge/filesystem/azure/tests/Flow/Filesystem/Bridge/Azure/Tests/Unit/AzureBlobFilesystemTest.php index e6dde8ebbd..6695d6d803 100644 --- a/src/bridge/filesystem/azure/tests/Flow/Filesystem/Bridge/Azure/Tests/Unit/AzureBlobFilesystemTest.php +++ b/src/bridge/filesystem/azure/tests/Flow/Filesystem/Bridge/Azure/Tests/Unit/AzureBlobFilesystemTest.php @@ -27,7 +27,7 @@ final class AzureBlobFilesystemTest extends TestCase public function test_append_to_rejects_mismatched_scheme(): void { $this->expectException(InvalidSchemeException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Scheme "file://" is not supported by this protocol. Expected scheme is "azure-blob://"', ); diff --git a/src/bridge/filesystem/azure/tests/Flow/Filesystem/Bridge/Azure/Tests/Unit/ConfiguredBlobServiceTest.php b/src/bridge/filesystem/azure/tests/Flow/Filesystem/Bridge/Azure/Tests/Unit/ConfiguredBlobServiceTest.php index 5ca0a8ee70..c403b47213 100644 --- a/src/bridge/filesystem/azure/tests/Flow/Filesystem/Bridge/Azure/Tests/Unit/ConfiguredBlobServiceTest.php +++ b/src/bridge/filesystem/azure/tests/Flow/Filesystem/Bridge/Azure/Tests/Unit/ConfiguredBlobServiceTest.php @@ -78,7 +78,7 @@ public function test_an_azurite_service_is_built(): void public function test_an_unknown_key_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Azure blob service configuration holds unknown keys: token'); + $this->expectExceptionMessageIsOrContains('Azure blob service configuration holds unknown keys: token'); ConfiguredBlobService::fromArray([ 'account_name' => 'a', @@ -91,7 +91,7 @@ public function test_an_unknown_key_is_refused(): void public function test_a_url_that_is_neither_azure_nor_azurite_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Azure blob service "url" must be {azure: {host?}} or {azurite: {host?, port?, https?}}', ); @@ -106,7 +106,7 @@ public function test_a_url_that_is_neither_azure_nor_azurite_is_refused(): void public function test_an_empty_account_name_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Azure account name can not be empty'); + $this->expectExceptionMessageIsOrContains('Azure account name can not be empty'); new ConfiguredBlobService('', 'c', 'k'); } @@ -168,7 +168,7 @@ public function test_timeout_ends_a_call_to_a_silent_server(): void public function test_unknown_http_key_is_rejected(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Azure blob service "http" holds unknown keys: timeouts. Allowed: timeout, max_duration, max_retries', ); @@ -212,7 +212,7 @@ public static function invalid_http_limits(): Generator public function test_invalid_http_limit_is_rejected(array $http, string $message): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage($message); + $this->expectExceptionMessageIsOrContains($message); ConfiguredBlobService::fromArray([ 'account_name' => 'a', diff --git a/src/bridge/filesystem/azure/tests/Flow/Filesystem/Bridge/Azure/Tests/Unit/OptionsTest.php b/src/bridge/filesystem/azure/tests/Flow/Filesystem/Bridge/Azure/Tests/Unit/OptionsTest.php index 49a6df038f..96dffa4766 100644 --- a/src/bridge/filesystem/azure/tests/Flow/Filesystem/Bridge/Azure/Tests/Unit/OptionsTest.php +++ b/src/bridge/filesystem/azure/tests/Flow/Filesystem/Bridge/Azure/Tests/Unit/OptionsTest.php @@ -87,7 +87,7 @@ public function test_copy_part_size_defaults_to_256_mib(): void public function test_copy_part_size_outside_1_byte_to_256_mib_is_refused(int $bytes): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage(sprintf( + $this->expectExceptionMessageIsOrContains(sprintf( 'Copy part size must be between 1 byte and 256 MiB, got %d bytes', $bytes, )); @@ -112,7 +112,7 @@ public function test_from_array_refuses_a_configuration_without_copy_part_size() unset($normalized['copy_part_size']); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Azure options must hold block_location, block_permissions, block_size, bulk_delete, copy_part_size, file_fast_path, list_blob_include, list_blob_max_results, list_blob_show_only and tmp_dir', ); diff --git a/src/bridge/filesystem/sftp/tests/Flow/Filesystem/Bridge/SFTP/Tests/Integration/SFTPFilesystemTest.php b/src/bridge/filesystem/sftp/tests/Flow/Filesystem/Bridge/SFTP/Tests/Integration/SFTPFilesystemTest.php index 17b40eaa58..5873a425d2 100644 --- a/src/bridge/filesystem/sftp/tests/Flow/Filesystem/Bridge/SFTP/Tests/Integration/SFTPFilesystemTest.php +++ b/src/bridge/filesystem/sftp/tests/Flow/Filesystem/Bridge/SFTP/Tests/Integration/SFTPFilesystemTest.php @@ -58,14 +58,14 @@ public function test_the_system_tmp_directory_can_be_pointed_at_a_writable_path( static::assertTrue($filesystem->getSystemTmpDir()->isEqual($tmpDir)); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Cannot write to system tmp directory'); + $this->expectExceptionMessageIsOrContains('Cannot write to system tmp directory'); $filesystem->writeTo($tmpDir); } public function test_creating_a_file_exclusively_is_not_supported(): void { - $this->expectExceptionMessage('SFTP does not support creating files exclusively'); + $this->expectExceptionMessageIsOrContains('SFTP does not support creating files exclusively'); $this->sftpContext()->filesystem()->create(path('sftp:///upload/claim.csv')); } diff --git a/src/bridge/filesystem/sftp/tests/Flow/Filesystem/Bridge/SFTP/Tests/Integration/SFTPLostSessionTest.php b/src/bridge/filesystem/sftp/tests/Flow/Filesystem/Bridge/SFTP/Tests/Integration/SFTPLostSessionTest.php index 1bc97b4fc2..cb71e344f6 100644 --- a/src/bridge/filesystem/sftp/tests/Flow/Filesystem/Bridge/SFTP/Tests/Integration/SFTPLostSessionTest.php +++ b/src/bridge/filesystem/sftp/tests/Flow/Filesystem/Bridge/SFTP/Tests/Integration/SFTPLostSessionTest.php @@ -49,7 +49,7 @@ public function test_reading_fails_instead_of_returning_empty_content(): void $sftp->disconnect(); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('SFTP session is no longer usable'); + $this->expectExceptionMessageIsOrContains('SFTP session is no longer usable'); $filesystem->readFrom(path('sftp:///upload/orders.csv'))->content(); } @@ -99,7 +99,7 @@ public function test_uploading_a_block_fails_instead_of_writing_nothing(): void $sftp->disconnect(); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('SFTP session is no longer usable'); + $this->expectExceptionMessageIsOrContains('SFTP session is no longer usable'); $stream->close(); } diff --git a/src/bridge/filesystem/sftp/tests/Flow/Filesystem/Bridge/SFTP/Tests/Unit/ConfiguredSFTPClientTest.php b/src/bridge/filesystem/sftp/tests/Flow/Filesystem/Bridge/SFTP/Tests/Unit/ConfiguredSFTPClientTest.php index 249c9894b0..229ba6e89a 100644 --- a/src/bridge/filesystem/sftp/tests/Flow/Filesystem/Bridge/SFTP/Tests/Unit/ConfiguredSFTPClientTest.php +++ b/src/bridge/filesystem/sftp/tests/Flow/Filesystem/Bridge/SFTP/Tests/Unit/ConfiguredSFTPClientTest.php @@ -55,7 +55,9 @@ public function test_the_port_defaults_to_22(): void public function test_both_credentials_are_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('SFTP client configuration must hold exactly one of "password" or "private_key"'); + $this->expectExceptionMessageIsOrContains( + 'SFTP client configuration must hold exactly one of "password" or "private_key"', + ); ConfiguredSFTPClient::fromArray(['host' => 'h', 'user' => 'u', 'password' => 'p', 'private_key' => 'k']); } @@ -70,7 +72,7 @@ public function test_no_credential_is_refused(): void public function test_a_passphrase_with_a_password_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('SFTP client "passphrase" belongs to a "private_key"'); + $this->expectExceptionMessageIsOrContains('SFTP client "passphrase" belongs to a "private_key"'); ConfiguredSFTPClient::fromArray(['host' => 'h', 'user' => 'u', 'password' => 'p', 'passphrase' => 'x']); } @@ -78,7 +80,7 @@ public function test_a_passphrase_with_a_password_is_refused(): void public function test_an_unknown_key_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('SFTP client configuration holds unknown keys: fingerprint'); + $this->expectExceptionMessageIsOrContains('SFTP client configuration holds unknown keys: fingerprint'); ConfiguredSFTPClient::fromArray(['host' => 'h', 'user' => 'u', 'password' => 'p', 'fingerprint' => 'x']); } @@ -86,7 +88,7 @@ public function test_an_unknown_key_is_refused(): void public function test_an_empty_host_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('SFTP host can not be empty'); + $this->expectExceptionMessageIsOrContains('SFTP host can not be empty'); new ConfiguredSFTPClient('', 'u', new SFTPPassword('p')); } @@ -94,7 +96,7 @@ public function test_an_empty_host_is_refused(): void public function test_a_port_out_of_range_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('SFTP port must be between 1 and 65535, given: 70000'); + $this->expectExceptionMessageIsOrContains('SFTP port must be between 1 and 65535, given: 70000'); new ConfiguredSFTPClient('h', 'u', new SFTPPassword('p'), 70000); } diff --git a/src/bridge/filesystem/sftp/tests/Flow/Filesystem/Bridge/SFTP/Tests/Unit/OptionsTest.php b/src/bridge/filesystem/sftp/tests/Flow/Filesystem/Bridge/SFTP/Tests/Unit/OptionsTest.php index 8650c6933a..b3c341f79b 100644 --- a/src/bridge/filesystem/sftp/tests/Flow/Filesystem/Bridge/SFTP/Tests/Unit/OptionsTest.php +++ b/src/bridge/filesystem/sftp/tests/Flow/Filesystem/Bridge/SFTP/Tests/Unit/OptionsTest.php @@ -20,7 +20,7 @@ final class OptionsTest extends FlowTestCase public function test_block_size_below_one_is_rejected(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Block size must be greater than 0, given: 0'); + $this->expectExceptionMessageIsOrContains('Block size must be greater than 0, given: 0'); sftp_filesystem_options()->withBlockSize(0); } @@ -28,7 +28,7 @@ public function test_block_size_below_one_is_rejected(): void public function test_read_chunk_size_below_one_is_rejected(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Read chunk size must be greater than 0, given: -1'); + $this->expectExceptionMessageIsOrContains('Read chunk size must be greater than 0, given: -1'); sftp_filesystem_options()->withReadChunkSize(-1); } diff --git a/src/bridge/filesystem/sftp/tests/Flow/Filesystem/Bridge/SFTP/Tests/Unit/SFTPBlockLifecycleTest.php b/src/bridge/filesystem/sftp/tests/Flow/Filesystem/Bridge/SFTP/Tests/Unit/SFTPBlockLifecycleTest.php index b2c1f0bbf0..4886b60f89 100644 --- a/src/bridge/filesystem/sftp/tests/Flow/Filesystem/Bridge/SFTP/Tests/Unit/SFTPBlockLifecycleTest.php +++ b/src/bridge/filesystem/sftp/tests/Flow/Filesystem/Bridge/SFTP/Tests/Unit/SFTPBlockLifecycleTest.php @@ -23,7 +23,9 @@ public function test_uploading_a_block_over_an_unusable_session_is_reported_as_a $block->append('some data'); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('SFTP session is no longer usable, cannot upload a block of /upload/orders.csv'); + $this->expectExceptionMessageIsOrContains( + 'SFTP session is no longer usable, cannot upload a block of /upload/orders.csv', + ); new SFTPBlockLifecycle(new SFTP('localhost'), path('sftp:///upload/orders.csv'), new WriteOffset())->filled( $block, diff --git a/src/bridge/filesystem/sftp/tests/Flow/Filesystem/Bridge/SFTP/Tests/Unit/SFTPFilesystemTest.php b/src/bridge/filesystem/sftp/tests/Flow/Filesystem/Bridge/SFTP/Tests/Unit/SFTPFilesystemTest.php index 9ccd1d0e6d..19f3a885b8 100644 --- a/src/bridge/filesystem/sftp/tests/Flow/Filesystem/Bridge/SFTP/Tests/Unit/SFTPFilesystemTest.php +++ b/src/bridge/filesystem/sftp/tests/Flow/Filesystem/Bridge/SFTP/Tests/Unit/SFTPFilesystemTest.php @@ -20,7 +20,7 @@ final class SFTPFilesystemTest extends FlowTestCase public function test_append_to_rejects_mismatched_scheme(): void { $this->expectException(InvalidSchemeException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Scheme "aws-s3://" is not supported by this protocol. Expected scheme is "sftp://"', ); @@ -32,7 +32,7 @@ public function test_appending_to_the_tmp_dir_is_rejected(): void $filesystem = sftp_filesystem(new SFTP('localhost')); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Cannot write to system tmp directory'); + $this->expectExceptionMessageIsOrContains('Cannot write to system tmp directory'); $filesystem->appendTo($filesystem->getSystemTmpDir()); } @@ -118,7 +118,7 @@ public function test_writing_to_the_tmp_dir_is_rejected(): void $filesystem = sftp_filesystem(new SFTP('localhost')); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Cannot write to system tmp directory'); + $this->expectExceptionMessageIsOrContains('Cannot write to system tmp directory'); $filesystem->writeTo($filesystem->getSystemTmpDir()); } diff --git a/src/bridge/filesystem/sftp/tests/Flow/Filesystem/Bridge/SFTP/Tests/Unit/SFTPPrivateKeyTest.php b/src/bridge/filesystem/sftp/tests/Flow/Filesystem/Bridge/SFTP/Tests/Unit/SFTPPrivateKeyTest.php index 51916f2e66..acf46a3f6f 100644 --- a/src/bridge/filesystem/sftp/tests/Flow/Filesystem/Bridge/SFTP/Tests/Unit/SFTPPrivateKeyTest.php +++ b/src/bridge/filesystem/sftp/tests/Flow/Filesystem/Bridge/SFTP/Tests/Unit/SFTPPrivateKeyTest.php @@ -21,7 +21,7 @@ public function test_normalize_carries_the_pem_and_the_passphrase(): void public function test_a_pem_holding_a_public_key_is_refused_at_login(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('SFTP private key PEM does not hold a private key'); + $this->expectExceptionMessageIsOrContains('SFTP private key PEM does not hold a private key'); new SFTPPrivateKey(RSA::createKey(1024)->getPublicKey()->toString('PKCS8'))->login( new SFTP('localhost'), diff --git a/src/bridge/filesystem/sftp/tests/Flow/Filesystem/Bridge/SFTP/Tests/Unit/WriteOffsetTest.php b/src/bridge/filesystem/sftp/tests/Flow/Filesystem/Bridge/SFTP/Tests/Unit/WriteOffsetTest.php index 6dbbe14821..97dc3decaa 100644 --- a/src/bridge/filesystem/sftp/tests/Flow/Filesystem/Bridge/SFTP/Tests/Unit/WriteOffsetTest.php +++ b/src/bridge/filesystem/sftp/tests/Flow/Filesystem/Bridge/SFTP/Tests/Unit/WriteOffsetTest.php @@ -23,7 +23,7 @@ public function test_advancing_accumulates_written_bytes(): void public function test_advancing_by_a_negative_value_is_rejected(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Cannot advance write offset by a negative value, got: -1'); + $this->expectExceptionMessageIsOrContains('Cannot advance write offset by a negative value, got: -1'); new WriteOffset()->advance(-1); } @@ -31,7 +31,7 @@ public function test_advancing_by_a_negative_value_is_rejected(): void public function test_negative_starting_offset_is_rejected(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Write offset cannot be negative, got: -5'); + $this->expectExceptionMessageIsOrContains('Write offset cannot be negative, got: -5'); new WriteOffset(-5); } diff --git a/src/bridge/monolog/http/tests/Flow/Bridge/Monolog/Http/Tests/Unit/Config/RequestConfigTest.php b/src/bridge/monolog/http/tests/Flow/Bridge/Monolog/Http/Tests/Unit/Config/RequestConfigTest.php index 805d3fb592..e9e8718b98 100644 --- a/src/bridge/monolog/http/tests/Flow/Bridge/Monolog/Http/Tests/Unit/Config/RequestConfigTest.php +++ b/src/bridge/monolog/http/tests/Flow/Bridge/Monolog/Http/Tests/Unit/Config/RequestConfigTest.php @@ -35,7 +35,7 @@ public function test_constructor_accepts_valid_sanitizer_array(): void public function test_constructor_throws_exception_when_mask_sanitizer_has_invalid_character(): void { $this->expectException(InvalidTypeException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Expected type "structure{type: \'mask\', character?: string, offset?: integer}", got "structure{type: string, character: integer}"', ); @@ -47,7 +47,7 @@ public function test_constructor_throws_exception_when_mask_sanitizer_has_invali public function test_constructor_throws_exception_when_mask_sanitizer_has_invalid_offset(): void { $this->expectException(InvalidTypeException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Expected type "structure{type: \'mask\', character?: string, offset?: integer}", got "structure{type: string, character: string, offset: string}"', ); @@ -59,7 +59,7 @@ public function test_constructor_throws_exception_when_mask_sanitizer_has_invali public function test_constructor_throws_exception_when_sanitizer_array_has_invalid_type(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Sanitizer for key "invalid" could not be created from array: Unsupported sanitizer type: invalid', ); @@ -71,7 +71,7 @@ public function test_constructor_throws_exception_when_sanitizer_array_has_inval public function test_constructor_throws_exception_when_sanitizer_array_is_invalid(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Sanitizer for key "invalid" could not be created from array: Sanitizer type is required', ); diff --git a/src/bridge/monolog/http/tests/Flow/Bridge/Monolog/Http/Tests/Unit/Config/ResponseConfigTest.php b/src/bridge/monolog/http/tests/Flow/Bridge/Monolog/Http/Tests/Unit/Config/ResponseConfigTest.php index 44ed756662..a0d1ce98c8 100644 --- a/src/bridge/monolog/http/tests/Flow/Bridge/Monolog/Http/Tests/Unit/Config/ResponseConfigTest.php +++ b/src/bridge/monolog/http/tests/Flow/Bridge/Monolog/Http/Tests/Unit/Config/ResponseConfigTest.php @@ -35,7 +35,7 @@ public function test_constructor_accepts_valid_sanitizer_array(): void public function test_constructor_throws_exception_when_mask_sanitizer_has_invalid_character(): void { $this->expectException(InvalidTypeException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Expected type "structure{type: \'mask\', character?: string, offset?: integer}", got "structure{type: string, character: integer}"', ); @@ -47,7 +47,7 @@ public function test_constructor_throws_exception_when_mask_sanitizer_has_invali public function test_constructor_throws_exception_when_mask_sanitizer_has_invalid_offset(): void { $this->expectException(InvalidTypeException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Expected type "structure{type: \'mask\', character?: string, offset?: integer}", got "structure{type: string, character: string, offset: string}"', ); @@ -59,7 +59,7 @@ public function test_constructor_throws_exception_when_mask_sanitizer_has_invali public function test_constructor_throws_exception_when_sanitizer_array_has_invalid_type(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Sanitizer for key "invalid" could not be created from array: Unsupported sanitizer type: invalid', ); @@ -71,7 +71,7 @@ public function test_constructor_throws_exception_when_sanitizer_array_has_inval public function test_constructor_throws_exception_when_sanitizer_array_is_invalid(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Sanitizer for key "invalid" could not be created from array: Sanitizer type is required', ); diff --git a/src/bridge/monolog/http/tests/Flow/Bridge/Monolog/Http/Tests/Unit/Sanitization/MaskTest.php b/src/bridge/monolog/http/tests/Flow/Bridge/Monolog/Http/Tests/Unit/Sanitization/MaskTest.php index cc95f47604..c5c92aa93c 100644 --- a/src/bridge/monolog/http/tests/Flow/Bridge/Monolog/Http/Tests/Unit/Sanitization/MaskTest.php +++ b/src/bridge/monolog/http/tests/Flow/Bridge/Monolog/Http/Tests/Unit/Sanitization/MaskTest.php @@ -13,7 +13,7 @@ final class MaskTest extends FlowTestCase public function test_from_array_throws_exception_when_character_is_not_a_string(): void { $this->expectException(InvalidTypeException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Expected type "structure{type: \'mask\', character?: string, offset?: integer}", got "structure{type: string, character: integer}"', ); @@ -26,7 +26,7 @@ public function test_from_array_throws_exception_when_character_is_not_a_string( public function test_from_array_throws_exception_when_offset_is_not_an_integer(): void { $this->expectException(InvalidTypeException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Expected type "structure{type: \'mask\', character?: string, offset?: integer}", got "structure{type: string, character: string, offset: string}"', ); diff --git a/src/bridge/monolog/http/tests/Flow/Bridge/Monolog/Http/Tests/Unit/Sanitization/SanitizerFactoryTest.php b/src/bridge/monolog/http/tests/Flow/Bridge/Monolog/Http/Tests/Unit/Sanitization/SanitizerFactoryTest.php index 639af9b493..cea875bcab 100644 --- a/src/bridge/monolog/http/tests/Flow/Bridge/Monolog/Http/Tests/Unit/Sanitization/SanitizerFactoryTest.php +++ b/src/bridge/monolog/http/tests/Flow/Bridge/Monolog/Http/Tests/Unit/Sanitization/SanitizerFactoryTest.php @@ -47,7 +47,7 @@ public function test_roundtrip_conversion(): void public function test_throws_exception_when_character_is_not_a_string(): void { $this->expectException(InvalidTypeException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Expected type "structure{type: \'mask\', character?: string, offset?: integer}", got "structure{type: string, character: integer}"', ); @@ -60,7 +60,7 @@ public function test_throws_exception_when_character_is_not_a_string(): void public function test_throws_exception_when_offset_is_not_an_integer(): void { $this->expectException(InvalidTypeException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Expected type "structure{type: \'mask\', character?: string, offset?: integer}", got "structure{type: string, character: string, offset: string}"', ); @@ -74,7 +74,7 @@ public function test_throws_exception_when_offset_is_not_an_integer(): void public function test_throws_exception_when_type_is_missing(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Sanitizer type is required'); + $this->expectExceptionMessageIsOrContains('Sanitizer type is required'); SanitizerFactory::fromArray([]); } @@ -82,7 +82,7 @@ public function test_throws_exception_when_type_is_missing(): void public function test_throws_exception_when_type_is_unsupported(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Unsupported sanitizer type: unknown'); + $this->expectExceptionMessageIsOrContains('Unsupported sanitizer type: unknown'); SanitizerFactory::fromArray([ 'type' => 'unknown', diff --git a/src/bridge/monolog/telemetry/tests/Flow/Bridge/Monolog/Telemetry/Tests/Unit/SeverityMapperTest.php b/src/bridge/monolog/telemetry/tests/Flow/Bridge/Monolog/Telemetry/Tests/Unit/SeverityMapperTest.php index 27eb5bcfa6..03fc2ff52e 100644 --- a/src/bridge/monolog/telemetry/tests/Flow/Bridge/Monolog/Telemetry/Tests/Unit/SeverityMapperTest.php +++ b/src/bridge/monolog/telemetry/tests/Flow/Bridge/Monolog/Telemetry/Tests/Unit/SeverityMapperTest.php @@ -81,7 +81,7 @@ public function test_partial_custom_mapping_throws_on_missing_level(): void $mapper = new SeverityMapper($customMapping); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('No mapping defined for Monolog level: Info'); + $this->expectExceptionMessageIsOrContains('No mapping defined for Monolog level: Info'); $mapper->map(Level::Info); } diff --git a/src/bridge/openapi/specification/tests/Flow/Bridge/OpenAPI/Specification/Tests/Unit/FlowToOpenAPIConverterTest.php b/src/bridge/openapi/specification/tests/Flow/Bridge/OpenAPI/Specification/Tests/Unit/FlowToOpenAPIConverterTest.php index 0ad4c7508f..36589c97ac 100644 --- a/src/bridge/openapi/specification/tests/Flow/Bridge/OpenAPI/Specification/Tests/Unit/FlowToOpenAPIConverterTest.php +++ b/src/bridge/openapi/specification/tests/Flow/Bridge/OpenAPI/Specification/Tests/Unit/FlowToOpenAPIConverterTest.php @@ -701,7 +701,7 @@ public function test_to_open_api_with_unsupported_type(): void $converter = new OpenAPIConverter(); $schema = schema(map_schema('callback', type_map(type_string(), type_callable()), false)); - $this->expectExceptionMessage('Unsupported type: Flow\Types\Type\Native\CallableType'); + $this->expectExceptionMessageIsOrContains('Unsupported type: Flow\Types\Type\Native\CallableType'); $converter->toOpenAPI($schema); } diff --git a/src/bridge/openapi/specification/tests/Flow/Bridge/OpenAPI/Specification/Tests/Unit/OpenAPIConverterTest.php b/src/bridge/openapi/specification/tests/Flow/Bridge/OpenAPI/Specification/Tests/Unit/OpenAPIConverterTest.php index 135f9c70d9..5088c7c7d5 100644 --- a/src/bridge/openapi/specification/tests/Flow/Bridge/OpenAPI/Specification/Tests/Unit/OpenAPIConverterTest.php +++ b/src/bridge/openapi/specification/tests/Flow/Bridge/OpenAPI/Specification/Tests/Unit/OpenAPIConverterTest.php @@ -85,7 +85,7 @@ public function test_converter_error_handling(): void $converter = new OpenAPIConverter(); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('OpenAPI specification must have type "object"'); + $this->expectExceptionMessageIsOrContains('OpenAPI specification must have type "object"'); $converter->fromOpenAPI(['type' => 'array']); } diff --git a/src/bridge/openapi/specification/tests/Flow/Bridge/OpenAPI/Specification/Tests/Unit/OpenAPIToFlowConverterTest.php b/src/bridge/openapi/specification/tests/Flow/Bridge/OpenAPI/Specification/Tests/Unit/OpenAPIToFlowConverterTest.php index 13d7ded395..9c486e8989 100644 --- a/src/bridge/openapi/specification/tests/Flow/Bridge/OpenAPI/Specification/Tests/Unit/OpenAPIToFlowConverterTest.php +++ b/src/bridge/openapi/specification/tests/Flow/Bridge/OpenAPI/Specification/Tests/Unit/OpenAPIToFlowConverterTest.php @@ -81,7 +81,7 @@ public function test_from_openapi_throws_exception_for_invalid_property_spec(): ]; $this->expectException(InvalidTypeException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Expected type "map>", got "structure{invalid_prop: string}".', ); @@ -97,7 +97,7 @@ public function test_from_openapi_throws_exception_for_invalid_type(): void ]; $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('OpenAPI specification must have type "object"'); + $this->expectExceptionMessageIsOrContains('OpenAPI specification must have type "object"'); $converter->fromOpenAPI($openApiSpec); } @@ -110,7 +110,7 @@ public function test_from_openapi_throws_exception_for_missing_properties(): voi ]; $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('OpenAPI specification must have properties array'); + $this->expectExceptionMessageIsOrContains('OpenAPI specification must have properties array'); $converter->fromOpenAPI($openApiSpec); } @@ -126,7 +126,7 @@ public function test_from_openapi_throws_exception_for_missing_property_type(): ]; $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage("Property 'no_type' must have a type"); + $this->expectExceptionMessageIsOrContains("Property 'no_type' must have a type"); $converter->fromOpenAPI($openApiSpec); } @@ -142,7 +142,7 @@ public function test_from_openapi_throws_exception_for_unsupported_type(): void ]; $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Unsupported OpenAPI type: binary'); + $this->expectExceptionMessageIsOrContains('Unsupported OpenAPI type: binary'); $converter->fromOpenAPI($openApiSpec); } diff --git a/src/bridge/phpunit/telemetry/tests/Flow/Bridge/PHPUnit/Telemetry/Tests/Unit/ConfigurationTest.php b/src/bridge/phpunit/telemetry/tests/Flow/Bridge/PHPUnit/Telemetry/Tests/Unit/ConfigurationTest.php index a0012275e4..68bb983aee 100644 --- a/src/bridge/phpunit/telemetry/tests/Flow/Bridge/PHPUnit/Telemetry/Tests/Unit/ConfigurationTest.php +++ b/src/bridge/phpunit/telemetry/tests/Flow/Bridge/PHPUnit/Telemetry/Tests/Unit/ConfigurationTest.php @@ -72,7 +72,7 @@ public function test_curl_headers_duplicate_name_last_wins(): void public function test_curl_headers_empty_name_throws(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Header name cannot be empty'); + $this->expectExceptionMessageMatches('/Header name cannot be empty/'); Configuration::fromParameters(ParameterCollection::fromArray([ 'headers' => '=value', @@ -92,7 +92,7 @@ public function test_curl_headers_empty_string_is_empty_array(): void public function test_curl_headers_missing_equals_throws(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Invalid header entry "Authorization", expected format "name=value"'); + $this->expectExceptionMessageMatches('/Invalid header entry "Authorization", expected format "name=value"/'); Configuration::fromParameters(ParameterCollection::fromArray([ 'headers' => 'Authorization', @@ -153,7 +153,7 @@ public function test_curl_serializer_defaults_to_json(): void public function test_curl_serializer_invalid_value_throws(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Invalid serializer "xml" for parameter "curl_serializer"'); + $this->expectExceptionMessageMatches('/Invalid serializer "xml" for parameter "curl_serializer"/'); Configuration::fromParameters(ParameterCollection::fromArray([ 'curl_serializer' => 'xml', @@ -214,7 +214,9 @@ public function test_curl_timeout_parsed(): void public function test_curl_transport_rejects_stream_params(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Parameter "stream_file_permissions" cannot be used with transport "curl"'); + $this->expectExceptionMessageMatches( + '/Parameter "stream_file_permissions" cannot be used with transport "curl"/', + ); Configuration::fromParameters(ParameterCollection::fromArray([ 'transport' => 'curl', @@ -225,7 +227,7 @@ public function test_curl_transport_rejects_stream_params(): void public function test_curl_with_grpc_specific_param_throws(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Parameter "grpc_insecure" cannot be used with transport "curl"'); + $this->expectExceptionMessageMatches('/Parameter "grpc_insecure" cannot be used with transport "curl"/'); Configuration::fromParameters(ParameterCollection::fromArray([ 'transport' => 'curl', @@ -236,7 +238,7 @@ public function test_curl_with_grpc_specific_param_throws(): void public function test_curl_with_grpc_timeout_throws(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Parameter "grpc_timeout_ms" cannot be used with transport "curl"'); + $this->expectExceptionMessageMatches('/Parameter "grpc_timeout_ms" cannot be used with transport "curl"/'); Configuration::fromParameters(ParameterCollection::fromArray([ 'grpc_timeout_ms' => '500', @@ -394,7 +396,7 @@ public function test_env_var_headers_invalid_format_throws(): void try { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Invalid header entry "broken"'); + $this->expectExceptionMessageMatches('/Invalid header entry "broken"/'); Configuration::fromParameters(ParameterCollection::fromArray([])); } finally { @@ -503,7 +505,7 @@ public function test_error_handler_can_be_set_to_noop(): void public function test_error_log_handler_invalid_message_type_throws(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Invalid error_handler_message_type "smoke"'); + $this->expectExceptionMessageMatches('/Invalid error_handler_message_type "smoke"/'); Configuration::fromParameters(ParameterCollection::fromArray([ 'error_handler_message_type' => 'smoke', @@ -595,7 +597,7 @@ public function test_grpc_transport_selected(): void public function test_grpc_with_curl_specific_param_throws(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Parameter "curl_compression" cannot be used with transport "grpc"'); + $this->expectExceptionMessageMatches('/Parameter "curl_compression" cannot be used with transport "grpc"/'); Configuration::fromParameters(ParameterCollection::fromArray([ 'transport' => 'grpc', @@ -607,7 +609,7 @@ public function test_grpc_with_curl_specific_param_throws(): void public function test_grpc_with_curl_timeout_throws(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Parameter "curl_timeout_ms" cannot be used with transport "grpc"'); + $this->expectExceptionMessageMatches('/Parameter "curl_timeout_ms" cannot be used with transport "grpc"/'); Configuration::fromParameters(ParameterCollection::fromArray([ 'transport' => 'grpc', @@ -619,7 +621,7 @@ public function test_grpc_with_curl_timeout_throws(): void public function test_invalid_boolean_value_throws(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Invalid boolean value "yes" for parameter "emit_traces"'); + $this->expectExceptionMessageMatches('/Invalid boolean value "yes" for parameter "emit_traces"/'); Configuration::fromParameters(ParameterCollection::fromArray([ 'emit_traces' => 'yes', @@ -629,8 +631,8 @@ public function test_invalid_boolean_value_throws(): void public function test_invalid_error_handler_throws(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( - 'Invalid error_handler "smoke", expected one of: error_log, noop, stream, syslog, udp_syslog', + $this->expectExceptionMessageMatches( + '/Invalid error_handler "smoke", expected one of: error_log, noop, stream, syslog, udp_syslog/', ); Configuration::fromParameters(ParameterCollection::fromArray([ @@ -641,7 +643,7 @@ public function test_invalid_error_handler_throws(): void public function test_invalid_integer_value_throws(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Invalid integer value "abc" for parameter "curl_timeout_ms"'); + $this->expectExceptionMessageMatches('/Invalid integer value "abc" for parameter "curl_timeout_ms"/'); Configuration::fromParameters(ParameterCollection::fromArray([ 'curl_timeout_ms' => 'abc', @@ -651,7 +653,7 @@ public function test_invalid_integer_value_throws(): void public function test_invalid_transport_value_throws(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Invalid transport "rest", expected "curl", "grpc" or "stream"'); + $this->expectExceptionMessageMatches('/Invalid transport "rest", expected "curl", "grpc" or "stream"/'); Configuration::fromParameters(ParameterCollection::fromArray([ 'transport' => 'rest', @@ -661,8 +663,8 @@ public function test_invalid_transport_value_throws(): void public function test_legacy_otel_collector_url_combined_with_new_endpoint_throws(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( - 'Deprecated parameter "otel_collector_url" cannot be mixed with new parameter "endpoint"', + $this->expectExceptionMessageMatches( + '/Deprecated parameter "otel_collector_url" cannot be mixed with new parameter "endpoint"/', ); DeprecationCapture::silence(static fn() => Configuration::fromParameters(ParameterCollection::fromArray([ @@ -674,8 +676,8 @@ public function test_legacy_otel_collector_url_combined_with_new_endpoint_throws public function test_legacy_otel_collector_url_combined_with_transport_throws(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( - 'Deprecated parameter "otel_collector_url" cannot be mixed with new parameter "transport"', + $this->expectExceptionMessageMatches( + '/Deprecated parameter "otel_collector_url" cannot be mixed with new parameter "transport"/', ); DeprecationCapture::silence(static fn() => Configuration::fromParameters(ParameterCollection::fromArray([ @@ -701,8 +703,8 @@ public function test_legacy_otel_collector_url_maps_to_curl_endpoint(): void public function test_noop_error_handler_rejects_specific_params(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( - 'Parameter "error_handler_message_prefix" cannot be used with error_handler "noop".', + $this->expectExceptionMessageMatches( + '/Parameter "error_handler_message_prefix" cannot be used with error_handler "noop"\./', ); Configuration::fromParameters(ParameterCollection::fromArray([ @@ -723,7 +725,7 @@ public function test_resource_attributes_duplicate_name_last_wins(): void public function test_resource_attributes_empty_name_throws(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Resource attribute name cannot be empty'); + $this->expectExceptionMessageMatches('/Resource attribute name cannot be empty/'); Configuration::fromParameters(ParameterCollection::fromArray([ 'resource_attributes' => '=value', @@ -757,7 +759,7 @@ public function test_resource_attributes_env_var_wins_over_parameter(): void public function test_resource_attributes_missing_equals_throws(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Invalid resource attribute entry "team", expected format "name=value"'); + $this->expectExceptionMessageMatches('/Invalid resource attribute entry "team", expected format "name=value"/'); Configuration::fromParameters(ParameterCollection::fromArray([ 'resource_attributes' => 'team', @@ -844,7 +846,9 @@ public function test_stream_error_handler_parsed(): void public function test_stream_error_handler_rejects_syslog_params(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Parameter "error_handler_facility" cannot be used with error_handler "stream".'); + $this->expectExceptionMessageMatches( + '/Parameter "error_handler_facility" cannot be used with error_handler "stream"\./', + ); Configuration::fromParameters(ParameterCollection::fromArray([ 'error_handler' => 'stream', @@ -856,7 +860,9 @@ public function test_stream_error_handler_rejects_syslog_params(): void public function test_stream_error_handler_requires_destination(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Parameter "error_handler_destination" is required for error_handler "stream"'); + $this->expectExceptionMessageMatches( + '/Parameter "error_handler_destination" is required for error_handler "stream"/', + ); Configuration::fromParameters(ParameterCollection::fromArray([ 'error_handler' => 'stream', @@ -894,7 +900,7 @@ public function test_stream_transport_parsed(): void public function test_stream_transport_rejects_curl_params(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Parameter "curl_compression" cannot be used with transport "stream"'); + $this->expectExceptionMessageMatches('/Parameter "curl_compression" cannot be used with transport "stream"/'); Configuration::fromParameters(ParameterCollection::fromArray([ 'transport' => 'stream', @@ -906,7 +912,9 @@ public function test_stream_transport_rejects_curl_params(): void public function test_stream_transport_rejects_shutdown_timeout_ms(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Parameter "shutdown_timeout_ms" cannot be used with transport "stream"'); + $this->expectExceptionMessageMatches( + '/Parameter "shutdown_timeout_ms" cannot be used with transport "stream"/', + ); Configuration::fromParameters(ParameterCollection::fromArray([ 'transport' => 'stream', @@ -918,7 +926,7 @@ public function test_stream_transport_rejects_shutdown_timeout_ms(): void public function test_stream_transport_requires_endpoint(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Parameter "endpoint" is required for transport "stream"'); + $this->expectExceptionMessageMatches('/Parameter "endpoint" is required for transport "stream"/'); Configuration::fromParameters(ParameterCollection::fromArray([ 'transport' => 'stream', @@ -928,7 +936,7 @@ public function test_stream_transport_requires_endpoint(): void public function test_syslog_error_handler_invalid_facility_throws(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Invalid error_handler_facility "invalid"'); + $this->expectExceptionMessageMatches('/Invalid error_handler_facility "invalid"/'); Configuration::fromParameters(ParameterCollection::fromArray([ 'error_handler' => 'syslog', @@ -985,7 +993,9 @@ public function test_udp_syslog_error_handler_parsed(): void public function test_udp_syslog_error_handler_requires_host(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Parameter "error_handler_host" is required for error_handler "udp_syslog"'); + $this->expectExceptionMessageMatches( + '/Parameter "error_handler_host" is required for error_handler "udp_syslog"/', + ); Configuration::fromParameters(ParameterCollection::fromArray([ 'error_handler' => 'udp_syslog', diff --git a/src/bridge/psr18/telemetry/tests/Flow/Bridge/Psr18/Telemetry/Tests/Unit/PSR18TraceableClientTest.php b/src/bridge/psr18/telemetry/tests/Flow/Bridge/Psr18/Telemetry/Tests/Unit/PSR18TraceableClientTest.php index 54c818aac5..c53702bc12 100644 --- a/src/bridge/psr18/telemetry/tests/Flow/Bridge/Psr18/Telemetry/Tests/Unit/PSR18TraceableClientTest.php +++ b/src/bridge/psr18/telemetry/tests/Flow/Bridge/Psr18/Telemetry/Tests/Unit/PSR18TraceableClientTest.php @@ -119,7 +119,7 @@ public function test_exception_is_recorded_and_rethrown(): void $request = new Request('GET', 'https://api.example.com/users'); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Connection failed'); + $this->expectExceptionMessageIsOrContains('Connection failed'); try { $traceableClient->sendRequest($request); diff --git a/src/bridge/psr3/telemetry/tests/Flow/Bridge/Psr3/Telemetry/Tests/Unit/SeverityMapperTest.php b/src/bridge/psr3/telemetry/tests/Flow/Bridge/Psr3/Telemetry/Tests/Unit/SeverityMapperTest.php index 30c9f705ac..c95bf04370 100644 --- a/src/bridge/psr3/telemetry/tests/Flow/Bridge/Psr3/Telemetry/Tests/Unit/SeverityMapperTest.php +++ b/src/bridge/psr3/telemetry/tests/Flow/Bridge/Psr3/Telemetry/Tests/Unit/SeverityMapperTest.php @@ -92,7 +92,7 @@ public function test_throws_on_unknown_level(): void $mapper = new SeverityMapper(); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Unknown PSR-3 log level: verbose'); + $this->expectExceptionMessageIsOrContains('Unknown PSR-3 log level: verbose'); $mapper->map('verbose'); } diff --git a/src/bridge/psr7/telemetry/tests/Flow/Bridge/Psr7/Telemetry/Tests/Unit/RequestCarrierTest.php b/src/bridge/psr7/telemetry/tests/Flow/Bridge/Psr7/Telemetry/Tests/Unit/RequestCarrierTest.php index fd92bc7d8f..f64868af41 100644 --- a/src/bridge/psr7/telemetry/tests/Flow/Bridge/Psr7/Telemetry/Tests/Unit/RequestCarrierTest.php +++ b/src/bridge/psr7/telemetry/tests/Flow/Bridge/Psr7/Telemetry/Tests/Unit/RequestCarrierTest.php @@ -73,7 +73,7 @@ public function test_set_throws_runtime_exception(): void $carrier = new RequestCarrier($request); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('RequestCarrier is read-only'); + $this->expectExceptionMessageIsOrContains('RequestCarrier is read-only'); $carrier->set('key', 'value'); } diff --git a/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Integration/MountDecorationTest.php b/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Integration/MountDecorationTest.php index 1cfe884879..eed7817d32 100644 --- a/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Integration/MountDecorationTest.php +++ b/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Integration/MountDecorationTest.php @@ -137,7 +137,7 @@ public function test_table_mount_is_traceable_around_intercepted_around_inner(): public function test_unknown_mount_fails_container_compile(): void { $this->expectException(ServiceNotFoundException::class); - $this->expectExceptionMessage('flow.filesystem.mount.default.typo'); + $this->expectExceptionMessageIsOrContains('flow.filesystem.mount.default.typo'); $this->symfonyContext()->bootTracedMemoryFstab(static function (ContainerBuilder $container): void { $container diff --git a/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/Command/FstabResolverTest.php b/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/Command/FstabResolverTest.php index c95ef276d9..624f74b9ca 100644 --- a/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/Command/FstabResolverTest.php +++ b/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/Command/FstabResolverTest.php @@ -76,7 +76,7 @@ public function test_resolve_returns_requested_fstab(): void public function test_resolve_throws_on_unknown_fstab(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Unknown fstab "nope"'); + $this->expectExceptionMessageIsOrContains('Unknown fstab "nope"'); $this->context->resolver()->resolve('nope'); } diff --git a/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/DependencyInjection/Compiler/BuildFstabsPassTelemetryTest.php b/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/DependencyInjection/Compiler/BuildFstabsPassTelemetryTest.php index cca8750f09..7743514ac9 100644 --- a/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/DependencyInjection/Compiler/BuildFstabsPassTelemetryTest.php +++ b/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/DependencyInjection/Compiler/BuildFstabsPassTelemetryTest.php @@ -99,7 +99,7 @@ public function test_throws_when_telemetry_enabled_without_clock_service_id(): v ]); $this->expectException(LogicException::class); - $this->expectExceptionMessage('clock_service_id'); + $this->expectExceptionMessageIsOrContains('clock_service_id'); new BuildFstabsPass()->process($container); } @@ -122,7 +122,7 @@ public function test_throws_when_telemetry_enabled_without_telemetry_service_id( ]); $this->expectException(LogicException::class); - $this->expectExceptionMessage('telemetry_service_id'); + $this->expectExceptionMessageIsOrContains('telemetry_service_id'); new BuildFstabsPass()->process($container); } diff --git a/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/DependencyInjection/Compiler/BuildFstabsPassTest.php b/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/DependencyInjection/Compiler/BuildFstabsPassTest.php index 84fd68f289..25d17ff0ae 100644 --- a/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/DependencyInjection/Compiler/BuildFstabsPassTest.php +++ b/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/DependencyInjection/Compiler/BuildFstabsPassTest.php @@ -210,7 +210,7 @@ public function test_throws_on_unknown_default_fstab(): void ]); $this->expectException(LogicException::class); - $this->expectExceptionMessage('flow_filesystem: default_fstab "nope"'); + $this->expectExceptionMessageIsOrContains('flow_filesystem: default_fstab "nope"'); new BuildFstabsPass()->process($container); } @@ -229,7 +229,7 @@ public function test_throws_on_unknown_type_at_compile_time(): void ]); $this->expectException(LogicException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Fstab "default" mount "ftp": no filesystem factory registered for type "aws_s3"', ); diff --git a/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/DependencyInjection/Compiler/RegisterFilesystemFactoriesPassTest.php b/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/DependencyInjection/Compiler/RegisterFilesystemFactoriesPassTest.php index 23356a2411..42474b9e9e 100644 --- a/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/DependencyInjection/Compiler/RegisterFilesystemFactoriesPassTest.php +++ b/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/DependencyInjection/Compiler/RegisterFilesystemFactoriesPassTest.php @@ -84,7 +84,7 @@ public function test_throws_on_duplicate_type_across_services(): void $container->setDefinition('.flow.filesystem.factory.b', $b); $this->expectException(LogicException::class); - $this->expectExceptionMessage('Duplicate filesystem factory for type "memory"'); + $this->expectExceptionMessageIsOrContains('Duplicate filesystem factory for type "memory"'); new RegisterFilesystemFactoriesPass()->process($container); } @@ -101,7 +101,7 @@ public function test_throws_on_tag_without_type_attribute(): void $container->setDefinition('.flow.filesystem.factory.memory', $memory); $this->expectException(LogicException::class); - $this->expectExceptionMessage('missing a non-empty "type" attribute'); + $this->expectExceptionMessageIsOrContains('missing a non-empty "type" attribute'); new RegisterFilesystemFactoriesPass()->process($container); } diff --git a/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/DependencyInjection/Compiler/ResolveFilesystemArgumentsPassTest.php b/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/DependencyInjection/Compiler/ResolveFilesystemArgumentsPassTest.php index 7e89dde922..a7bee15661 100644 --- a/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/DependencyInjection/Compiler/ResolveFilesystemArgumentsPassTest.php +++ b/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/DependencyInjection/Compiler/ResolveFilesystemArgumentsPassTest.php @@ -89,7 +89,9 @@ public function test_throws_when_no_default_fstab_and_fstab_omitted(): void ]); $this->expectException(LogicException::class); - $this->expectExceptionMessage('Service "app.consumer" uses #[AsFilesystem(\'memory\')] without an fstab'); + $this->expectExceptionMessageIsOrContains( + 'Service "app.consumer" uses #[AsFilesystem(\'memory\')] without an fstab', + ); new ResolveFilesystemArgumentsPass()->process($container); } @@ -109,7 +111,9 @@ public function test_throws_on_unknown_fstab(): void ]); $this->expectException(LogicException::class); - $this->expectExceptionMessage('references fstab "nope" which is not configured. Available fstabs: [primary]'); + $this->expectExceptionMessageIsOrContains( + 'references fstab "nope" which is not configured. Available fstabs: [primary]', + ); new ResolveFilesystemArgumentsPass()->process($container); } @@ -129,7 +133,7 @@ public function test_throws_on_unknown_mount(): void ]); $this->expectException(LogicException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'references mount "warehouse" which is not mounted in fstab "primary". Available mounts: [memory]', ); diff --git a/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/Filesystem/Factory/AsyncAwsS3FilesystemFactoryTest.php b/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/Filesystem/Factory/AsyncAwsS3FilesystemFactoryTest.php index 1e155365fb..33f7a78ade 100644 --- a/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/Filesystem/Factory/AsyncAwsS3FilesystemFactoryTest.php +++ b/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/Filesystem/Factory/AsyncAwsS3FilesystemFactoryTest.php @@ -81,7 +81,7 @@ public function test_mount_protocol_is_propagated_to_filesystem(): void public function test_throws_on_invalid_block_size_type(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('`options.block_size` must be an integer'); + $this->expectExceptionMessageIsOrContains('`options.block_size` must be an integer'); new AsyncAwsS3FilesystemFactory()->create('aws-s3', [ 'bucket' => 'b', @@ -93,7 +93,7 @@ public function test_throws_on_invalid_block_size_type(): void public function test_throws_on_missing_bucket(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('non-empty `bucket`'); + $this->expectExceptionMessageIsOrContains('non-empty `bucket`'); new AsyncAwsS3FilesystemFactory()->create('aws-s3', ['client' => []]); } @@ -101,7 +101,7 @@ public function test_throws_on_missing_bucket(): void public function test_throws_on_unknown_client_keys(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('`client` contains unknown keys: [nope]'); + $this->expectExceptionMessageIsOrContains('`client` contains unknown keys: [nope]'); new AsyncAwsS3FilesystemFactory()->create('aws-s3', [ 'bucket' => 'b', @@ -112,7 +112,7 @@ public function test_throws_on_unknown_client_keys(): void public function test_throws_on_unknown_options_keys(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('`options` contains unknown keys: [nope]'); + $this->expectExceptionMessageIsOrContains('`options` contains unknown keys: [nope]'); new AsyncAwsS3FilesystemFactory()->create('aws-s3', [ 'bucket' => 'b', @@ -124,7 +124,7 @@ public function test_throws_on_unknown_options_keys(): void public function test_throws_on_unknown_top_level_keys(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('received unknown keys: [container]'); + $this->expectExceptionMessageIsOrContains('received unknown keys: [container]'); new AsyncAwsS3FilesystemFactory()->create('aws-s3', [ 'bucket' => 'b', @@ -136,7 +136,7 @@ public function test_throws_on_unknown_top_level_keys(): void public function test_throws_when_client_is_invalid_type(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('`client` must be an array or AsyncAws\\S3\\S3Client instance'); + $this->expectExceptionMessageIsOrContains('`client` must be an array or AsyncAws\\S3\\S3Client instance'); new AsyncAwsS3FilesystemFactory()->create('aws-s3', [ 'bucket' => 'b', @@ -147,7 +147,9 @@ public function test_throws_when_client_is_invalid_type(): void public function test_throws_when_http_client_is_wrong_type(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('`client.http_client_service_id` must reference a service implementing'); + $this->expectExceptionMessageIsOrContains( + '`client.http_client_service_id` must reference a service implementing', + ); new AsyncAwsS3FilesystemFactory()->create('aws-s3', [ 'bucket' => 'b', @@ -161,7 +163,7 @@ public function test_throws_when_http_client_is_wrong_type(): void public function test_throws_when_logger_is_wrong_type(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('`client.logger_service_id` must reference a service implementing'); + $this->expectExceptionMessageIsOrContains('`client.logger_service_id` must reference a service implementing'); new AsyncAwsS3FilesystemFactory()->create('aws-s3', [ 'bucket' => 'b', @@ -175,7 +177,7 @@ public function test_throws_when_logger_is_wrong_type(): void public function test_throws_when_no_client_supplied(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('exactly one of'); + $this->expectExceptionMessageIsOrContains('exactly one of'); new AsyncAwsS3FilesystemFactory()->create('aws-s3', ['bucket' => 'b']); } @@ -183,7 +185,7 @@ public function test_throws_when_no_client_supplied(): void public function test_throws_when_options_is_not_array(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('`options` must be an array'); + $this->expectExceptionMessageIsOrContains('`options` must be an array'); new AsyncAwsS3FilesystemFactory()->create('aws-s3', [ 'bucket' => 'b', @@ -264,7 +266,7 @@ public function test_client_http_keeps_the_filesystem_describable(): void public function test_client_http_with_an_injected_http_client_is_rejected(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Filesystem factory for backend "aws_s3": client.http cannot be used together with client.http_client_service_id or client.logger_service_id, because the limits apply only to the client the bundle builds.', ); @@ -277,7 +279,7 @@ public function test_client_http_with_an_injected_http_client_is_rejected(): voi public function test_client_http_with_an_injected_logger_is_rejected(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Filesystem factory for backend "aws_s3": client.http cannot be used together with client.http_client_service_id or client.logger_service_id, because the limits apply only to the client the bundle builds.', ); @@ -290,7 +292,9 @@ public function test_client_http_with_an_injected_logger_is_rejected(): void public function test_client_http_must_be_an_array(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Filesystem factory for backend "aws_s3" `client.http` must be an array.'); + $this->expectExceptionMessageIsOrContains( + 'Filesystem factory for backend "aws_s3" `client.http` must be an array.', + ); new AsyncAwsS3FilesystemFactory()->create('aws-s3', [ 'bucket' => 'b', @@ -315,7 +319,7 @@ public function test_options_bulk_delete(): void public function test_options_bulk_delete_must_be_a_boolean(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('`options.bulk_delete` must be a boolean.'); + $this->expectExceptionMessageIsOrContains('`options.bulk_delete` must be a boolean.'); new AsyncAwsS3FilesystemFactory()->create('aws-s3', [ 'bucket' => 'b', @@ -341,7 +345,9 @@ public function test_options_copy_part_size(): void public function test_options_copy_part_size_above_5_gb_is_rejected(): void { $this->expectException(FilesystemInvalidArgumentException::class); - $this->expectExceptionMessage('Copy part size must be between 5 MiB and 5 GB, got 5000000001 bytes'); + $this->expectExceptionMessageIsOrContains( + 'Copy part size must be between 5 MiB and 5 GB, got 5000000001 bytes', + ); new AsyncAwsS3FilesystemFactory()->create('aws-s3', [ 'bucket' => 'b', @@ -353,7 +359,7 @@ public function test_options_copy_part_size_above_5_gb_is_rejected(): void public function test_options_copy_part_size_must_be_an_integer(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('`options.copy_part_size` must be an integer.'); + $this->expectExceptionMessageIsOrContains('`options.copy_part_size` must be an integer.'); new AsyncAwsS3FilesystemFactory()->create('aws-s3', [ 'bucket' => 'b', diff --git a/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/Filesystem/Factory/AzureBlobFilesystemFactoryTest.php b/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/Filesystem/Factory/AzureBlobFilesystemFactoryTest.php index ed0b5aafa2..efb6e048f1 100644 --- a/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/Filesystem/Factory/AzureBlobFilesystemFactoryTest.php +++ b/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/Filesystem/Factory/AzureBlobFilesystemFactoryTest.php @@ -57,7 +57,7 @@ public function test_applies_bulk_delete_option(): void public function test_throws_on_invalid_bulk_delete_type(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('`options.bulk_delete` must be a boolean.'); + $this->expectExceptionMessageIsOrContains('`options.bulk_delete` must be a boolean.'); new AzureBlobFilesystemFactory()->create('azure-blob', [ 'container' => 'c', @@ -69,7 +69,7 @@ public function test_throws_on_invalid_bulk_delete_type(): void public function test_throws_on_invalid_copy_part_size_type(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('`options.copy_part_size` must be an integer.'); + $this->expectExceptionMessageIsOrContains('`options.copy_part_size` must be an integer.'); new AzureBlobFilesystemFactory()->create('azure-blob', [ 'container' => 'c', @@ -136,7 +136,7 @@ public function test_mode_b_uses_azurite_url_factory_when_host_set(): void public function test_throws_on_invalid_block_size_type(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('block_size'); + $this->expectExceptionMessageIsOrContains('block_size'); new AzureBlobFilesystemFactory()->create('azure-blob', [ 'container' => 'c', @@ -148,7 +148,7 @@ public function test_throws_on_invalid_block_size_type(): void public function test_throws_on_invalid_list_blob_max_results_type(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('list_blob_max_results'); + $this->expectExceptionMessageIsOrContains('list_blob_max_results'); new AzureBlobFilesystemFactory()->create('azure-blob', [ 'container' => 'c', @@ -160,7 +160,7 @@ public function test_throws_on_invalid_list_blob_max_results_type(): void public function test_throws_on_missing_container(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('non-empty `container`'); + $this->expectExceptionMessageIsOrContains('non-empty `container`'); new AzureBlobFilesystemFactory()->create('azure-blob', ['client' => []]); } @@ -168,7 +168,7 @@ public function test_throws_on_missing_container(): void public function test_throws_on_unknown_auth_keys(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('`client.auth` contains unknown keys: [sas_token]'); + $this->expectExceptionMessageIsOrContains('`client.auth` contains unknown keys: [sas_token]'); new AzureBlobFilesystemFactory()->create('azure-blob', [ 'container' => 'c', @@ -179,7 +179,7 @@ public function test_throws_on_unknown_auth_keys(): void public function test_throws_on_unknown_client_keys(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('`client` contains unknown keys: [nope]'); + $this->expectExceptionMessageIsOrContains('`client` contains unknown keys: [nope]'); new AzureBlobFilesystemFactory()->create('azure-blob', [ 'container' => 'c', @@ -190,7 +190,7 @@ public function test_throws_on_unknown_client_keys(): void public function test_throws_on_unknown_options_keys(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('`options` contains unknown keys: [nope]'); + $this->expectExceptionMessageIsOrContains('`options` contains unknown keys: [nope]'); new AzureBlobFilesystemFactory()->create('azure-blob', [ 'container' => 'c', @@ -202,7 +202,7 @@ public function test_throws_on_unknown_options_keys(): void public function test_throws_on_unknown_top_level_keys(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('received unknown keys: [bucket]'); + $this->expectExceptionMessageIsOrContains('received unknown keys: [bucket]'); new AzureBlobFilesystemFactory()->create('azure-blob', [ 'container' => 'c', @@ -214,7 +214,9 @@ public function test_throws_on_unknown_top_level_keys(): void public function test_throws_when_client_is_invalid_type(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('`client` must be an array or Flow\\Azure\\SDK\\BlobServiceInterface instance'); + $this->expectExceptionMessageIsOrContains( + '`client` must be an array or Flow\\Azure\\SDK\\BlobServiceInterface instance', + ); new AzureBlobFilesystemFactory()->create('azure-blob', [ 'container' => 'c', @@ -225,7 +227,7 @@ public function test_throws_when_client_is_invalid_type(): void public function test_throws_when_http_client_is_wrong_type(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('`client.http_client_service` must reference a service implementing'); + $this->expectExceptionMessageIsOrContains('`client.http_client_service` must reference a service implementing'); new AzureBlobFilesystemFactory()->create('azure-blob', [ 'container' => 'c', @@ -240,7 +242,7 @@ public function test_throws_when_http_client_is_wrong_type(): void public function test_throws_when_mode_b_missing_account_name(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('`client.account_name`'); + $this->expectExceptionMessageIsOrContains('`client.account_name`'); new AzureBlobFilesystemFactory()->create('azure-blob', [ 'container' => 'c', @@ -251,7 +253,7 @@ public function test_throws_when_mode_b_missing_account_name(): void public function test_throws_when_mode_b_missing_shared_key(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('`client.auth.shared_key`'); + $this->expectExceptionMessageIsOrContains('`client.auth.shared_key`'); new AzureBlobFilesystemFactory()->create('azure-blob', [ 'container' => 'c', @@ -262,7 +264,7 @@ public function test_throws_when_mode_b_missing_shared_key(): void public function test_throws_when_no_client_supplied(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('exactly one of'); + $this->expectExceptionMessageIsOrContains('exactly one of'); new AzureBlobFilesystemFactory()->create('azure-blob', ['container' => 'c']); } @@ -270,7 +272,7 @@ public function test_throws_when_no_client_supplied(): void public function test_throws_when_options_is_not_array(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('`options` must be an array'); + $this->expectExceptionMessageIsOrContains('`options` must be an array'); new AzureBlobFilesystemFactory()->create('azure-blob', [ 'container' => 'c', @@ -369,7 +371,9 @@ public function test_client_http_keeps_the_filesystem_describable(): void public function test_client_http_must_be_an_array(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Filesystem factory for backend "azure_blob" `client.http` must be an array.'); + $this->expectExceptionMessageIsOrContains( + 'Filesystem factory for backend "azure_blob" `client.http` must be an array.', + ); new AzureBlobFilesystemFactory()->create('azure-blob', [ 'container' => 'c', @@ -381,7 +385,7 @@ public function test_client_http_must_be_an_array(): void public function test_client_http_with_an_injected_service_is_rejected(string $service, object $instance): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Filesystem factory for backend "azure_blob": client.http cannot be used together with client.http_client_service, client.request_factory_service, client.stream_factory_service or client.logger_service_id, because the limits apply only to the client the bundle builds.', ); diff --git a/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/Filesystem/Factory/MemoryFilesystemFactoryTest.php b/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/Filesystem/Factory/MemoryFilesystemFactoryTest.php index 9fbde5ba6c..05ae1cbfc3 100644 --- a/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/Filesystem/Factory/MemoryFilesystemFactoryTest.php +++ b/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/Filesystem/Factory/MemoryFilesystemFactoryTest.php @@ -18,7 +18,7 @@ public function test_creates_filesystem_with_given_mount_protocol(): void public function test_throws_on_unknown_options(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Filesystem factory for type "memory" does not accept any options. Unknown keys: [foo, bar].', ); diff --git a/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/Filesystem/Factory/NativeLocalFilesystemFactoryTest.php b/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/Filesystem/Factory/NativeLocalFilesystemFactoryTest.php index fdf16ccb48..2def5f530d 100644 --- a/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/Filesystem/Factory/NativeLocalFilesystemFactoryTest.php +++ b/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/Filesystem/Factory/NativeLocalFilesystemFactoryTest.php @@ -26,7 +26,7 @@ public function test_creates_filesystem_with_non_canonical_mount_protocol(): voi public function test_throws_on_unknown_options(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Filesystem factory for type "file" does not accept any options. Unknown keys: [foo, bar].', ); diff --git a/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/Filesystem/Factory/StdoutFilesystemFactoryTest.php b/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/Filesystem/Factory/StdoutFilesystemFactoryTest.php index 6a212e556c..24c76e051b 100644 --- a/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/Filesystem/Factory/StdoutFilesystemFactoryTest.php +++ b/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/Filesystem/Factory/StdoutFilesystemFactoryTest.php @@ -18,7 +18,7 @@ public function test_creates_filesystem_with_given_mount_protocol(): void public function test_throws_on_unknown_options(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Filesystem factory for type "stdout" does not accept any options. Unknown keys: [foo, bar].', ); diff --git a/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/Filesystem/FilesystemFactoryRegistryTest.php b/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/Filesystem/FilesystemFactoryRegistryTest.php index c590905cbd..c0603524de 100644 --- a/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/Filesystem/FilesystemFactoryRegistryTest.php +++ b/src/bridge/symfony/filesystem-bundle/tests/Flow/Bridge/Symfony/FilesystemBundle/Tests/Unit/Filesystem/FilesystemFactoryRegistryTest.php @@ -53,7 +53,7 @@ public function test_create_passes_entry_options_without_type_to_factory(): void public function test_create_throws_when_factory_missing_for_type(): void { $this->expectException(LogicException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Fstab "primary" mount "memory": No filesystem factory registered for type "memory". Available types: [].', ); @@ -63,7 +63,7 @@ public function test_create_throws_when_factory_missing_for_type(): void public function test_create_wraps_factory_error_with_fstab_and_mount(): void { $this->expectException(LogicException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Fstab "primary" mount "memory": Filesystem factory for type "memory" does not accept any options. Unknown keys: [foo].', ); @@ -78,7 +78,9 @@ public function test_get_throws_on_unknown_type(): void $registry = new FilesystemFactoryRegistry([new StubFilesystemFactory('memory')]); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('No filesystem factory registered for type "file". Available types: [memory].'); + $this->expectExceptionMessageIsOrContains( + 'No filesystem factory registered for type "file". Available types: [memory].', + ); $registry->get('file'); } @@ -107,7 +109,7 @@ public function test_returns_factory_by_type(): void public function test_throws_on_duplicate_factory_type(): void { $this->expectException(LogicException::class); - $this->expectExceptionMessage('Duplicate filesystem factory for type "memory".'); + $this->expectExceptionMessageIsOrContains('Duplicate filesystem factory for type "memory".'); new FilesystemFactoryRegistry([ new StubFilesystemFactory('memory'), diff --git a/src/bridge/symfony/http-foundation-telemetry/tests/Flow/Bridge/Symfony/HttpFoundationTelemetry/Tests/Unit/QueryCarrierTest.php b/src/bridge/symfony/http-foundation-telemetry/tests/Flow/Bridge/Symfony/HttpFoundationTelemetry/Tests/Unit/QueryCarrierTest.php index 4c94a0d3ff..fbea0b869a 100644 --- a/src/bridge/symfony/http-foundation-telemetry/tests/Flow/Bridge/Symfony/HttpFoundationTelemetry/Tests/Unit/QueryCarrierTest.php +++ b/src/bridge/symfony/http-foundation-telemetry/tests/Flow/Bridge/Symfony/HttpFoundationTelemetry/Tests/Unit/QueryCarrierTest.php @@ -41,7 +41,7 @@ public function test_set_throws_runtime_exception(): void $carrier = new QueryCarrier(Request::create('/next')); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('QueryCarrier is read-only'); + $this->expectExceptionMessageIsOrContains('QueryCarrier is read-only'); $carrier->set('key', 'value'); } diff --git a/src/bridge/symfony/http-foundation-telemetry/tests/Flow/Bridge/Symfony/HttpFoundationTelemetry/Tests/Unit/RequestCarrierTest.php b/src/bridge/symfony/http-foundation-telemetry/tests/Flow/Bridge/Symfony/HttpFoundationTelemetry/Tests/Unit/RequestCarrierTest.php index ec67b41815..68ba0d7f91 100644 --- a/src/bridge/symfony/http-foundation-telemetry/tests/Flow/Bridge/Symfony/HttpFoundationTelemetry/Tests/Unit/RequestCarrierTest.php +++ b/src/bridge/symfony/http-foundation-telemetry/tests/Flow/Bridge/Symfony/HttpFoundationTelemetry/Tests/Unit/RequestCarrierTest.php @@ -71,7 +71,7 @@ public function test_set_throws_runtime_exception(): void $carrier = new RequestCarrier($request); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('RequestCarrier is read-only'); + $this->expectExceptionMessageIsOrContains('RequestCarrier is read-only'); $carrier->set('key', 'value'); } diff --git a/src/bridge/symfony/http-foundation/tests/Flow/Bridge/Symfony/HttpFoundation/Tests/Integration/FlowBufferedResponseTest.php b/src/bridge/symfony/http-foundation/tests/Flow/Bridge/Symfony/HttpFoundation/Tests/Integration/FlowBufferedResponseTest.php index 4690692691..e52d619bb6 100644 --- a/src/bridge/symfony/http-foundation/tests/Flow/Bridge/Symfony/HttpFoundation/Tests/Integration/FlowBufferedResponseTest.php +++ b/src/bridge/symfony/http-foundation/tests/Flow/Bridge/Symfony/HttpFoundation/Tests/Integration/FlowBufferedResponseTest.php @@ -20,7 +20,7 @@ final class FlowBufferedResponseTest extends TestCase public function test_a_buffered_response_refuses_a_config_for_a_data_frame_source(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('A DataFrame source carries its own config'); + $this->expectExceptionMessageIsOrContains('A DataFrame source carries its own config'); new FlowBufferedResponse(df()->read(from_array([['id' => 1]])), http_csv_output(), config: config_builder()); } diff --git a/src/bridge/symfony/http-foundation/tests/Flow/Bridge/Symfony/HttpFoundation/Tests/Integration/FlowStreamedResponseTest.php b/src/bridge/symfony/http-foundation/tests/Flow/Bridge/Symfony/HttpFoundation/Tests/Integration/FlowStreamedResponseTest.php index ceef16e832..42275c8214 100644 --- a/src/bridge/symfony/http-foundation/tests/Flow/Bridge/Symfony/HttpFoundation/Tests/Integration/FlowStreamedResponseTest.php +++ b/src/bridge/symfony/http-foundation/tests/Flow/Bridge/Symfony/HttpFoundation/Tests/Integration/FlowStreamedResponseTest.php @@ -72,7 +72,7 @@ public function test_a_data_frame_source_without_analyze_hands_null(): void public function test_a_streamed_response_refuses_a_config_for_a_data_frame_source(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('A DataFrame source carries its own config'); + $this->expectExceptionMessageIsOrContains('A DataFrame source carries its own config'); new FlowStreamedResponse(df()->read(from_array([['id' => 1]])), new CSVOutput(), config: config_builder()); } diff --git a/src/bridge/symfony/http-foundation/tests/Flow/Bridge/Symfony/HttpFoundation/Tests/Unit/DataStreamTest.php b/src/bridge/symfony/http-foundation/tests/Flow/Bridge/Symfony/HttpFoundation/Tests/Unit/DataStreamTest.php index 09de4648fa..416362fc0e 100644 --- a/src/bridge/symfony/http-foundation/tests/Flow/Bridge/Symfony/HttpFoundation/Tests/Unit/DataStreamTest.php +++ b/src/bridge/symfony/http-foundation/tests/Flow/Bridge/Symfony/HttpFoundation/Tests/Unit/DataStreamTest.php @@ -18,7 +18,7 @@ final class DataStreamTest extends TestCase public function test_a_config_is_refused_for_a_data_frame_source(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('A DataFrame source carries its own config'); + $this->expectExceptionMessageIsOrContains('A DataFrame source carries its own config'); http_stream_open(df()->read(from_array([['id' => 1]])))->config(config_builder()); } diff --git a/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Integration/FlowPostgreSqlExtensionTest.php b/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Integration/FlowPostgreSqlExtensionTest.php index 2a25c912a8..c381f33f23 100644 --- a/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Integration/FlowPostgreSqlExtensionTest.php +++ b/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Integration/FlowPostgreSqlExtensionTest.php @@ -235,7 +235,7 @@ public function test_cache_pool_share_connection_wires_client_reference(): void public function test_cache_pool_unknown_connection_throws(): void { $this->expectException(LogicException::class); - $this->expectExceptionMessage('references unknown connection "missing"'); + $this->expectExceptionMessageIsOrContains('references unknown connection "missing"'); $this->bootKernel([ 'config' => static function (TestKernel $kernel): void { @@ -633,7 +633,7 @@ public function test_migrations_exclude_config_builds_exclusion_policy(): void public function test_migrations_exclude_entry_without_matcher_throws(): void { $this->expectException(LogicException::class); - $this->expectExceptionMessage('must define exactly one of'); + $this->expectExceptionMessageIsOrContains('must define exactly one of'); $this->bootKernel([ 'config' => static function (TestKernel $kernel): void { @@ -889,7 +889,7 @@ public function test_connection_parameters_apply_options_and_session_settings(): public function test_connection_rejects_unknown_libpq_option(): void { $this->expectException(LogicException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Connection "default" has unknown libpq keys under "options": conect_timeout. Allowed keys: application_name,', ); @@ -1089,7 +1089,7 @@ public function test_migrations_use_configured_connection(): void public function test_migrations_throw_when_configured_connection_is_unknown(): void { $this->expectException(LogicException::class); - $this->expectExceptionMessage('Migrations are configured to run against connection "missing"'); + $this->expectExceptionMessageIsOrContains('Migrations are configured to run against connection "missing"'); $this->bootKernel([ 'config' => static function (TestKernel $kernel): void { @@ -1741,7 +1741,7 @@ public function test_session_share_connection_wires_client_reference(): void public function test_session_unknown_connection_throws(): void { $this->expectException(LogicException::class); - $this->expectExceptionMessage('Session references unknown connection "missing"'); + $this->expectExceptionMessageIsOrContains('Session references unknown connection "missing"'); $this->bootKernel([ 'config' => static function (TestKernel $kernel): void { diff --git a/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Integration/Profiler/FlowPostgreSqlProfilerTest.php b/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Integration/Profiler/FlowPostgreSqlProfilerTest.php index 274249c312..83843e851f 100644 --- a/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Integration/Profiler/FlowPostgreSqlProfilerTest.php +++ b/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Integration/Profiler/FlowPostgreSqlProfilerTest.php @@ -139,7 +139,7 @@ public function test_auto_disabled_when_web_profiler_bundle_absent(): void public function test_forcing_enabled_without_web_profiler_bundle_throws(): void { $this->expectException(LogicException::class); - $this->expectExceptionMessage('symfony/web-profiler-bundle is not registered'); + $this->expectExceptionMessageIsOrContains('symfony/web-profiler-bundle is not registered'); $this->bootWithoutWebProfiler(['enabled' => true]); } diff --git a/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Unit/Connection/ConnectionParametersFactoryTest.php b/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Unit/Connection/ConnectionParametersFactoryTest.php index 7a780b029f..4d06587ef5 100644 --- a/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Unit/Connection/ConnectionParametersFactoryTest.php +++ b/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Unit/Connection/ConnectionParametersFactoryTest.php @@ -104,7 +104,7 @@ public function test_create_rejects_option_value_that_is_not_string_or_integer( string $type, ): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage(sprintf( + $this->expectExceptionMessageIsOrContains(sprintf( 'Connection option "keepalives_idle" must be a string or an integer, %s given.', $type, )); @@ -117,7 +117,7 @@ public function test_create_rejects_option_value_that_is_not_string_or_integer( public function test_create_rejects_session_setting_value_that_is_not_string_or_integer(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Session setting "statement_timeout" must be a string or an integer, bool given.', ); diff --git a/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Unit/DependencyInjection/ConfigurationTest.php b/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Unit/DependencyInjection/ConfigurationTest.php index a75b98202d..ba9cd707ff 100644 --- a/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Unit/DependencyInjection/ConfigurationTest.php +++ b/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Unit/DependencyInjection/ConfigurationTest.php @@ -983,7 +983,7 @@ public function test_migrations_lock_type_accepts_its_keys(array $lock): void public function test_migrations_lock_type_rejects_a_foreign_key(string $type, string $key, int|string $value): void { $this->expectException(InvalidConfigurationException::class); - $this->expectExceptionMessage(sprintf( + $this->expectExceptionMessageIsOrContains(sprintf( 'The "%s" parameter is not supported when flow_postgresql.migrations.lock.type is "%s".', $key, $type, @@ -1012,7 +1012,7 @@ public function test_migrations_lock_rejects_negative_timeout(): void public function test_migrations_lock_service_requires_service_id(): void { $this->expectException(InvalidConfigurationException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'flow_postgresql.migrations.lock.type "service" requires a non-empty "service_id".', ); diff --git a/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Unit/Messenger/FlowPostgreSqlTransportFactoryTest.php b/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Unit/Messenger/FlowPostgreSqlTransportFactoryTest.php index 7409bc4d78..7db660b15e 100644 --- a/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Unit/Messenger/FlowPostgreSqlTransportFactoryTest.php +++ b/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Unit/Messenger/FlowPostgreSqlTransportFactoryTest.php @@ -73,7 +73,7 @@ public function test_create_transport_throws_on_empty_host(): void $factory = new FlowPostgreSqlTransportFactory(new ArrayClientLocator()); $this->expectException(TransportException::class); - $this->expectExceptionMessage('Invalid Flow PostgreSQL Messenger DSN'); + $this->expectExceptionMessageIsOrContains('Invalid Flow PostgreSQL Messenger DSN'); $factory->createTransport('flow-pgsql://', [], new FakeSerializer()); } @@ -83,7 +83,7 @@ public function test_create_transport_throws_when_client_not_found(): void $factory = new FlowPostgreSqlTransportFactory(new ArrayClientLocator()); $this->expectException(TransportException::class); - $this->expectExceptionMessage('connection "missing" not found'); + $this->expectExceptionMessageIsOrContains('connection "missing" not found'); $factory->createTransport('flow-pgsql://missing', [], new FakeSerializer()); } @@ -93,7 +93,7 @@ public function test_create_transport_throws_when_service_is_not_a_client(): voi $factory = new FlowPostgreSqlTransportFactory(new ArrayClientLocator(['default' => new stdClass()])); $this->expectException(TransportException::class); - $this->expectExceptionMessage('must be an instance of'); + $this->expectExceptionMessageIsOrContains('must be an instance of'); $factory->createTransport('flow-pgsql://default', [], new FakeSerializer()); } diff --git a/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Unit/Profiler/QueryRecorderOptionsTest.php b/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Unit/Profiler/QueryRecorderOptionsTest.php index b15e392dac..0522d34a4d 100644 --- a/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Unit/Profiler/QueryRecorderOptionsTest.php +++ b/src/bridge/symfony/postgresql-bundle/tests/Flow/Bridge/Symfony/PostgreSqlBundle/Tests/Unit/Profiler/QueryRecorderOptionsTest.php @@ -53,7 +53,8 @@ public function test_max_parameters_wither_returns_new_instance(): void public function test_rejects_max_queries_below_one(int $maxQueries): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('QueryRecorderOptions::$maxQueries must be at least 1, got ' . $maxQueries); + $this->expectExceptionMessageIsOrContains('QueryRecorderOptions::$maxQueries must be at least 1, got ' + . $maxQueries); new QueryRecorderOptions(maxQueries: $maxQueries); } @@ -61,7 +62,9 @@ public function test_rejects_max_queries_below_one(int $maxQueries): void public function test_rejects_negative_max_parameters(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('QueryRecorderOptions::$maxRetainedParameters must not be negative, got -1'); + $this->expectExceptionMessageIsOrContains( + 'QueryRecorderOptions::$maxRetainedParameters must not be negative, got -1', + ); new QueryRecorderOptions(maxRetainedParameters: -1); } diff --git a/src/bridge/symfony/postgresql-messenger/tests/Flow/Bridge/Symfony/PostgreSQLMessenger/Tests/Unit/ConnectionTest.php b/src/bridge/symfony/postgresql-messenger/tests/Flow/Bridge/Symfony/PostgreSQLMessenger/Tests/Unit/ConnectionTest.php index fa90251169..544af5fd88 100644 --- a/src/bridge/symfony/postgresql-messenger/tests/Flow/Bridge/Symfony/PostgreSQLMessenger/Tests/Unit/ConnectionTest.php +++ b/src/bridge/symfony/postgresql-messenger/tests/Flow/Bridge/Symfony/PostgreSQLMessenger/Tests/Unit/ConnectionTest.php @@ -175,7 +175,7 @@ public function test_keepalive_throws_when_seconds_larger_than_redeliver_timeout $connection = new Connection($client, redeliverTimeout: 60); $this->expectException(TransportException::class); - $this->expectExceptionMessage('cannot be smaller than the keepalive interval'); + $this->expectExceptionMessageIsOrContains('cannot be smaller than the keepalive interval'); $connection->keepalive('123', seconds: 120); } diff --git a/src/bridge/symfony/postgresql-messenger/tests/Flow/Bridge/Symfony/PostgreSQLMessenger/Tests/Unit/FlowPostgreSqlSenderTest.php b/src/bridge/symfony/postgresql-messenger/tests/Flow/Bridge/Symfony/PostgreSQLMessenger/Tests/Unit/FlowPostgreSqlSenderTest.php index acb224e31c..0725b962df 100644 --- a/src/bridge/symfony/postgresql-messenger/tests/Flow/Bridge/Symfony/PostgreSQLMessenger/Tests/Unit/FlowPostgreSqlSenderTest.php +++ b/src/bridge/symfony/postgresql-messenger/tests/Flow/Bridge/Symfony/PostgreSQLMessenger/Tests/Unit/FlowPostgreSqlSenderTest.php @@ -114,7 +114,7 @@ public function fetchSingle(Sql|string $sql, array $parameters = []): array $sender = new FlowPostgreSqlSender(new Connection($client), new FakeSerializer()); $this->expectException(TransportException::class); - $this->expectExceptionMessage('boom'); + $this->expectExceptionMessageIsOrContains('boom'); $sender->send(new Envelope((object) [])); } diff --git a/src/bridge/symfony/postgresql-session/tests/Flow/Bridge/Symfony/PostgreSQLSession/Tests/Unit/FlowPostgreSqlSessionHandlerTest.php b/src/bridge/symfony/postgresql-session/tests/Flow/Bridge/Symfony/PostgreSQLSession/Tests/Unit/FlowPostgreSqlSessionHandlerTest.php index 8642057dc6..0a5ef13817 100644 --- a/src/bridge/symfony/postgresql-session/tests/Flow/Bridge/Symfony/PostgreSQLSession/Tests/Unit/FlowPostgreSqlSessionHandlerTest.php +++ b/src/bridge/symfony/postgresql-session/tests/Flow/Bridge/Symfony/PostgreSQLSession/Tests/Unit/FlowPostgreSqlSessionHandlerTest.php @@ -63,7 +63,7 @@ public function test_constructor_accepts_none_lock_mode(): void public function test_constructor_rejects_invalid_lock_mode(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Invalid lock_mode "99"'); + $this->expectExceptionMessageIsOrContains('Invalid lock_mode "99"'); $this->context->handler(['lock_mode' => 99]); } @@ -177,7 +177,7 @@ public function test_read_throws_when_data_is_not_string(): void $handler = $this->context->handler(['lock_mode' => FlowPostgreSqlSessionHandler::LOCK_NONE]); $this->expectException(SessionException::class); - $this->expectExceptionMessage('Unexpected session row shape: field "sess_data"'); + $this->expectExceptionMessageIsOrContains('Unexpected session row shape: field "sess_data"'); $handler->read('sid-bad-data'); } @@ -188,7 +188,7 @@ public function test_read_throws_when_lifetime_is_not_int(): void $handler = $this->context->handler(['lock_mode' => FlowPostgreSqlSessionHandler::LOCK_NONE]); $this->expectException(SessionException::class); - $this->expectExceptionMessage('Unexpected session row shape: field "sess_lifetime"'); + $this->expectExceptionMessageIsOrContains('Unexpected session row shape: field "sess_lifetime"'); $handler->read('sid-bad-lifetime'); } diff --git a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Integration/FlowTelemetryExtensionTest.php b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Integration/FlowTelemetryExtensionTest.php index 310c9e057a..44e28877b1 100644 --- a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Integration/FlowTelemetryExtensionTest.php +++ b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Integration/FlowTelemetryExtensionTest.php @@ -387,7 +387,7 @@ public function test_composite_error_handler_is_registered_with_referenced_child public function test_composite_referencing_unknown_child_throws(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Unknown error_handler "ghost"'); + $this->expectExceptionMessageIsOrContains('Unknown error_handler "ghost"'); $this->bootKernel([ 'config' => static function (TestKernel $kernel): void { @@ -1285,7 +1285,7 @@ public function test_otlp_transport_failover_inline_grpc_with_curl_failover(): v public function test_processor_referencing_unknown_exporter_throws(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('references unknown exporter "missing"'); + $this->expectExceptionMessageIsOrContains('references unknown exporter "missing"'); $this->bootKernel([ 'config' => static function (TestKernel $kernel): void { @@ -1436,7 +1436,9 @@ public function test_service_error_handler_creates_alias_to_user_service_id(): v public function test_service_error_handler_missing_service_id_throws(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('error_handler "custom" of type "service" requires a non-empty "service_id"'); + $this->expectExceptionMessageIsOrContains( + 'error_handler "custom" of type "service" requires a non-empty "service_id"', + ); $this->bootKernel([ 'config' => static function (TestKernel $kernel): void { @@ -1647,7 +1649,9 @@ public function test_stream_handler_is_registered_with_destination(): void public function test_stream_handler_missing_destination_throws(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('error_handler "to_file" of type "stream" requires a non-empty "destination"'); + $this->expectExceptionMessageIsOrContains( + 'error_handler "to_file" of type "stream" requires a non-empty "destination"', + ); $this->bootKernel([ 'config' => static function (TestKernel $kernel): void { @@ -1829,7 +1833,7 @@ public function test_udp_syslog_handler_is_registered_with_host_and_port(): void public function test_unknown_error_handler_reference_throws(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Unknown error_handler "missing"'); + $this->expectExceptionMessageIsOrContains('Unknown error_handler "missing"'); $this->bootKernel([ 'config' => static function (TestKernel $kernel): void { @@ -1985,7 +1989,7 @@ public function test_env_placeholders_in_skipped_sections_do_not_break_the_dumpe public function test_env_placeholder_for_enabled_is_rejected(): void { $this->expectException(InvalidConfigurationException::class); - $this->expectExceptionMessage('flow_telemetry.enabled is evaluated when the container is compiled'); + $this->expectExceptionMessageIsOrContains('flow_telemetry.enabled is evaluated when the container is compiled'); $this->bootKernel([ 'config' => static function (TestKernel $kernel): void { diff --git a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Integration/Profiler/FlowTelemetryProfilerTest.php b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Integration/Profiler/FlowTelemetryProfilerTest.php index 16377ad9de..0669e9b2e8 100644 --- a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Integration/Profiler/FlowTelemetryProfilerTest.php +++ b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Integration/Profiler/FlowTelemetryProfilerTest.php @@ -93,7 +93,7 @@ public function test_auto_disabled_when_web_profiler_bundle_is_absent(): void public function test_forcing_enabled_without_web_profiler_bundle_throws(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Profiler integration requires symfony/web-profiler-bundle'); + $this->expectExceptionMessageIsOrContains('Profiler integration requires symfony/web-profiler-bundle'); $this->bootWithoutWebProfiler(['enabled' => true]); } diff --git a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/DependencyInjection/Compiler/ChannelLoggerPassTest.php b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/DependencyInjection/Compiler/ChannelLoggerPassTest.php index ac34fb3ff0..543e7d0d31 100644 --- a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/DependencyInjection/Compiler/ChannelLoggerPassTest.php +++ b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/DependencyInjection/Compiler/ChannelLoggerPassTest.php @@ -113,7 +113,7 @@ public function test_empty_channel_attribute_throws(): void $container = ChannelLoggerMother::taggedConsumerContainer(''); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('missing the required non-empty "channel" attribute'); + $this->expectExceptionMessageIsOrContains('missing the required non-empty "channel" attribute'); new ChannelLoggerPass()->process($container); } @@ -124,7 +124,7 @@ public function test_channel_parameter_resolving_to_empty_throws(): void $container->setParameter('flow.test.channel', ''); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('did not resolve to a non-empty string'); + $this->expectExceptionMessageIsOrContains('did not resolve to a non-empty string'); new ChannelLoggerPass()->process($container); } @@ -137,7 +137,7 @@ public function test_missing_channel_attribute_throws(): void $container->setDefinition('consumer', $consumer); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Service "consumer" is tagged'); + $this->expectExceptionMessageIsOrContains('Service "consumer" is tagged'); new ChannelLoggerPass()->process($container); } diff --git a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/DependencyInjection/ConfigurationTest.php b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/DependencyInjection/ConfigurationTest.php index 6c337b1135..d401c1463b 100644 --- a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/DependencyInjection/ConfigurationTest.php +++ b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/DependencyInjection/ConfigurationTest.php @@ -192,7 +192,7 @@ public function test_error_handlers_section_is_empty_by_default(): void public function test_exporter_with_multiple_blocks_throws(): void { $this->expectException(InvalidConfigurationException::class); - $this->expectExceptionMessage('Exporter must declare exactly one of'); + $this->expectExceptionMessageIsOrContains('Exporter must declare exactly one of'); $this->context->processConfig([ 'resource' => [], @@ -208,7 +208,7 @@ public function test_exporter_with_multiple_blocks_throws(): void public function test_exporter_with_no_block_throws(): void { $this->expectException(InvalidConfigurationException::class); - $this->expectExceptionMessage('Exporter must declare exactly one of'); + $this->expectExceptionMessageIsOrContains('Exporter must declare exactly one of'); $this->context->processConfig([ 'resource' => [], @@ -241,7 +241,7 @@ public function test_grpc_transport_accepts_timeout_ms(): void public function test_grpc_transport_rejects_connect_timeout_ms(): void { $this->expectException(InvalidConfigurationException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'The "connect_timeout_ms" parameter is not supported when transport.type is "grpc"', ); @@ -264,7 +264,9 @@ public function test_grpc_transport_rejects_connect_timeout_ms(): void public function test_grpc_transport_rejects_encoding_field(): void { $this->expectException(InvalidConfigurationException::class); - $this->expectExceptionMessage('"encoding" parameter is not supported when transport.type is "grpc"'); + $this->expectExceptionMessageIsOrContains( + '"encoding" parameter is not supported when transport.type is "grpc"', + ); $this->context->processConfig([ 'resource' => [], @@ -384,7 +386,7 @@ public function test_async_curl_transport_accepts_pump_timeout_ms(): void public function test_pump_timeout_ms_is_rejected_for_non_async_curl_transports(string $type): void { $this->expectException(InvalidConfigurationException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'The "pump_timeout_ms" parameter is only supported when transport.type is "async_curl"', ); @@ -423,7 +425,7 @@ public function test_otlp_exporter_error_handler_defaults_to_default(): void public function test_otlp_exporter_without_transport_block_throws(): void { $this->expectException(InvalidConfigurationException::class); - $this->expectExceptionMessage('OTLP exporter requires a "transport" configuration block'); + $this->expectExceptionMessageIsOrContains('OTLP exporter requires a "transport" configuration block'); $this->context->processConfig([ 'resource' => [], @@ -469,7 +471,7 @@ public function test_provider_error_handler_defaults_to_default(): void public function test_service_exporter_requires_id(): void { $this->expectException(InvalidConfigurationException::class); - $this->expectExceptionMessage('id'); + $this->expectExceptionMessageIsOrContains('id'); $this->context->processConfig([ 'resource' => [], @@ -580,7 +582,9 @@ public function test_stream_transport_accepts_file_path_and_php_uri(string $endp public function test_stream_transport_rejects_encoding_field(): void { $this->expectException(InvalidConfigurationException::class); - $this->expectExceptionMessage('"encoding" parameter is not supported when transport.type is "stream"'); + $this->expectExceptionMessageIsOrContains( + '"encoding" parameter is not supported when transport.type is "stream"', + ); $this->context->processConfig([ 'resource' => [], @@ -607,7 +611,7 @@ public function test_stream_transport_rejects_encoding_field(): void public function test_stream_transport_rejects_http_specific_options(string $key, mixed $value): void { $this->expectException(InvalidConfigurationException::class); - $this->expectExceptionMessage(sprintf( + $this->expectExceptionMessageIsOrContains(sprintf( 'The "%s" parameter is not supported when transport.type is "stream".', $key, )); @@ -631,7 +635,7 @@ public function test_stream_transport_rejects_http_specific_options(string $key, public function test_stream_transport_requires_non_empty_endpoint(): void { $this->expectException(InvalidConfigurationException::class); - $this->expectExceptionMessage('endpoint'); + $this->expectExceptionMessageIsOrContains('endpoint'); $this->context->processConfig([ 'resource' => [], @@ -672,7 +676,7 @@ public function test_transport_failover_block_is_accepted_under_curl_primary(): public function test_transport_failover_rejected_for_stream_primary(): void { $this->expectException(InvalidConfigurationException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( '"failover" block is only supported for transport.type "curl", "async_curl" or "grpc"', ); @@ -698,7 +702,7 @@ public function test_transport_failover_rejected_for_stream_primary(): void public function test_transport_failover_rejects_nested_failover(): void { $this->expectException(InvalidConfigurationException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Unrecognized option "failover" under "flow_telemetry.exporters.otlp.otlp.transport.failover"', ); @@ -1005,7 +1009,9 @@ public function test_nested_config_is_still_validated_when_root_is_disabled(): v public function test_root_shorthand_false_is_rejected(): void { $this->expectException(InvalidTypeException::class); - $this->expectExceptionMessage('Invalid type for path "flow_telemetry". Expected "array", but got "bool"'); + $this->expectExceptionMessageIsOrContains( + 'Invalid type for path "flow_telemetry". Expected "array", but got "bool"', + ); $this->context->processRawConfig(false); } diff --git a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Instrumentation/Cache/TagAwareTraceableCacheAdapterTest.php b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Instrumentation/Cache/TagAwareTraceableCacheAdapterTest.php index dae645fa1a..f982c00270 100644 --- a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Instrumentation/Cache/TagAwareTraceableCacheAdapterTest.php +++ b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Instrumentation/Cache/TagAwareTraceableCacheAdapterTest.php @@ -254,7 +254,7 @@ public function saveDeferred(CacheItemInterface $item): bool $traceable = new TagAwareTraceableCacheAdapter($adapter, $telemetry, 'test.pool'); $this->expectException(BadMethodCallException::class); - $this->expectExceptionMessage('does not implement'); + $this->expectExceptionMessageIsOrContains('does not implement'); $traceable->delete('key'); } @@ -322,7 +322,7 @@ public function saveDeferred(CacheItemInterface $item): bool $traceable = new TagAwareTraceableCacheAdapter($adapter, $telemetry, 'test.pool'); $this->expectException(BadMethodCallException::class); - $this->expectExceptionMessage('does not implement'); + $this->expectExceptionMessageIsOrContains('does not implement'); $traceable->get('key', static fn() => 'value'); } diff --git a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Logger/ConsoleVerbosityLevelsTest.php b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Logger/ConsoleVerbosityLevelsTest.php index 0ada305225..07831fd5c2 100644 --- a/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Logger/ConsoleVerbosityLevelsTest.php +++ b/src/bridge/symfony/telemetry-bundle/tests/Flow/Bridge/Symfony/TelemetryBundle/Tests/Unit/Logger/ConsoleVerbosityLevelsTest.php @@ -40,7 +40,7 @@ public function test_from_overrides_merges_onto_defaults(): void public function test_from_overrides_rejects_unknown_severity_name(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Unknown severity "NOTICE"'); + $this->expectExceptionMessageIsOrContains('Unknown severity "NOTICE"'); ConsoleVerbosityLevels::fromOverrides(['VERBOSITY_NORMAL' => 'NOTICE']); } @@ -48,7 +48,7 @@ public function test_from_overrides_rejects_unknown_severity_name(): void public function test_from_overrides_rejects_unknown_verbosity_level(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Unknown console verbosity level "VERBOSITY_LOUD"'); + $this->expectExceptionMessageIsOrContains('Unknown console verbosity level "VERBOSITY_LOUD"'); ConsoleVerbosityLevels::fromOverrides(['VERBOSITY_LOUD' => 'INFO']); } diff --git a/src/bridge/telemetry/otlp/tests/Flow/Bridge/Telemetry/OTLP/Tests/Unit/Transport/AsyncCurlTransportOptionsTest.php b/src/bridge/telemetry/otlp/tests/Flow/Bridge/Telemetry/OTLP/Tests/Unit/Transport/AsyncCurlTransportOptionsTest.php index f7c24cd917..6db728313d 100644 --- a/src/bridge/telemetry/otlp/tests/Flow/Bridge/Telemetry/OTLP/Tests/Unit/Transport/AsyncCurlTransportOptionsTest.php +++ b/src/bridge/telemetry/otlp/tests/Flow/Bridge/Telemetry/OTLP/Tests/Unit/Transport/AsyncCurlTransportOptionsTest.php @@ -78,7 +78,7 @@ public function test_with_pump_timeout_accepts_zero(): void public function test_with_pump_timeout_rejects_negative_value(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Pump timeout must be non-negative'); + $this->expectExceptionMessageIsOrContains('Pump timeout must be non-negative'); new AsyncCurlTransportOptions()->withPumpTimeout(-1); } @@ -195,7 +195,7 @@ public function test_with_connect_timeout(): void public function test_with_connect_timeout_rejects_negative_value(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Connect timeout must be non-negative'); + $this->expectExceptionMessageIsOrContains('Connect timeout must be non-negative'); new AsyncCurlTransportOptions()->withConnectTimeout(-1); } @@ -218,7 +218,7 @@ public function test_with_follow_redirects_enabled(): void public function test_with_follow_redirects_rejects_negative_max_redirects(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Max redirects must be non-negative'); + $this->expectExceptionMessageIsOrContains('Max redirects must be non-negative'); new AsyncCurlTransportOptions()->withFollowRedirects(true, -1); } @@ -280,7 +280,7 @@ public function test_with_shutdown_timeout(): void public function test_with_shutdown_timeout_rejects_negative_value(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Shutdown timeout must be non-negative'); + $this->expectExceptionMessageIsOrContains('Shutdown timeout must be non-negative'); new AsyncCurlTransportOptions()->withShutdownTimeout(-1); } @@ -327,7 +327,7 @@ public function test_with_timeout(): void public function test_with_timeout_rejects_negative_value(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Timeout must be non-negative'); + $this->expectExceptionMessageIsOrContains('Timeout must be non-negative'); new AsyncCurlTransportOptions()->withTimeout(-1); } diff --git a/src/bridge/telemetry/otlp/tests/Flow/Bridge/Telemetry/OTLP/Tests/Unit/Transport/AsyncCurlTransportTest.php b/src/bridge/telemetry/otlp/tests/Flow/Bridge/Telemetry/OTLP/Tests/Unit/Transport/AsyncCurlTransportTest.php index 8279cb6495..20a91e51bd 100644 --- a/src/bridge/telemetry/otlp/tests/Flow/Bridge/Telemetry/OTLP/Tests/Unit/Transport/AsyncCurlTransportTest.php +++ b/src/bridge/telemetry/otlp/tests/Flow/Bridge/Telemetry/OTLP/Tests/Unit/Transport/AsyncCurlTransportTest.php @@ -36,7 +36,7 @@ public function test_constructor_requires_curl_extension(): void { if (!extension_loaded('curl')) { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('ext-curl is required'); + $this->expectExceptionMessageIsOrContains('ext-curl is required'); new AsyncCurlTransport('http://localhost:4318', new JsonSerializer()); } else { @@ -187,7 +187,7 @@ public function test_send_after_shutdown_throws_exception(): void $transport->shutdown(); $this->expectException(TransportException::class); - $this->expectExceptionMessage('Cannot send after shutdown'); + $this->expectExceptionMessageIsOrContains('Cannot send after shutdown'); $transport->send(Signals::traces($this->createSpans())); } @@ -276,7 +276,7 @@ public function test_shutdown_surfaces_failover_shutdown_exception_when_no_defer ); $this->expectException(TransportException::class); - $this->expectExceptionMessage('failover shutdown failed: boom'); + $this->expectExceptionMessageIsOrContains('failover shutdown failed: boom'); $transport->shutdown(); } diff --git a/src/bridge/telemetry/otlp/tests/Flow/Bridge/Telemetry/OTLP/Tests/Unit/Transport/CurlTransportOptionsTest.php b/src/bridge/telemetry/otlp/tests/Flow/Bridge/Telemetry/OTLP/Tests/Unit/Transport/CurlTransportOptionsTest.php index 3897c5381a..4b5e54b78f 100644 --- a/src/bridge/telemetry/otlp/tests/Flow/Bridge/Telemetry/OTLP/Tests/Unit/Transport/CurlTransportOptionsTest.php +++ b/src/bridge/telemetry/otlp/tests/Flow/Bridge/Telemetry/OTLP/Tests/Unit/Transport/CurlTransportOptionsTest.php @@ -163,7 +163,7 @@ public function test_with_connect_timeout(): void public function test_with_connect_timeout_rejects_negative_value(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Connect timeout must be non-negative'); + $this->expectExceptionMessageIsOrContains('Connect timeout must be non-negative'); new CurlTransportOptions()->withConnectTimeout(-1); } @@ -186,7 +186,7 @@ public function test_with_follow_redirects_enabled(): void public function test_with_follow_redirects_rejects_negative_max_redirects(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Max redirects must be non-negative'); + $this->expectExceptionMessageIsOrContains('Max redirects must be non-negative'); new CurlTransportOptions()->withFollowRedirects(true, -1); } @@ -248,7 +248,7 @@ public function test_with_shutdown_timeout(): void public function test_with_shutdown_timeout_rejects_negative_value(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Shutdown timeout must be non-negative'); + $this->expectExceptionMessageIsOrContains('Shutdown timeout must be non-negative'); new CurlTransportOptions()->withShutdownTimeout(-1); } @@ -295,7 +295,7 @@ public function test_with_timeout(): void public function test_with_timeout_rejects_negative_value(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Timeout must be non-negative'); + $this->expectExceptionMessageIsOrContains('Timeout must be non-negative'); new CurlTransportOptions()->withTimeout(-1); } diff --git a/src/bridge/telemetry/otlp/tests/Flow/Bridge/Telemetry/OTLP/Tests/Unit/Transport/CurlTransportTest.php b/src/bridge/telemetry/otlp/tests/Flow/Bridge/Telemetry/OTLP/Tests/Unit/Transport/CurlTransportTest.php index 90f3f619db..37cc7c1223 100644 --- a/src/bridge/telemetry/otlp/tests/Flow/Bridge/Telemetry/OTLP/Tests/Unit/Transport/CurlTransportTest.php +++ b/src/bridge/telemetry/otlp/tests/Flow/Bridge/Telemetry/OTLP/Tests/Unit/Transport/CurlTransportTest.php @@ -33,7 +33,7 @@ public function test_constructor_requires_curl_extension(): void { if (!extension_loaded('curl')) { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('ext-curl is required'); + $this->expectExceptionMessageIsOrContains('ext-curl is required'); new CurlTransport('http://localhost:4318', new JsonSerializer()); } else { @@ -113,7 +113,7 @@ public function test_send_throws_transport_exception_on_connection_failure(): vo ); $this->expectException(TransportException::class); - $this->expectExceptionMessage('curl error'); + $this->expectExceptionMessageIsOrContains('curl error'); $transport->send(Signals::traces($this->createSpans())); } @@ -194,7 +194,7 @@ public function test_send_after_shutdown_throws_exception(): void $transport->shutdown(); $this->expectException(TransportException::class); - $this->expectExceptionMessage('Cannot send after shutdown'); + $this->expectExceptionMessageIsOrContains('Cannot send after shutdown'); $transport->send(Signals::traces($this->createSpans())); } @@ -257,7 +257,7 @@ public function test_shutdown_surfaces_failover_shutdown_exception(): void ); $this->expectException(TransportException::class); - $this->expectExceptionMessage('failover shutdown failed: boom'); + $this->expectExceptionMessageIsOrContains('failover shutdown failed: boom'); $transport->shutdown(); } diff --git a/src/bridge/telemetry/otlp/tests/Flow/Bridge/Telemetry/OTLP/Tests/Unit/Transport/GrpcTransportTest.php b/src/bridge/telemetry/otlp/tests/Flow/Bridge/Telemetry/OTLP/Tests/Unit/Transport/GrpcTransportTest.php index f8edaff949..76ab5b5e67 100644 --- a/src/bridge/telemetry/otlp/tests/Flow/Bridge/Telemetry/OTLP/Tests/Unit/Transport/GrpcTransportTest.php +++ b/src/bridge/telemetry/otlp/tests/Flow/Bridge/Telemetry/OTLP/Tests/Unit/Transport/GrpcTransportTest.php @@ -33,7 +33,7 @@ public function test_constructor_rejects_negative_shutdown_timeout(): void $this->skipIfGrpcDependenciesNotAvailable(); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Shutdown timeout must be non-negative'); + $this->expectExceptionMessageIsOrContains('Shutdown timeout must be non-negative'); new GrpcTransport('localhost:4317', shutdownTimeoutMs: -1); } @@ -44,7 +44,7 @@ public function test_constructor_rejects_negative_timeout(): void $this->skipIfGrpcDependenciesNotAvailable(); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Timeout must be non-negative'); + $this->expectExceptionMessageIsOrContains('Timeout must be non-negative'); new GrpcTransport('localhost:4317', timeoutMs: -1); } @@ -56,7 +56,7 @@ public function test_constructor_throws_when_grpc_extension_not_loaded(): void } $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('grpc PHP extension is required'); + $this->expectExceptionMessageIsOrContains('grpc PHP extension is required'); new GrpcTransport('localhost:4317'); } @@ -160,7 +160,7 @@ public function test_send_after_shutdown_throws(): void $transport->shutdown(); $this->expectException(TransportException::class); - $this->expectExceptionMessage('Cannot send after shutdown'); + $this->expectExceptionMessageIsOrContains('Cannot send after shutdown'); $transport->send(Signals::traces([])); } @@ -225,7 +225,7 @@ public function test_shutdown_surfaces_failover_shutdown_exception_when_no_defer $transport = new GrpcTransport(endpoint: 'localhost:4317', failover: $failover); $this->expectException(TransportException::class); - $this->expectExceptionMessage('failover shutdown failed: boom'); + $this->expectExceptionMessageIsOrContains('failover shutdown failed: boom'); $transport->shutdown(); } diff --git a/src/bridge/telemetry/otlp/tests/Flow/Bridge/Telemetry/OTLP/Tests/Unit/Transport/StreamTransportTest.php b/src/bridge/telemetry/otlp/tests/Flow/Bridge/Telemetry/OTLP/Tests/Unit/Transport/StreamTransportTest.php index f1e0b8f593..444d383541 100644 --- a/src/bridge/telemetry/otlp/tests/Flow/Bridge/Telemetry/OTLP/Tests/Unit/Transport/StreamTransportTest.php +++ b/src/bridge/telemetry/otlp/tests/Flow/Bridge/Telemetry/OTLP/Tests/Unit/Transport/StreamTransportTest.php @@ -93,7 +93,7 @@ public function test_does_not_create_directory_for_custom_stream_wrapper_schemes public function test_empty_destination_throws(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('non-empty'); + $this->expectExceptionMessageIsOrContains('non-empty'); new StreamTransport(''); } @@ -118,7 +118,7 @@ public function test_failed_write_throws(): void $transport = new StreamTransport('flow-failwrite://buf'); $this->expectException(TransportException::class); - $this->expectExceptionMessage('Failed to write OTLP payload to "flow-failwrite://buf"'); + $this->expectExceptionMessageIsOrContains('Failed to write OTLP payload to "flow-failwrite://buf"'); $transport->send(Signals::logs([LogEntryMother::deterministic('hello', Severity::INFO)])); } finally { @@ -131,7 +131,7 @@ public function test_failed_write_throws(): void public function test_out_of_range_file_permissions_throw(int $perm): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('between 0 and 0777'); + $this->expectExceptionMessageIsOrContains('between 0 and 0777'); new StreamTransport('php://memory', filePermissions: $perm); } @@ -161,7 +161,7 @@ public function test_send_after_shutdown_throws(): void $transport->shutdown(); $this->expectException(TransportException::class); - $this->expectExceptionMessage('Cannot send after shutdown'); + $this->expectExceptionMessageIsOrContains('Cannot send after shutdown'); $transport->send(Signals::logs([LogEntryMother::deterministic('hello', Severity::INFO)])); } diff --git a/src/cli/tests/Flow/CLI/Tests/Integration/DatabaseTableListCommandTest.php b/src/cli/tests/Flow/CLI/Tests/Integration/DatabaseTableListCommandTest.php index 7e0258579e..ee1e773523 100644 --- a/src/cli/tests/Flow/CLI/Tests/Integration/DatabaseTableListCommandTest.php +++ b/src/cli/tests/Flow/CLI/Tests/Integration/DatabaseTableListCommandTest.php @@ -37,7 +37,7 @@ protected function setUp(): void public function test_config_option_is_not_accepted(): void { $this->expectException(InvalidOptionException::class); - $this->expectExceptionMessage('The "--config" option does not exist.'); + $this->expectExceptionMessageIsOrContains('The "--config" option does not exist.'); new CommandTester(new DatabaseTableListCommand('db:table:list'))->execute([ '--db-connection-file' => __DIR__ . '/Fixtures/connection.php', diff --git a/src/cli/tests/Flow/CLI/Tests/Integration/DatabaseTableSchemaCommandTest.php b/src/cli/tests/Flow/CLI/Tests/Integration/DatabaseTableSchemaCommandTest.php index cf0a2e531c..3149a1f28e 100644 --- a/src/cli/tests/Flow/CLI/Tests/Integration/DatabaseTableSchemaCommandTest.php +++ b/src/cli/tests/Flow/CLI/Tests/Integration/DatabaseTableSchemaCommandTest.php @@ -37,7 +37,7 @@ protected function setUp(): void public function test_config_option_is_not_accepted(): void { $this->expectException(InvalidOptionException::class); - $this->expectExceptionMessage('The "--config" option does not exist.'); + $this->expectExceptionMessageIsOrContains('The "--config" option does not exist.'); new CommandTester(new DatabaseTableSchemaCommand('db:table:schema'))->execute([ 'input-db-table' => 'table_01', diff --git a/src/cli/tests/Flow/CLI/Tests/Integration/FileConvertCommandTest.php b/src/cli/tests/Flow/CLI/Tests/Integration/FileConvertCommandTest.php index e819072853..b63eca4f24 100644 --- a/src/cli/tests/Flow/CLI/Tests/Integration/FileConvertCommandTest.php +++ b/src/cli/tests/Flow/CLI/Tests/Integration/FileConvertCommandTest.php @@ -136,7 +136,7 @@ public function test_cli_rejects_a_remote_input_path(): void $tester = new CommandTester(new FileConvertCommand('convert')); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('The Flow CLI reads and writes "file://" paths only'); + $this->expectExceptionMessageIsOrContains('The Flow CLI reads and writes "file://" paths only'); $tester->execute([ 'input-file' => 'aws-s3://bucket/orders.csv', @@ -149,7 +149,7 @@ public function test_cli_rejects_a_remote_output_path(): void $tester = new CommandTester(new FileConvertCommand('convert')); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('The Flow CLI reads and writes "file://" paths only'); + $this->expectExceptionMessageIsOrContains('The Flow CLI reads and writes "file://" paths only'); $tester->execute([ 'input-file' => __DIR__ . '/Fixtures/orders.csv', diff --git a/src/cli/tests/Flow/CLI/Tests/Integration/FileReadCommandTest.php b/src/cli/tests/Flow/CLI/Tests/Integration/FileReadCommandTest.php index 836eb39244..a4377f20a1 100644 --- a/src/cli/tests/Flow/CLI/Tests/Integration/FileReadCommandTest.php +++ b/src/cli/tests/Flow/CLI/Tests/Integration/FileReadCommandTest.php @@ -337,7 +337,7 @@ public function test_read_rows_with_output_columns_nonexistent_column(): void // selecting a column the schema does not declare is an error, not an empty column - there is // no type to give it and no reader could see a value that row storage does not carry $this->expectException(SchemaDefinitionNotFoundException::class); - $this->expectExceptionMessage('Schema definition for column "nonexistent_column" not found'); + $this->expectExceptionMessageIsOrContains('Schema definition for column "nonexistent_column" not found'); $tester->execute([ 'input-file' => __DIR__ . '/Fixtures/orders.csv', diff --git a/src/cli/tests/Flow/CLI/Tests/Integration/Options/ConfigOptionTest.php b/src/cli/tests/Flow/CLI/Tests/Integration/Options/ConfigOptionTest.php index c0c575fced..3f3e6e59e5 100644 --- a/src/cli/tests/Flow/CLI/Tests/Integration/Options/ConfigOptionTest.php +++ b/src/cli/tests/Flow/CLI/Tests/Integration/Options/ConfigOptionTest.php @@ -47,7 +47,7 @@ public function test_throwing_exception_when_config_file_returns_a_built_config( $path = __DIR__ . '/Fixtures/.flow.built-config.php'; $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage(sprintf( + $this->expectExceptionMessageIsOrContains(sprintf( "File '%s' returns a built Config. Return the builder instead: return config_builder()->...; without ->build().", $path, )); diff --git a/src/cli/tests/Flow/CLI/Tests/Integration/PipelineRunCommandTest.php b/src/cli/tests/Flow/CLI/Tests/Integration/PipelineRunCommandTest.php index 2abc1bde0f..fa56022d47 100644 --- a/src/cli/tests/Flow/CLI/Tests/Integration/PipelineRunCommandTest.php +++ b/src/cli/tests/Flow/CLI/Tests/Integration/PipelineRunCommandTest.php @@ -17,7 +17,7 @@ final class PipelineRunCommandTest extends TestCase public function test_config_option_is_not_accepted(): void { $this->expectException(InvalidOptionException::class); - $this->expectExceptionMessage('The "--config" option does not exist.'); + $this->expectExceptionMessageIsOrContains('The "--config" option does not exist.'); new CommandTester(new PipelineRunCommand('run'))->execute([ 'pipeline-file' => __DIR__ . '/Fixtures/pipeline.php', @@ -123,7 +123,7 @@ public function test_run_command_without_pipeline_input_file_provided(): void $tester = new CommandTester(new PipelineRunCommand('run')); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Argument \'pipeline-file\' is required.'); + $this->expectExceptionMessageIsOrContains('Argument \'pipeline-file\' is required.'); $tester->execute([]); } diff --git a/src/cli/tests/Flow/CLI/Tests/Integration/SchemaFormatCommandTest.php b/src/cli/tests/Flow/CLI/Tests/Integration/SchemaFormatCommandTest.php index 3a1e94ce83..5fb195e1ae 100644 --- a/src/cli/tests/Flow/CLI/Tests/Integration/SchemaFormatCommandTest.php +++ b/src/cli/tests/Flow/CLI/Tests/Integration/SchemaFormatCommandTest.php @@ -16,7 +16,7 @@ final class SchemaFormatCommandTest extends TestCase public function test_config_option_is_not_accepted(): void { $this->expectException(InvalidOptionException::class); - $this->expectExceptionMessage('The "--config" option does not exist.'); + $this->expectExceptionMessageIsOrContains('The "--config" option does not exist.'); new CommandTester(new SchemaFormatCommand('schema:format'))->execute([ 'input-schema-file' => __DIR__ . '/Fixtures/schema.json', diff --git a/src/cli/tests/Flow/CLI/Tests/Unit/Options/FileFormatOptionTest.php b/src/cli/tests/Flow/CLI/Tests/Unit/Options/FileFormatOptionTest.php index 5edbe806d2..b9d0c5c90b 100644 --- a/src/cli/tests/Flow/CLI/Tests/Unit/Options/FileFormatOptionTest.php +++ b/src/cli/tests/Flow/CLI/Tests/Unit/Options/FileFormatOptionTest.php @@ -51,7 +51,7 @@ public function test_getting_format_from_path_without_extension(): void $option = new InputOption('format', null, InputOption::VALUE_OPTIONAL); $definition = new InputDefinition([$option]); - $this->expectExceptionMessage("Option 'format' is required"); + $this->expectExceptionMessageIsOrContains("Option 'format' is required"); new FileFormatOption(path(__DIR__ . '/file'), 'format')->get(new ArrayInput([], $definition)); } } diff --git a/src/cli/tests/Flow/CLI/Tests/Unit/PipelineFactoryTest.php b/src/cli/tests/Flow/CLI/Tests/Unit/PipelineFactoryTest.php index 15cdf780a0..633e71f131 100644 --- a/src/cli/tests/Flow/CLI/Tests/Unit/PipelineFactoryTest.php +++ b/src/cli/tests/Flow/CLI/Tests/Unit/PipelineFactoryTest.php @@ -31,7 +31,7 @@ public function test_non_existing_file(): void public function test_non_php_file(): void { - $this->expectExceptionMessage('Expected "php" file format, "txt" given.'); + $this->expectExceptionMessageIsOrContains('Expected "php" file format, "txt" given.'); $this->expectException(InvalidFileFormatException::class); $factory = new PipelineFactory(path(__DIR__ . '/../Fixtures/empty.txt')); @@ -48,7 +48,7 @@ public function test_with_data_frame_in_file(): void public function test_without_data_frame_in_file(): void { - $this->expectExceptionMessage('Expecting Flow-PHP DataFrame, received: '); + $this->expectExceptionMessageIsOrContains('Expecting Flow-PHP DataFrame, received: '); $this->expectException(InvalidArgumentException::class); $factory = new PipelineFactory(path(__DIR__ . '/../Fixtures/without-dataframe.php')); diff --git a/src/core/etl/tests/Flow/ETL/Tests/Integration/DataFrame/AliasedReferenceTest.php b/src/core/etl/tests/Flow/ETL/Tests/Integration/DataFrame/AliasedReferenceTest.php index 65fa16e9e0..bbf1694454 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Integration/DataFrame/AliasedReferenceTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Integration/DataFrame/AliasedReferenceTest.php @@ -76,7 +76,7 @@ public function test_select_renames_an_aliased_column(): void public function test_select_refuses_an_alias_that_names_another_selected_column(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('select() would output column "b" twice'); + $this->expectExceptionMessageIsOrContains('select() would output column "b" twice'); df() ->read(from_array([['a' => 1, 'b' => 'x']])) diff --git a/src/core/etl/tests/Flow/ETL/Tests/Integration/DataFrame/BranchingTest.php b/src/core/etl/tests/Flow/ETL/Tests/Integration/DataFrame/BranchingTest.php index 9c9497b0fe..a8d15bef4c 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Integration/DataFrame/BranchingTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Integration/DataFrame/BranchingTest.php @@ -138,7 +138,7 @@ public function __invoke(DataFrame $dataFrame): DataFrame public function test_branch_rejects_a_non_boolean_condition_at_bind(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('filter() requires a predicate returning boolean'); + $this->expectExceptionMessageIsOrContains('filter() requires a predicate returning boolean'); df() ->read(from_array([['id' => 1, 'group' => 'A']])) diff --git a/src/core/etl/tests/Flow/ETL/Tests/Integration/DataFrame/ConfigBuilderTest.php b/src/core/etl/tests/Flow/ETL/Tests/Integration/DataFrame/ConfigBuilderTest.php index 6029d791fc..0a2d2f0fd8 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Integration/DataFrame/ConfigBuilderTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Integration/DataFrame/ConfigBuilderTest.php @@ -85,7 +85,7 @@ public function test_heartbeats_append_in_registration_order(): void public function test_heartbeat_refuses_an_interval_below_a_tenth_of_a_second(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Heartbeat interval must be at least 0.1 seconds, got 0.05'); + $this->expectExceptionMessageIsOrContains('Heartbeat interval must be at least 0.1 seconds, got 0.05'); config_builder()->heartbeat(new RecordingHeartbeat(), everySeconds: 0.05); } @@ -304,7 +304,7 @@ public function test_a_heartbeat_to_the_parent_assigns_no_id_and_logs_its_failur public function test_a_heartbeat_after_a_heartbeat_to_the_parent_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'heartbeat() and heartbeatToParent() cannot be mixed on one ConfigBuilder. A worker reports to its parent through heartbeatToParent() only. Register every other heartbeat in the parent.', ); @@ -316,7 +316,7 @@ public function test_a_heartbeat_after_a_heartbeat_to_the_parent_is_refused(): v public function test_a_heartbeat_to_the_parent_after_a_heartbeat_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'heartbeat() and heartbeatToParent() cannot be mixed on one ConfigBuilder. A worker reports to its parent through heartbeatToParent() only. Register every other heartbeat in the parent.', ); diff --git a/src/core/etl/tests/Flow/ETL/Tests/Integration/DataFrame/ConstraintTest.php b/src/core/etl/tests/Flow/ETL/Tests/Integration/DataFrame/ConstraintTest.php index 650513d054..e1fdb1cc71 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Integration/DataFrame/ConstraintTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Integration/DataFrame/ConstraintTest.php @@ -33,7 +33,7 @@ public function test_sorted_ascending_integers(): void public function test_sorted_ascending_integers_violation(): void { $this->expectException(ConstraintViolationException::class); - $this->expectExceptionMessage('Constraint violation: Sorted constraint on [id ASC]'); + $this->expectExceptionMessageIsOrContains('Constraint violation: Sorted constraint on [id ASC]'); df() ->read(from_array([ @@ -77,7 +77,7 @@ public function test_sorted_descending_floats(): void public function test_sorted_descending_violation(): void { $this->expectException(ConstraintViolationException::class); - $this->expectExceptionMessage('Constraint violation: Sorted constraint on [price DESC]'); + $this->expectExceptionMessageIsOrContains('Constraint violation: Sorted constraint on [price DESC]'); df() ->read(from_array([ @@ -115,7 +115,9 @@ public function test_sorted_multiple_columns(): void public function test_sorted_multiple_columns_violation(): void { $this->expectException(ConstraintViolationException::class); - $this->expectExceptionMessage('Constraint violation: Sorted constraint on [category ASC, price DESC]'); + $this->expectExceptionMessageIsOrContains( + 'Constraint violation: Sorted constraint on [category ASC, price DESC]', + ); df() ->read(from_array([ @@ -225,7 +227,7 @@ public function test_unique_frame_passes_a_second_run(): void public function test_unique_on_multiple_fields(): void { $this->expectException(ConstraintViolationException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Constraint violation: Unique constraint on [id, sub_id] - Values: [id = 4, sub_id = 4] in row: 5', ); diff --git a/src/core/etl/tests/Flow/ETL/Tests/Integration/DataFrame/EmptySourceTest.php b/src/core/etl/tests/Flow/ETL/Tests/Integration/DataFrame/EmptySourceTest.php index 2bce9b4179..333892b3f5 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Integration/DataFrame/EmptySourceTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Integration/DataFrame/EmptySourceTest.php @@ -21,7 +21,7 @@ final class EmptySourceTest extends FlowIntegrationTestCase public function test_from_all_without_extractors_refuses_to_infer(): void { $this->expectException(InferredSchemaException::class); - $this->expectExceptionMessage('from_all() has nothing to infer a schema from: it chains no extractor. Declare the schema with ' + $this->expectExceptionMessageIsOrContains('from_all() has nothing to infer a schema from: it chains no extractor. Declare the schema with ' . '->withSchema(...).'); df() @@ -55,7 +55,7 @@ public function test_from_all_over_an_empty_array_reads_nothing_under_a_declared public function test_from_array_without_rows_refuses_to_infer(): void { $this->expectException(InferredSchemaException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'from_array() has nothing to infer a schema from: no row carries a column. Declare the schema with ' . '->withSchema(...).', ); diff --git a/src/core/etl/tests/Flow/ETL/Tests/Integration/DataFrame/FilterTest.php b/src/core/etl/tests/Flow/ETL/Tests/Integration/DataFrame/FilterTest.php index 39b7f8aa83..1e09b63252 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Integration/DataFrame/FilterTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Integration/DataFrame/FilterTest.php @@ -97,7 +97,7 @@ public function test_an_int_column_equals_a_numeric_string_and_a_float(): void public function test_a_string_that_does_not_cast_to_an_int_column_throws(): void { $this->expectException(EvaluationException::class); - $this->expectExceptionMessage('value \'x\' cannot be cast to integer'); + $this->expectExceptionMessageIsOrContains('value \'x\' cannot be cast to integer'); df() ->read(from_array([['id' => 1]])) diff --git a/src/core/etl/tests/Flow/ETL/Tests/Integration/DataFrame/JoinTest.php b/src/core/etl/tests/Flow/ETL/Tests/Integration/DataFrame/JoinTest.php index e1851d3ded..9cf9571a85 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Integration/DataFrame/JoinTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Integration/DataFrame/JoinTest.php @@ -562,7 +562,7 @@ public function test_an_int_key_joins_a_string_key_through_a_cast(): void public function test_a_string_key_that_does_not_cast_to_the_int_key_throws(): void { $this->expectException(EvaluationException::class); - $this->expectExceptionMessage('value \'x\' cannot be cast to integer'); + $this->expectExceptionMessageIsOrContains('value \'x\' cannot be cast to integer'); df() ->read(from_rows(array_to_rows([['id' => 1]], schema(int_schema('id'))))) diff --git a/src/core/etl/tests/Flow/ETL/Tests/Integration/DataFrame/LimitTest.php b/src/core/etl/tests/Flow/ETL/Tests/Integration/DataFrame/LimitTest.php index e3dd14a903..8372e9e713 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Integration/DataFrame/LimitTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Integration/DataFrame/LimitTest.php @@ -76,7 +76,7 @@ public function test_fetch_with_limit(): void public function test_fetch_with_limit_below_0(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage("Limit can't be lower or equal zero, given: -1"); + $this->expectExceptionMessageIsOrContains("Limit can't be lower or equal zero, given: -1"); df()->read(from_rows(rows(schema())))->fetch(-1); } @@ -163,7 +163,7 @@ public function isRepeatable(): bool public function test_limit_below_0(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage("Limit can't be lower or equal zero, given: -1"); + $this->expectExceptionMessageIsOrContains("Limit can't be lower or equal zero, given: -1"); df() ->read(from_rows(rows(schema()))) diff --git a/src/core/etl/tests/Flow/ETL/Tests/Integration/DataFrame/OffsetTest.php b/src/core/etl/tests/Flow/ETL/Tests/Integration/DataFrame/OffsetTest.php index 918c385533..79b408327b 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Integration/DataFrame/OffsetTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Integration/DataFrame/OffsetTest.php @@ -56,7 +56,7 @@ public function test_limit_with_offset(): void public function test_offset_constructor_with_negative_offset(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Offset must be greater than or equal to 0, given: -1'); + $this->expectExceptionMessageIsOrContains('Offset must be greater than or equal to 0, given: -1'); // @mago-ignore analysis:invalid-argument df() ->read(from_rows(rows(schema()))) diff --git a/src/core/etl/tests/Flow/ETL/Tests/Integration/DataFrame/PartitioningTest.php b/src/core/etl/tests/Flow/ETL/Tests/Integration/DataFrame/PartitioningTest.php index f539219ff8..19f553bcaa 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Integration/DataFrame/PartitioningTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Integration/DataFrame/PartitioningTest.php @@ -122,7 +122,9 @@ public static function file_listings(): Generator public function test_a_partition_value_that_is_not_a_date_fails_a_date_filter(): void { $this->expectException(EvaluationException::class); - $this->expectExceptionMessage('Cast function failed: Can\'t cast "string" into "date" type (row 0)'); + $this->expectExceptionMessageIsOrContains( + 'Cast function failed: Can\'t cast "string" into "date" type (row 0)', + ); df() ->read(from_floe($this->cacheDir->path() . '/multi_partitioned/year=*/month=*/day=*/*.floe')) diff --git a/src/core/etl/tests/Flow/ETL/Tests/Integration/DataFrame/PlanBindTest.php b/src/core/etl/tests/Flow/ETL/Tests/Integration/DataFrame/PlanBindTest.php index 2afa773bfe..fb4c6fddb0 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Integration/DataFrame/PlanBindTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Integration/DataFrame/PlanBindTest.php @@ -202,7 +202,7 @@ public function test_an_incomparable_column_pair_is_refused_at_bind(): void $extractor = new CountingExtractor(schema(int_schema('a'), datetime_schema('b'))); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('due to data type mismatch - an explicit cast is required'); + $this->expectExceptionMessageIsOrContains('due to data type mismatch - an explicit cast is required'); try { df() @@ -219,7 +219,7 @@ public function test_an_unresolved_column_is_refused_at_bind(): void $extractor = new CountingExtractor(schema(int_schema('a'), int_schema('b'))); $this->expectException(SchemaDefinitionNotFoundException::class); - $this->expectExceptionMessage('Schema definition for column "nope" not found'); + $this->expectExceptionMessageIsOrContains('Schema definition for column "nope" not found'); try { df()->read($extractor)->select('nope')->fetch(); @@ -266,7 +266,7 @@ public function test_both_orderings_refuse_the_undeclared_path_segment(): void public function test_a_discovering_pivot_over_a_non_repeatable_source_is_refused(): void { $this->expectException(SchemaNotDerivableException::class); - $this->expectExceptionMessage('cannot read its dataset twice'); + $this->expectExceptionMessageIsOrContains('cannot read its dataset twice'); df() ->read(new RepeatableExtractor(false)) @@ -277,7 +277,7 @@ public function test_a_discovering_pivot_over_a_non_repeatable_source_is_refused public function test_a_discovering_pivot_over_a_join_with_a_non_repeatable_side_is_refused(): void { $this->expectException(SchemaNotDerivableException::class); - $this->expectExceptionMessage('cannot read its dataset twice'); + $this->expectExceptionMessageIsOrContains('cannot read its dataset twice'); df() ->read(from_array([['k' => 'a', 'v' => 1], ['k' => 'b', 'v' => 2]])) diff --git a/src/core/etl/tests/Flow/ETL/Tests/Integration/DataFrame/SinglePlanTest.php b/src/core/etl/tests/Flow/ETL/Tests/Integration/DataFrame/SinglePlanTest.php index f3a44e4781..89aa068eaf 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Integration/DataFrame/SinglePlanTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Integration/DataFrame/SinglePlanTest.php @@ -87,7 +87,7 @@ public function test_a_joined_frames_own_error_handler_is_ignored(): void ->onError(new IgnoreError()); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('right boom'); + $this->expectExceptionMessageIsOrContains('right boom'); df() ->read(from_array([['id' => 1]])) diff --git a/src/core/etl/tests/Flow/ETL/Tests/Integration/DataFrame/TemporalStringComparisonTest.php b/src/core/etl/tests/Flow/ETL/Tests/Integration/DataFrame/TemporalStringComparisonTest.php index f102027c21..a1b5200b2f 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Integration/DataFrame/TemporalStringComparisonTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Integration/DataFrame/TemporalStringComparisonTest.php @@ -64,7 +64,9 @@ public function test_a_string_column_is_compared_as_a_datetime(): void public function test_a_string_that_is_not_a_date_fails_the_evaluation(): void { $this->expectException(EvaluationException::class); - $this->expectExceptionMessage('Cast function failed: Can\'t cast "string" into "datetime" type (row 0)'); + $this->expectExceptionMessageIsOrContains( + 'Cast function failed: Can\'t cast "string" into "datetime" type (row 0)', + ); df() ->read(from_array( diff --git a/src/core/etl/tests/Flow/ETL/Tests/Integration/DataFrame/TransformedBranchBlockingOperationsTest.php b/src/core/etl/tests/Flow/ETL/Tests/Integration/DataFrame/TransformedBranchBlockingOperationsTest.php index 6317ac1922..5016fda39d 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Integration/DataFrame/TransformedBranchBlockingOperationsTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Integration/DataFrame/TransformedBranchBlockingOperationsTest.php @@ -140,7 +140,7 @@ public function test_constrain_inside_a_transformation_accumulates_across_batche new CallbackTransformation(static fn(DataFrame $df): DataFrame => $df->constrain(constraint_unique('g'))); $this->expectException(ConstraintViolationException::class); - $this->expectExceptionMessage('in row: 2'); + $this->expectExceptionMessageIsOrContains('in row: 2'); df() ->read(from_rows(...RowsMother::interleavedGroupBatches())) diff --git a/src/core/etl/tests/Flow/ETL/Tests/Integration/Functions/ArrayKeysStyleConvertTest.php b/src/core/etl/tests/Flow/ETL/Tests/Integration/Functions/ArrayKeysStyleConvertTest.php index 928d1a705e..517906bafb 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Integration/Functions/ArrayKeysStyleConvertTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Integration/Functions/ArrayKeysStyleConvertTest.php @@ -42,7 +42,7 @@ public function test_array_keys_style_convert(): void public function test_array_keys_style_convert_in_strict_mode(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Expected type "array", got "string".'); + $this->expectExceptionMessageIsOrContains('Expected type "array", got "string".'); new FunctionContext(flow_context(config()))->eval( array_keys_style_convert(ref('string'), 'camel'), diff --git a/src/core/etl/tests/Flow/ETL/Tests/Integration/IO/Extractor/CacheExtractorTest.php b/src/core/etl/tests/Flow/ETL/Tests/Integration/IO/Extractor/CacheExtractorTest.php index 905bdb60e4..0b09024d88 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Integration/IO/Extractor/CacheExtractorTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Integration/IO/Extractor/CacheExtractorTest.php @@ -233,7 +233,7 @@ public function test_fallback_extractor(): void public function test_schema_is_not_derivable_without_a_cache_instance(): void { $this->expectException(SchemaNotDerivableException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Flow\\ETL\\IO\\Extractor\\CacheExtractor cannot describe what it will produce before producing it: no cache was ' . 'handed to from_cache(), and the one in the FlowContext is known only when the pipeline runs. Declare the ' . 'schema with ->withSchema().', @@ -245,7 +245,7 @@ public function test_schema_is_not_derivable_without_a_cache_instance(): void public function test_schema_refuses_to_infer_when_the_injected_cache_does_not_hold_the_id(): void { $this->expectException(InferredSchemaException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'from_cache() has nothing to infer a schema from: the cache holds no entry "non_existing_cache_key" and ' . 'no fallback extractor is set. Declare the schema with ->withSchema(...).', ); diff --git a/src/core/etl/tests/Flow/ETL/Tests/Integration/IO/Extractor/FileSourceFilesystemTest.php b/src/core/etl/tests/Flow/ETL/Tests/Integration/IO/Extractor/FileSourceFilesystemTest.php index bcd9ab55da..8b8abbbe19 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Integration/IO/Extractor/FileSourceFilesystemTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Integration/IO/Extractor/FileSourceFilesystemTest.php @@ -32,7 +32,7 @@ final class FileSourceFilesystemTest extends FlowIntegrationTestCase public function test_every_family_rejects_a_path_its_filesystem_does_not_serve(array $dsl): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Filesystem Flow\Filesystem\Local\NativeLocalFilesystem serves "file://" paths, ' . 'given: "aws-s3://bucket/orders.dat".', ); diff --git a/src/core/etl/tests/Flow/ETL/Tests/Integration/IO/Filesystem/ConfigIsolationTest.php b/src/core/etl/tests/Flow/ETL/Tests/Integration/IO/Filesystem/ConfigIsolationTest.php index 2f9317d35f..c9e84e9753 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Integration/IO/Filesystem/ConfigIsolationTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Integration/IO/Filesystem/ConfigIsolationTest.php @@ -111,7 +111,9 @@ public function test_save_mode_does_not_leak_from_one_data_frame_to_the_next(): $this->fs()->writeTo($destination)->append('pre-existing')->close(); - $this->expectExceptionMessage('already exists, please change path to different or set different SaveMode'); + $this->expectExceptionMessageIsOrContains( + 'already exists, please change path to different or set different SaveMode', + ); data_frame($config) ->read(from_array([['id' => 2]])) diff --git a/src/core/etl/tests/Flow/ETL/Tests/Integration/IO/Filesystem/FileWritePropertiesTest.php b/src/core/etl/tests/Flow/ETL/Tests/Integration/IO/Filesystem/FileWritePropertiesTest.php index f193d52aab..74094571e5 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Integration/IO/Filesystem/FileWritePropertiesTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Integration/IO/Filesystem/FileWritePropertiesTest.php @@ -104,7 +104,7 @@ public function test_save_mode_is_per_loader(): void ->run(); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('already exists'); + $this->expectExceptionMessageIsOrContains('already exists'); // the first loader overwrites, the second must still refuse - the mode does not leak between them df() @@ -119,7 +119,7 @@ public function test_two_distinct_loaders_on_one_path_throw(): void $destination = $this->cacheDir->suffix('two-loaders.floe'); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('already exists'); + $this->expectExceptionMessageIsOrContains('already exists'); df() ->read(from_array([['id' => 1]])) diff --git a/src/core/etl/tests/Flow/ETL/Tests/Integration/IO/Floe/FloeExtractorTest.php b/src/core/etl/tests/Flow/ETL/Tests/Integration/IO/Floe/FloeExtractorTest.php index 528daed6c3..3311158676 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Integration/IO/Floe/FloeExtractorTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Integration/IO/Floe/FloeExtractorTest.php @@ -128,7 +128,7 @@ public function test_a_declared_schema_skips_the_divergence_check(): void public function test_a_glob_without_files_refuses_to_infer(): void { $this->expectException(InferredSchemaException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'from_floe() has nothing to infer a schema from: no file matching "' . $this->cacheDir->suffix('**/*.floe')->uri() . '" carries a column. Declare the schema with ->withSchema(...).', diff --git a/src/core/etl/tests/Flow/ETL/Tests/Integration/IO/Loader/File/FileCommit/FileCommitTest.php b/src/core/etl/tests/Flow/ETL/Tests/Integration/IO/Loader/File/FileCommit/FileCommitTest.php index e0af4b3b39..fce46dbbeb 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Integration/IO/Loader/File/FileCommit/FileCommitTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Integration/IO/Loader/File/FileCommit/FileCommitTest.php @@ -187,7 +187,7 @@ public function test_abort_after_a_commit_does_nothing(): void public function test_open_two_write_streams_to_stdout(): void { - $this->expectExceptionMessage('Only one stream can be open at the same time for php://stdout'); + $this->expectExceptionMessageIsOrContains('Only one stream can be open at the same time for php://stdout'); // one instance: StdOutFilesystem holds its open targets per instance $stdout = stdout_filesystem(); diff --git a/src/core/etl/tests/Flow/ETL/Tests/Integration/IO/Loader/File/FileCommit/Partitioned/PartitionPlaceholdersTest.php b/src/core/etl/tests/Flow/ETL/Tests/Integration/IO/Loader/File/FileCommit/Partitioned/PartitionPlaceholdersTest.php index 75a690cfb5..5c7a403587 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Integration/IO/Loader/File/FileCommit/Partitioned/PartitionPlaceholdersTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Integration/IO/Loader/File/FileCommit/Partitioned/PartitionPlaceholdersTest.php @@ -162,7 +162,7 @@ public function test_write_to_placeholder_path_without_partitions(): void $file = $this->context->path(__FUNCTION__ . '/{order-name}.csv'); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('contains partition placeholders but rows are not partitioned'); + $this->expectExceptionMessageIsOrContains('contains partition placeholders but rows are not partitioned'); $this->context->commit($file, exception_if_exists())->open(); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Integration/Pipeline/PipelineTest.php b/src/core/etl/tests/Flow/ETL/Tests/Integration/Pipeline/PipelineTest.php index ed36cf72b1..f0d1f35890 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Integration/Pipeline/PipelineTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Integration/Pipeline/PipelineTest.php @@ -28,7 +28,7 @@ public function test_a_join_each_plan_refuses_to_describe_its_output(): void ], 'r_')); $this->expectException(DataDependentSchemaException::class); - $this->expectExceptionMessage('JoinEachRowsTransformer'); + $this->expectExceptionMessageIsOrContains('JoinEachRowsTransformer'); $frame->schema(); } @@ -53,7 +53,9 @@ public function test_a_cycle_closed_on_a_later_batch_is_refused_when_run(): void $transformer->readBackFrom($frame); $this->expectException(InvalidLogicException::class); - $this->expectExceptionMessage('Cannot run this plan: it reads from a DataFrame that reads back from it.'); + $this->expectExceptionMessageIsOrContains( + 'Cannot run this plan: it reads from a DataFrame that reads back from it.', + ); $frame->fetch(); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Integration/Storage/Floe/FloeWriteContractTest.php b/src/core/etl/tests/Flow/ETL/Tests/Integration/Storage/Floe/FloeWriteContractTest.php index 58ffc8be88..a02699e90b 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Integration/Storage/Floe/FloeWriteContractTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Integration/Storage/Floe/FloeWriteContractTest.php @@ -132,7 +132,7 @@ public function test_a_batch_omitting_a_not_null_column_is_refused(): void $writer->write(array_to_rows([['id' => 1, 'name' => 'a']], schema(int_schema('id'), str_schema('name')))); $this->expectException(IncompatibleSchemaException::class); - $this->expectExceptionMessage('Missing Definitions'); + $this->expectExceptionMessageIsOrContains('Missing Definitions'); $writer->write(array_to_rows([['id' => 2]], schema(int_schema('id')))); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Integration/Window/WindowFunctionsTest.php b/src/core/etl/tests/Flow/ETL/Tests/Integration/Window/WindowFunctionsTest.php index 913d1c02e9..a67858e370 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Integration/Window/WindowFunctionsTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Integration/Window/WindowFunctionsTest.php @@ -89,7 +89,7 @@ public function test_a_window_aggregate_of_a_missing_column_is_rejected_before_i AggregatingFunction&WindowFunction $function, ): void { $this->expectException(SchemaDefinitionNotFoundException::class); - $this->expectExceptionMessage('Schema definition for column "missing" not found.'); + $this->expectExceptionMessageIsOrContains('Schema definition for column "missing" not found.'); data_frame() ->read(from_array([['id' => 1], ['id' => 2]])) diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/API/Config/Bucketing/BucketingConfigBuilderTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/API/Config/Bucketing/BucketingConfigBuilderTest.php index 926c274a9f..10c51c1d97 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/API/Config/Bucketing/BucketingConfigBuilderTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/API/Config/Bucketing/BucketingConfigBuilderTest.php @@ -22,7 +22,7 @@ final class BucketingConfigBuilderTest extends FlowTestCase public function test_batch_size_below_one_is_rejected(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Batch size must be at least 1'); + $this->expectExceptionMessageIsOrContains('Batch size must be at least 1'); // @mago-ignore analysis:invalid-argument new BucketingConfigBuilder('/flow-php-join/', 64)->batchSize(0); @@ -42,7 +42,7 @@ public function test_buckets_count_and_batch_size_are_set(): void public function test_buckets_count_below_one_is_rejected(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Buckets count must be greater than 0'); + $this->expectExceptionMessageIsOrContains('Buckets count must be greater than 0'); // @mago-ignore analysis:invalid-argument new BucketingConfigBuilder('/flow-php-join/', 64)->bucketsCount(0); @@ -92,7 +92,7 @@ public function test_memory_limit_is_set(): void public function test_memory_limit_below_one_byte_is_rejected(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Bucketing memory limit must be greater than 0 bytes'); + $this->expectExceptionMessageIsOrContains('Bucketing memory limit must be greater than 0 bytes'); new BucketingConfigBuilder('/flow-php-join/', 64)->memoryLimit(Unit::fromBytes(0)); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/API/Config/Join/HashJoinBuilderTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/API/Config/Join/HashJoinBuilderTest.php index c4374beac3..3680584be7 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/API/Config/Join/HashJoinBuilderTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/API/Config/Join/HashJoinBuilderTest.php @@ -69,7 +69,7 @@ public function test_default_builds_a_filesystem_buckets_storage(): void public function test_memory_limit_below_one_byte_is_rejected(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Bucketing memory limit must be greater than 0 bytes'); + $this->expectExceptionMessageIsOrContains('Bucketing memory limit must be greater than 0 bytes'); hash_join()->memoryLimit(Unit::fromBytes(0)); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/API/Config/Sort/ExternalSortBuilderTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/API/Config/Sort/ExternalSortBuilderTest.php index cc18c39c69..fa5f2c2db0 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/API/Config/Sort/ExternalSortBuilderTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/API/Config/Sort/ExternalSortBuilderTest.php @@ -65,7 +65,7 @@ public function test_injected_storage_wins_over_the_default(): void public function test_memory_limit_below_one_byte_is_rejected(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Bucketing memory limit must be greater than 0 bytes'); + $this->expectExceptionMessageIsOrContains('Bucketing memory limit must be greater than 0 bytes'); external_sort()->memoryLimit(Unit::fromBytes(0)); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/API/DataFrameTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/API/DataFrameTest.php index 8a140ecc68..6240f91d71 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/API/DataFrameTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/API/DataFrameTest.php @@ -226,7 +226,7 @@ public function test_drop(): void public function test_duplicate_row_refuses_a_definition_name(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'duplicateRow() takes a column name and a scalar function. ' . 'Add a typed or window column with withColumn() first, then duplicate rows.', ); @@ -240,7 +240,7 @@ public function test_duplicate_row_refuses_a_definition_name(): void public function test_duplicate_row_refuses_a_window_function(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'duplicateRow() takes a column name and a scalar function. ' . 'Add a typed or window column with withColumn() first, then duplicate rows.', ); @@ -1171,7 +1171,7 @@ public function test_on_error_on_one_frame_leaves_a_frame_over_the_same_flow_con ->run(); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('boom'); + $this->expectExceptionMessageIsOrContains('boom'); $other->with(new ThrowingTransformer(new RuntimeException('boom')))->run(); } @@ -1188,7 +1188,7 @@ public function test_on_error_on_one_frame_leaves_a_frame_built_from_the_same_co ->run(); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('boom'); + $this->expectExceptionMessageIsOrContains('boom'); $other->with(new ThrowingTransformer(new RuntimeException('boom')))->run(); } @@ -1296,7 +1296,7 @@ public function test_a_branch_without_on_error_writes_its_rows(): void public function test_on_error_inside_a_branchs_transformation_is_refused(): void { $this->expectException(InvalidLogicException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'A branch must return a frame built from the prefix it was given: ' . TransformedBranch::class . ' returned another frame. Build on $prefix, and call onError() on the frame you write to, not inside ' @@ -1317,7 +1317,7 @@ public function test_on_error_inside_a_branchs_transformation_is_refused(): void public function test_a_branch_returning_a_frame_not_built_from_its_prefix_is_refused(): void { $this->expectException(InvalidLogicException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'A branch must return a frame built from the prefix it was given: ' . TransformedBranch::class . ' returned another frame. Build on $prefix, and call onError() on the frame you write to, not inside ' @@ -1596,7 +1596,7 @@ public function test_run_with_analyze_counts_the_rows(): void public function test_cache_refuses_a_batch_size_below_one(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Cache batch size must be greater than 0'); + $this->expectExceptionMessageIsOrContains('Cache batch size must be greater than 0'); df() ->read(from_array([['id' => 1]])) @@ -1607,7 +1607,7 @@ public function test_cache_refuses_a_batch_size_below_one(): void public function test_cache_refuses_an_empty_id(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Cache id must not be an empty string, pass null to use the run id'); + $this->expectExceptionMessageIsOrContains('Cache id must not be an empty string, pass null to use the run id'); df() ->read(from_array([['id' => 1]])) @@ -1630,7 +1630,7 @@ public function test_join_takes_the_join_type_as_a_string(): void public function test_join_each_refuses_an_unsupported_join_type(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Unsupported join type'); + $this->expectExceptionMessageIsOrContains('Unsupported join type'); df() ->read(from_array([['id' => 1]])) @@ -1660,7 +1660,7 @@ public function test_an_error_handler_set_after_join_does_not_reach_the_joined_f $right->onError(new IgnoreError())->fetch(); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('right boom'); + $this->expectExceptionMessageIsOrContains('right boom'); $left->fetch(); } @@ -1675,7 +1675,7 @@ public function test_an_error_handler_set_after_cross_join_does_not_reach_the_jo $right->onError(new IgnoreError())->fetch(); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('right boom'); + $this->expectExceptionMessageIsOrContains('right boom'); $left->fetch(); } @@ -1902,7 +1902,7 @@ public function test_on_error_returns_another_frame_and_the_original_keeps_its_h $guarded->run(); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('boom'); + $this->expectExceptionMessageIsOrContains('boom'); $df->run(); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/API/GroupedDataFrameTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/API/GroupedDataFrameTest.php index 4a403b05f5..b88bec0876 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/API/GroupedDataFrameTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/API/GroupedDataFrameTest.php @@ -27,7 +27,7 @@ final class GroupedDataFrameTest extends FlowTestCase public function test_a_grouped_aggregate_without_aggregations_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage("Aggregations can't be empty"); + $this->expectExceptionMessageIsOrContains("Aggregations can't be empty"); df() ->read(from_array([['a' => 1]])) @@ -38,7 +38,7 @@ public function test_a_grouped_aggregate_without_aggregations_is_refused(): void public function test_a_frame_aggregate_without_aggregations_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage("Aggregations can't be empty"); + $this->expectExceptionMessageIsOrContains("Aggregations can't be empty"); df() ->read(from_array([['a' => 1]])) @@ -69,7 +69,7 @@ public function test_aggregate_by_places_the_given_group_by(): void public function test_discovered_pivot_values_refuse_a_source_that_cannot_be_read_twice(): void { $this->expectException(SchemaNotDerivableException::class); - $this->expectExceptionMessage('cannot read its dataset twice'); + $this->expectExceptionMessageIsOrContains('cannot read its dataset twice'); df() ->read(new RowLessExtractor(schema(str_schema('country'), str_schema('code')))) diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/API/TransactionalTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/API/TransactionalTest.php index 25e5960df6..d7b7e96cca 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/API/TransactionalTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/API/TransactionalTest.php @@ -137,7 +137,7 @@ public function test_children_run_in_write_call_order_inside_one_transaction(): public function test_a_transaction_without_a_write_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('At least one write must be provided'); + $this->expectExceptionMessageIsOrContains('At least one write must be provided'); new Transactional(new RecordingTransaction()); } @@ -156,7 +156,7 @@ public function test_a_transaction_directly_inside_a_transaction_is_a_type_error public function test_a_transaction_inside_a_branch_inside_a_transaction_is_refused(): void { $this->expectException(InvalidLogicException::class); - $this->expectExceptionMessage('A transaction cannot contain another transaction'); + $this->expectExceptionMessageIsOrContains('A transaction cannot contain another transaction'); df() ->read(from_array([['id' => 1]])) diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/API/Transformation/AggregateTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/API/Transformation/AggregateTest.php index 274d225f79..92dea72725 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/API/Transformation/AggregateTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/API/Transformation/AggregateTest.php @@ -64,7 +64,7 @@ public function test_aggregate_after_group_by(): void public function test_aggregate_after_group_by_refuses_an_algorithm(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'aggregate() after group_by() takes no bucketing algorithm. Pass it to group_by() instead.', ); diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/API/Transformation/BatchByTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/API/Transformation/BatchByTest.php index 7f405aee13..21a7f75d4f 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/API/Transformation/BatchByTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/API/Transformation/BatchByTest.php @@ -56,7 +56,7 @@ public function test_invoking_batch_by_gives_the_rows_of_with(): void public function test_a_minimum_size_below_one_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Minimum batch size must be greater than 0, given: 0'); + $this->expectExceptionMessageIsOrContains('Minimum batch size must be greater than 0, given: 0'); // @mago-ignore analysis:invalid-argument batch_by('order_id', 0); diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Comparator/ColumnComparatorTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Comparator/ColumnComparatorTest.php index bbfe7e9895..82123eaa05 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Comparator/ColumnComparatorTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Comparator/ColumnComparatorTest.php @@ -44,7 +44,7 @@ public function test_different_values_fail(): void $comparator->setFactory(Factory::getInstance()); $this->expectException(ComparisonFailure::class); - $this->expectExceptionMessage('Failed asserting that two columns are equal.'); + $this->expectExceptionMessageIsOrContains('Failed asserting that two columns are equal.'); $comparator->assertEquals( new PhpBackend()->constant(int_schema('a'), 1, 2), @@ -58,7 +58,7 @@ public function test_different_types_fail(): void $comparator->setFactory(Factory::getInstance()); $this->expectException(ComparisonFailure::class); - $this->expectExceptionMessage('Failed asserting that two columns have the same type.'); + $this->expectExceptionMessageIsOrContains('Failed asserting that two columns have the same type.'); $comparator->assertEquals(ColumnMother::of(int_schema('a'), [1]), ColumnMother::of(str_schema('a'), ['1'])); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Comparator/RowsComparatorTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Comparator/RowsComparatorTest.php index 793031d5c1..e4cb7c0a77 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Comparator/RowsComparatorTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Comparator/RowsComparatorTest.php @@ -64,7 +64,7 @@ public function test_a_schema_difference_fails(): void $comparator->setFactory(Factory::getInstance()); $this->expectException(ComparisonFailure::class); - $this->expectExceptionMessage('Failed asserting that two Rows have the same schema.'); + $this->expectExceptionMessageIsOrContains('Failed asserting that two Rows have the same schema.'); $comparator->assertEquals( array_to_rows([['id' => 1]], schema(int_schema('id'))), diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Context/CacheDirContextTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Context/CacheDirContextTest.php index 3fc9d5b277..875b5e558a 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Context/CacheDirContextTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Context/CacheDirContextTest.php @@ -19,7 +19,7 @@ final class CacheDirContextTest extends FlowTestCase public function test_the_filesystem_root_is_refused(string $cacheDir): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Refusing to run integration tests with cache dir resolved to "/" — would delete root.', ); @@ -29,7 +29,7 @@ public function test_the_filesystem_root_is_refused(string $cacheDir): void public function test_the_current_working_directory_is_refused(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Refusing to run integration tests with cache dir equal to the current working directory ("' . (string) getcwd() . '"). Set FLOW_LOCAL_FILESYSTEM_CACHE_DIR to a dedicated temp directory.', diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/DSL/ArrayToRowsTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/DSL/ArrayToRowsTest.php index a49077db99..52b8e62e1e 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/DSL/ArrayToRowsTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/DSL/ArrayToRowsTest.php @@ -59,7 +59,7 @@ public function test_building_array_to_rows_with_column_that_is_list_of_strings_ public function test_refuses_an_undeclared_key_of_a_single_flat_row(): void { $this->expectException(SchemaMismatchException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Rows do not match their schema: column "phase" (row 0) is not declared by the schema', ); @@ -113,7 +113,7 @@ public function test_building_rows_from_array(): void public function test_refuses_an_undeclared_key(): void { $this->expectException(SchemaMismatchException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Rows do not match their schema: column "nmae" (row 1) is not declared by the schema', ); @@ -165,7 +165,7 @@ public function test_a_numeric_key_is_the_declared_column_of_that_name(): void public function test_refuses_an_undeclared_numeric_key_under_its_positional_name(): void { $this->expectException(SchemaMismatchException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Rows do not match their schema: column "e07" (row 0) is not declared by the schema', ); diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/DSL/DateIntervalFunctionsTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/DSL/DateIntervalFunctionsTest.php index fed912e3e0..7b1bb73595 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/DSL/DateIntervalFunctionsTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/DSL/DateIntervalFunctionsTest.php @@ -96,7 +96,7 @@ public function test_converting_relative_date_intervals_to_microseconds( DateInterval $interval, string $exceptionMessage, ): void { - $this->expectExceptionMessage($exceptionMessage); + $this->expectExceptionMessageIsOrContains($exceptionMessage); date_interval_to_microseconds($interval); } @@ -112,7 +112,7 @@ public function test_converting_relative_date_intervals_to_milliseconds( DateInterval $interval, string $exceptionMessage, ): void { - $this->expectExceptionMessage($exceptionMessage); + $this->expectExceptionMessageIsOrContains($exceptionMessage); date_interval_to_milliseconds($interval); } @@ -122,7 +122,7 @@ public function test_converting_relative_date_intervals_to_seconds( DateInterval $interval, string $exceptionMessage, ): void { - $this->expectExceptionMessage($exceptionMessage); + $this->expectExceptionMessageIsOrContains($exceptionMessage); date_interval_to_seconds($interval); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/DSL/DefinitionFromTypeTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/DSL/DefinitionFromTypeTest.php index 9ceaa7b0e6..0ec12a8069 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/DSL/DefinitionFromTypeTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/DSL/DefinitionFromTypeTest.php @@ -57,7 +57,7 @@ public function test_an_optional_null_type_yields_a_null_definition(): void public function test_definition_from_type_refuses_an_empty_array_type(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Column "tags" cannot be typed as array{} - an empty array is a value, not a column type. ' . 'Declare the element type, e.g. type_list(type_string()).', ); @@ -68,7 +68,7 @@ public function test_definition_from_type_refuses_an_empty_array_type(): void public function test_definition_from_type_names_the_column_it_was_given_as_a_reference(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Column "labels" cannot be typed as array{}'); + $this->expectExceptionMessageIsOrContains('Column "labels" cannot be typed as array{}'); definition_from_type(ref('labels'), type_empty_array()); } @@ -84,7 +84,7 @@ public function test_definition_from_type_reduces_an_optional_union_to_a_nullabl public function test_definition_from_type_refuses_a_non_optional_union(): void { $this->expectException(UnsupportedUnionTypeException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Column "value" cannot be typed as "integer|string": a column holds exactly one type.' . "\n" . 'Only "null|T" is a valid union - that is a nullable column.' diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Calculator/CalculatorTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Calculator/CalculatorTest.php index 6dedf5fd50..0849a26fb7 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Calculator/CalculatorTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Calculator/CalculatorTest.php @@ -41,7 +41,7 @@ public function test_modulus_refuses_a_negative_modulus_for_ints_as_for_strings( static::assertSame(1, $calculator->modulus(7, 3)); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Modulus must not be negative, got "-3".'); + $this->expectExceptionMessageIsOrContains('Modulus must not be negative, got "-3".'); $calculator->modulus($a, $b); } @@ -118,7 +118,7 @@ public function test_divide_always_yields_float(int|float $a, int|float $b, floa public function test_divide_by_zero(): void { $this->expectException(DivisionByZeroError::class); - $this->expectExceptionMessage('Division by zero'); + $this->expectExceptionMessageIsOrContains('Division by zero'); new Calculator()->divide(1, 0); } @@ -126,7 +126,7 @@ public function test_divide_by_zero(): void public function test_divide_by_zero_with_a_scale_and_a_rounding(): void { $this->expectException(DivisionByZeroError::class); - $this->expectExceptionMessage('Division by zero.'); + $this->expectExceptionMessageIsOrContains('Division by zero.'); new Calculator()->divide(1, 0, 2, Rounding::HALF_UP); } @@ -151,7 +151,7 @@ public function test_modulus_of_a_numeric_string_beyond_the_int_range(): void public function test_divide_by_zero_as_float(): void { $this->expectException(DivisionByZeroError::class); - $this->expectExceptionMessage('Division by zero'); + $this->expectExceptionMessageIsOrContains('Division by zero'); new Calculator()->divide(1, 0.0); } @@ -159,7 +159,7 @@ public function test_divide_by_zero_as_float(): void public function test_divide_by_zero_as_string(): void { $this->expectException(DivisionByZeroError::class); - $this->expectExceptionMessage('Division by zero'); + $this->expectExceptionMessageIsOrContains('Division by zero'); new Calculator()->divide(1, '0'); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Calculator/NumberNormalizerTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Calculator/NumberNormalizerTest.php index f2c93e1638..1c518ab1ce 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Calculator/NumberNormalizerTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Calculator/NumberNormalizerTest.php @@ -15,7 +15,7 @@ final class NumberNormalizerTest extends FlowTestCase public function test_normalize_invalid_numbers_to_string(): void { $this->expectException(NonNumericValueException::class); - $this->expectExceptionMessage('foo'); + $this->expectExceptionMessageIsOrContains('foo'); // @mago-ignore analysis:possibly-invalid-argument NumberNormalizer::toString('foo', scale: 0); } @@ -53,7 +53,7 @@ public function test_normalize_numbers_to_string(int|string|float $input, int $s public function test_using_invalid_scale(): void { $this->expectException(InvalidScaleException::class); - $this->expectExceptionMessage('Scale "17" is invalid. It must be between 0 and 16.'); + $this->expectExceptionMessageIsOrContains('Scale "17" is invalid. It must be between 0 and 16.'); $this->expectExceptionCode(0); NumberNormalizer::toString(1, scale: 17); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Clock/HighResolutionTimeTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Clock/HighResolutionTimeTest.php index 5ac452fb86..f3ba1510d7 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Clock/HighResolutionTimeTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Clock/HighResolutionTimeTest.php @@ -98,7 +98,7 @@ public function test_to_string_keeps_every_nanosecond_of_a_large_second_count(): public function test_to_string_refuses_a_precision_outside_zero_to_nine(int $precision, string $message): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage($message); + $this->expectExceptionMessageIsOrContains($message); new HighResolutionTime(1, 5)->toString($precision); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Describe/ConfiguredFilesystemTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Describe/ConfiguredFilesystemTest.php index 1595d1fdeb..a6a73fbac3 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Describe/ConfiguredFilesystemTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Describe/ConfiguredFilesystemTest.php @@ -41,7 +41,7 @@ public function test_a_filesystem_with_live_state_does_not_describe(): void public function test_a_class_that_is_not_a_filesystem_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Flow\ETL\Tests\Double\Described is not a concrete Filesystem'); + $this->expectExceptionMessageIsOrContains('Flow\ETL\Tests\Double\Described is not a concrete Filesystem'); ConfiguredFilesystem::fromDescription(['filesystem' => Described::class, 'configuration' => []], new Rebuild()); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Describe/DescribableRoundTripTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Describe/DescribableRoundTripTest.php index 1e22ec675e..58750c6c6e 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Describe/DescribableRoundTripTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Describe/DescribableRoundTripTest.php @@ -65,7 +65,7 @@ public function test_a_rebuilt_describable_equals_the_described_one(string $clas if (in_array($class, DescribableFixtures::rebuiltByProgress(), true)) { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage($class . ' is rebuilt by Rebuild::progress()'); + $this->expectExceptionMessageIsOrContains($class . ' is rebuilt by Rebuild::progress()'); } static::assertEquals($describable, DescribeRoundTrip::rebuilt($describable)); diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Describe/DescriptionTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Describe/DescriptionTest.php index 7d9dc381d9..b9b6e1196f 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Describe/DescriptionTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Describe/DescriptionTest.php @@ -83,7 +83,7 @@ public function test_settings_union_nested_descriptions_naming_the_declaring_cla public function test_two_descriptions_declaring_different_values_for_one_setting_are_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( Described::class . ' declares the worker setting "precision" as "17", ' . NotDescribed::class @@ -112,7 +112,7 @@ public function test_from_array_does_not_recurse_into_data(): void public function test_from_array_refuses_a_missing_key(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Description is missing the "data" key'); + $this->expectExceptionMessageIsOrContains('Description is missing the "data" key'); Description::fromArray(['class' => Described::class, 'secret' => false]); } @@ -185,7 +185,7 @@ public function test_compose_is_sensitive_when_a_nested_description_is(): void public function test_compose_refuses_an_object_that_is_not_describable(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('is neither Describable nor a Description'); + $this->expectExceptionMessageIsOrContains('is neither Describable nor a Description'); Description::compose(Described::class, ['fs' => new NativeLocalFilesystem()]); } @@ -193,7 +193,7 @@ public function test_compose_refuses_an_object_that_is_not_describable(): void public function test_from_array_refuses_a_missing_class_key(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Description is missing the "class" key'); + $this->expectExceptionMessageIsOrContains('Description is missing the "class" key'); Description::fromArray(['secret' => false, 'data' => []]); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Describe/JsonTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Describe/JsonTest.php index 9e7f5496f6..f078634768 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Describe/JsonTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Describe/JsonTest.php @@ -27,7 +27,7 @@ public function test_a_document_nested_511_levels_deep_decodes(): void public function test_a_document_nested_512_levels_deep_is_refused(): void { $this->expectException(JsonException::class); - $this->expectExceptionMessage('Maximum stack depth exceeded'); + $this->expectExceptionMessageIsOrContains('Maximum stack depth exceeded'); Json::decode(str_repeat('[', 512) . str_repeat(']', 512)); } @@ -47,7 +47,7 @@ public function test_invalid_utf8_throws(): void public function test_a_scalar_document_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Expected a JSON array or object'); + $this->expectExceptionMessageIsOrContains('Expected a JSON array or object'); Json::decode('1'); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Describe/RebuildTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Describe/RebuildTest.php index 536ccc8941..3c6995106d 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Describe/RebuildTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Describe/RebuildTest.php @@ -26,7 +26,7 @@ final class RebuildTest extends FlowTestCase public function test_a_memory_share_below_one_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Rebuild memory share must be at least 1, given: 0'); + $this->expectExceptionMessageIsOrContains('Rebuild memory share must be at least 1, given: 0'); // @mago-ignore analysis:invalid-argument new Rebuild(memoryShare: 0); @@ -35,7 +35,7 @@ public function test_a_memory_share_below_one_is_refused(): void public function test_an_unknown_class_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Class Flow\\Nope\\Missing is not autoloadable here: install the package that provides it', ); @@ -48,7 +48,7 @@ public function test_an_unknown_class_is_refused(): void public function test_a_class_that_is_none_of_the_three_kinds_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Flow\\ETL\\Foundation\\Describe\\Rebuild is not Describable'); + $this->expectExceptionMessageIsOrContains('Flow\\ETL\\Foundation\\Describe\\Rebuild is not Describable'); new Rebuild()->object(new Description(Rebuild::class, []), Describable::class); } @@ -56,7 +56,9 @@ public function test_a_class_that_is_none_of_the_three_kinds_is_refused(): void public function test_an_interface_name_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Flow\\ETL\\Foundation\\Describe\\Describable is not a concrete class'); + $this->expectExceptionMessageIsOrContains( + 'Flow\\ETL\\Foundation\\Describe\\Describable is not a concrete class', + ); new Rebuild()->object(new Description(Describable::class, []), Describable::class); } @@ -64,7 +66,7 @@ public function test_an_interface_name_is_refused(): void public function test_the_wrong_type_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Flow\\ETL\\Tests\\Double\\Described is not a Flow\\ETL\\Foundation\\Describe\\ConfiguredFilesystem', ); diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/FlowPhpExtensionTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/FlowPhpExtensionTest.php index 17d34a9501..2a6cdb42ab 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/FlowPhpExtensionTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/FlowPhpExtensionTest.php @@ -25,7 +25,7 @@ public function test_a_loaded_extension_of_the_expected_abi_is_available(): void public function test_a_loaded_extension_of_another_abi_is_refused(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'The loaded flow_php extension (0.46.0, ABI ' . (FlowPhpExtension::ABI + 1) . ') does not match flow-php/etl (ABI ' @@ -40,7 +40,9 @@ public function test_a_loaded_extension_of_another_abi_is_refused(): void public function test_a_loaded_extension_without_an_abi_is_refused(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('The loaded flow_php extension (0.44.1, ABI none) does not match flow-php/etl'); + $this->expectExceptionMessageIsOrContains( + 'The loaded flow_php extension (0.44.1, ABI none) does not match flow-php/etl', + ); new FlowPhpExtension(true, null, '0.44.1')->available(); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Hash/HashAlgorithmTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Hash/HashAlgorithmTest.php index c0e2cf323a..f1fc223f36 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Hash/HashAlgorithmTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Foundation/Hash/HashAlgorithmTest.php @@ -18,7 +18,7 @@ public function test_a_name_gives_its_algorithm(): void public function test_an_unknown_name_lists_the_algorithms(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Unknown hash algorithm "sha1", use one of: md5, sha256, xxh128'); + $this->expectExceptionMessageIsOrContains('Unknown hash algorithm "sha1", use one of: md5, sha256, xxh128'); HashAlgorithm::named('sha1'); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/AllFunctionsDeclareTheirTypeTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/AllFunctionsDeclareTheirTypeTest.php index 5e0e052a6e..045fc7456a 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/AllFunctionsDeclareTheirTypeTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/AllFunctionsDeclareTheirTypeTest.php @@ -240,7 +240,7 @@ public function test_the_not_null_set_is_the_complement(): void public function test_an_unresolved_reference_refuses_to_describe_itself(): void { - $this->expectExceptionMessage('Invalid call to returns() on unresolved reference'); + $this->expectExceptionMessageIsOrContains('Invalid call to returns() on unresolved reference'); new UnresolvedReference('a')->returns(); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/AppendTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/AppendTest.php index e7b8438a3a..c3866500fc 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/AppendTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/AppendTest.php @@ -69,7 +69,7 @@ public function test_a_null_suffix_leaves_the_next_row_appended(): void public function test_append_with_null_value(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Append function requires non-null value'); + $this->expectExceptionMessageIsOrContains('Append function requires non-null value'); static::assertNull(new FunctionContext(flow_context())->eval( ref('str')->append(' world'), @@ -81,7 +81,7 @@ public function test_append_with_null_value(): void public function test_append_with_null_value_in_strict_mode(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Append function requires non-null value'); + $this->expectExceptionMessageIsOrContains('Append function requires non-null value'); new FunctionContext(flow_context(config()))->eval( ref('str')->append(' world'), diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayExpandTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayExpandTest.php index b5f7e4576f..e25da4c8a7 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayExpandTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayExpandTest.php @@ -87,7 +87,7 @@ public function test_expand_values(): void public function test_for_not_array_entry(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Expected type "array", got "integer".'); + $this->expectExceptionMessageIsOrContains('Expected type "array", got "integer".'); new FunctionContext(flow_context())->eval( array_expand(ref('integer_entry')), @@ -99,7 +99,7 @@ public function test_for_not_array_entry(): void public function test_for_not_array_entry_in_strict_mode(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Expected type "array", got "integer".'); + $this->expectExceptionMessageIsOrContains('Expected type "array", got "integer".'); new FunctionContext(flow_context(config()))->eval( array_expand(ref('integer_entry')), diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayFilterTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayFilterTest.php index 5076968575..957f5fb416 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayFilterTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayFilterTest.php @@ -51,7 +51,7 @@ public function test_array_filter_by_entry_reference(): void public function test_array_filter_in_strict_mode(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Expected type "array", got "string".'); + $this->expectExceptionMessageIsOrContains('Expected type "array", got "string".'); new FunctionContext(flow_context(config()))->eval( ref('map')->arrayFilter(lit(1)), @@ -78,7 +78,7 @@ public function test_array_filter_not_existing_value(): void public function test_array_filter_on_non_array(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Expected type "array", got "string".'); + $this->expectExceptionMessageIsOrContains('Expected type "array", got "string".'); new FunctionContext(flow_context())->eval( ref('map')->arrayFilter(lit(1)), @@ -90,7 +90,7 @@ public function test_array_filter_on_non_array(): void public function test_array_filter_on_null(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('ArrayFilter function requires non-null array'); + $this->expectExceptionMessageIsOrContains('ArrayFilter function requires non-null array'); new FunctionContext(flow_context())->eval( ref('list')->arrayFilter(lit(2)), diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayGetCollectionTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayGetCollectionTest.php index 2b23d996a6..5d40e930bb 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayGetCollectionTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayGetCollectionTest.php @@ -41,7 +41,7 @@ final class ArrayGetCollectionTest extends FlowTestCase public function test_array_get_collection_in_strict_mode(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('ArrayGetCollection function failed to evaluate parameters'); + $this->expectExceptionMessageIsOrContains('ArrayGetCollection function failed to evaluate parameters'); new FunctionContext(flow_context(config()))->eval( array_get_collection(ref('invalid_entry'), ['id']), @@ -53,7 +53,7 @@ public function test_array_get_collection_in_strict_mode(): void public function test_for_not_array_entry(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('ArrayGetCollection function failed to evaluate parameters.'); + $this->expectExceptionMessageIsOrContains('ArrayGetCollection function failed to evaluate parameters.'); new FunctionContext(flow_context())->eval( array_get_collection(ref('invalid_entry'), ['id']), @@ -85,7 +85,7 @@ public function test_null_keys_are_refused(): void public function test_getting_keys_from_simple_array(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('ArrayGetCollection function failed to evaluate parameters.'); + $this->expectExceptionMessageIsOrContains('ArrayGetCollection function failed to evaluate parameters.'); $rows = RowsMother::arrayColumn(); @@ -233,7 +233,7 @@ public function test_keys_are_literal_keys(array $keys, array $collection, array public function test_a_non_scalar_key_fails(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('ArrayGetCollection function failed to evaluate parameters.'); + $this->expectExceptionMessageIsOrContains('ArrayGetCollection function failed to evaluate parameters.'); new FunctionContext(flow_context())->eval(array_get_collection(ref('array_entry'), [[ 'x', diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayGetTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayGetTest.php index 487f56a88f..3f136847a1 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayGetTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayGetTest.php @@ -99,7 +99,7 @@ public static function path_grammar_types(): array public function test_constructor_rejects_a_wildcard_path(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('selects more than one value'); + $this->expectExceptionMessageIsOrContains('selects more than one value'); new ArrayGet(ref('array'), '*.id'); } @@ -107,7 +107,7 @@ public function test_constructor_rejects_a_wildcard_path(): void public function test_constructor_rejects_a_branch_path(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('selects more than one value'); + $this->expectExceptionMessageIsOrContains('selects more than one value'); new ArrayGet(ref('array'), '{a,b}'); } @@ -115,7 +115,7 @@ public function test_constructor_rejects_a_branch_path(): void public function test_array_access_for_not_array_entry(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('ArrayGet function failed to get value from array.'); + $this->expectExceptionMessageIsOrContains('ArrayGet function failed to get value from array.'); new FunctionContext(flow_context())->eval( array_get(ref('integer_entry'), 'invalid_path'), @@ -137,7 +137,7 @@ public function test_array_access_for_not_array_entry_strict_mode(): void { $context = flow_context(); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('ArrayGet function failed to get value from array'); + $this->expectExceptionMessageIsOrContains('ArrayGet function failed to get value from array'); new FunctionContext($context)->eval( array_get(ref('integer_entry'), 'invalid_path'), @@ -280,7 +280,7 @@ public function test_returns_rejects_a_non_structure_input(): void ); $this->expectException(SchemaNotDerivableException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'array_get() cannot describe the column it produces: the array operand declares "list", which is not a structure.', ); @@ -296,7 +296,7 @@ public function test_returns_rejects_an_undeclared_path_segment(): void ); $this->expectException(SchemaNotDerivableException::class); - $this->expectExceptionMessage('path segment "missing" is not declared by'); + $this->expectExceptionMessageIsOrContains('path segment "missing" is not declared by'); $resolved->returns(); } @@ -350,7 +350,7 @@ public function test_returns_names_the_key_of_an_undeclared_nullsafe_segment(): ); $this->expectException(SchemaNotDerivableException::class); - $this->expectExceptionMessage('path segment "missing" is not declared by'); + $this->expectExceptionMessageIsOrContains('path segment "missing" is not declared by'); $resolved->returns(); } @@ -358,7 +358,7 @@ public function test_returns_names_the_key_of_an_undeclared_nullsafe_segment(): public function test_constructor_rejects_a_nullsafe_wildcard_path(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('selects more than one value'); + $this->expectExceptionMessageIsOrContains('selects more than one value'); new ArrayGet(ref('array'), '?*.id'); } @@ -366,7 +366,7 @@ public function test_constructor_rejects_a_nullsafe_wildcard_path(): void public function test_constructor_rejects_an_invalid_path(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('ArrayGet path "x.{a" is not a valid path.'); + $this->expectExceptionMessageIsOrContains('ArrayGet path "x.{a" is not a valid path.'); new ArrayGet(ref('array'), 'x.{a'); } @@ -396,7 +396,7 @@ public function test_a_description_rebuilds_through_the_constructor_checks(): vo ]; $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('selects more than one value'); + $this->expectExceptionMessageIsOrContains('selects more than one value'); new Rebuild()->of($data, ScalarFunction::class); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayKeepTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayKeepTest.php index b136e70d55..7bf7bc338b 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayKeepTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayKeepTest.php @@ -51,7 +51,7 @@ public function test_array_keep_by_entry_reference(): void public function test_array_keep_in_strict_mode(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Expected type "array", got "string".'); + $this->expectExceptionMessageIsOrContains('Expected type "array", got "string".'); new FunctionContext(flow_context(config()))->eval( ref('map')->arrayKeep(lit(1)), @@ -78,7 +78,7 @@ public function test_array_keep_not_existing_value(): void public function test_array_keep_on_non_array(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Expected type "array", got "string".'); + $this->expectExceptionMessageIsOrContains('Expected type "array", got "string".'); new FunctionContext(flow_context())->eval( ref('map')->arrayKeep(lit(1)), @@ -90,7 +90,7 @@ public function test_array_keep_on_non_array(): void public function test_array_keep_on_null(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('ArrayKeep function requires non-null array'); + $this->expectExceptionMessageIsOrContains('ArrayKeep function requires non-null array'); new FunctionContext(flow_context())->eval( ref('list')->arrayKeep(lit(2)), diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayKeyRenameTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayKeyRenameTest.php index 283d40dc00..afba62fa42 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayKeyRenameTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayKeyRenameTest.php @@ -26,7 +26,7 @@ final class ArrayKeyRenameTest extends FlowTestCase public function test_array_key_rename_in_strict_mode(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Expected type "array", got "integer".'); + $this->expectExceptionMessageIsOrContains('Expected type "array", got "integer".'); new FunctionContext(flow_context(config()))->eval( array_key_rename(ref('integer_entry'), 'invalid_path', 'new_name'), @@ -38,7 +38,7 @@ public function test_array_key_rename_in_strict_mode(): void public function test_for_not_array_entry(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Expected type "array", got "integer".'); + $this->expectExceptionMessageIsOrContains('Expected type "array", got "integer".'); new FunctionContext(flow_context())->eval( array_key_rename(ref('integer_entry'), 'invalid_path', 'new_name'), diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayKeysStyleConverterTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayKeysStyleConverterTest.php index 906732c41d..a5eac6ebe9 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayKeysStyleConverterTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayKeysStyleConverterTest.php @@ -31,7 +31,7 @@ final class ArrayKeysStyleConverterTest extends FlowTestCase public function test_for_invalid_style(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Unrecognized style invalid, please use one of following:'); + $this->expectExceptionMessageIsOrContains('Unrecognized style invalid, please use one of following:'); new FunctionContext(flow_context())->eval( array_keys_style_convert(ref('invalid_entry'), 'invalid'), @@ -43,7 +43,7 @@ public function test_for_invalid_style(): void public function test_for_not_array_entry(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Expected type "array", got "integer".'); + $this->expectExceptionMessageIsOrContains('Expected type "array", got "integer".'); new FunctionContext(flow_context())->eval( array_keys_style_convert(ref('invalid_entry'), 'snake'), @@ -55,7 +55,7 @@ public function test_for_not_array_entry(): void public function test_for_null_array_entry(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('ArrayKeysStyleConvert function requires non-null array'); + $this->expectExceptionMessageIsOrContains('ArrayKeysStyleConvert function requires non-null array'); new FunctionContext(flow_context())->eval( array_keys_style_convert(ref('array_entry'), 'snake'), @@ -126,7 +126,7 @@ public function test_transforms_case_style_for_all_keys_in_array_entry(): void public function test_colliding_converted_field_names_are_refused_instead_of_silently_dropped(): void { $this->expectException(SchemaNotDerivableException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'fields "foo_bar" and "fooBar" of "structure{foo_bar: integer, fooBar: string}" both convert to "fooBar"', ); diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayKeysTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayKeysTest.php index 7dae2ca5da..0542648d15 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayKeysTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayKeysTest.php @@ -56,7 +56,7 @@ public function test_an_operand_without_a_key_type_is_refused_at_bind(): void $resolved = new ReferenceResolver()->resolve(ref('json')->arrayKeys(), schema(json_schema('json'))); $this->expectException(SchemaNotDerivableException::class); - $this->expectExceptionMessage('which has no key type'); + $this->expectExceptionMessageIsOrContains('which has no key type'); $resolved->returns(); } @@ -79,7 +79,7 @@ public function test_array_keys(): void public function test_array_keys_in_strict_mode(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Expected type "array", got "string".'); + $this->expectExceptionMessageIsOrContains('Expected type "array", got "string".'); new FunctionContext(flow_context(config()))->eval( ref('map')->arrayKeys(), @@ -91,7 +91,7 @@ public function test_array_keys_in_strict_mode(): void public function test_array_keys_on_non_array(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Expected type "array", got "string".'); + $this->expectExceptionMessageIsOrContains('Expected type "array", got "string".'); new FunctionContext(flow_context())->eval( ref('map')->arrayKeys(), @@ -103,7 +103,7 @@ public function test_array_keys_on_non_array(): void public function test_array_keys_on_null(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('ArrayKeys function requires non-null array'); + $this->expectExceptionMessageIsOrContains('ArrayKeys function requires non-null array'); new FunctionContext(flow_context())->eval( ref('map')->arrayKeys(), diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayMergeCollectionTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayMergeCollectionTest.php index 05402483d8..ebaa37813c 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayMergeCollectionTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayMergeCollectionTest.php @@ -30,7 +30,7 @@ final class ArrayMergeCollectionTest extends FlowTestCase public function test_array_merge_collection_in_strict_mode_with_non_array(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Expected type "array", got "integer".'); + $this->expectExceptionMessageIsOrContains('Expected type "array", got "integer".'); new FunctionContext(flow_context(config()))->eval( array_merge_collection(ref('invalid_entry')), @@ -42,7 +42,7 @@ public function test_array_merge_collection_in_strict_mode_with_non_array(): voi public function test_array_merge_collection_in_strict_mode_with_non_array_elements(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('ArrayMergeCollection function requires array elements to be arrays'); + $this->expectExceptionMessageIsOrContains('ArrayMergeCollection function requires array elements to be arrays'); new FunctionContext(flow_context(config()))->eval( array_merge_collection(ref('array_entry')), @@ -59,7 +59,7 @@ public function test_array_merge_collection_in_strict_mode_with_non_array_elemen public function test_attempt_of_merging_collection_where_not_every_element_is_array(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('ArrayMergeCollection function requires array elements to be arrays'); + $this->expectExceptionMessageIsOrContains('ArrayMergeCollection function requires array elements to be arrays'); new FunctionContext(flow_context())->eval( array_merge_collection(ref('array_entry')), @@ -76,7 +76,7 @@ public function test_attempt_of_merging_collection_where_not_every_element_is_ar public function test_for_not_array_entry(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Expected type "array", got "integer".'); + $this->expectExceptionMessageIsOrContains('Expected type "array", got "integer".'); new FunctionContext(flow_context())->eval( array_merge_collection(ref('invalid_entry')), diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayMergeTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayMergeTest.php index b2f1e8e7ec..b6bc363b73 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayMergeTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayMergeTest.php @@ -32,7 +32,7 @@ final class ArrayMergeTest extends FlowTestCase public function test_array_merge_in_strict_mode(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Expected type "array", got "integer".'); + $this->expectExceptionMessageIsOrContains('Expected type "array", got "integer".'); new FunctionContext(flow_context(config()))->eval( ref('a')->arrayMerge(ref('b')), @@ -67,7 +67,7 @@ public function test_array_merge_two_lit_functions(): void public function test_array_merge_when_left_side_is_not_an_array(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Expected type "array", got "integer".'); + $this->expectExceptionMessageIsOrContains('Expected type "array", got "integer".'); new FunctionContext(flow_context())->eval( ref('a')->arrayMerge(ref('b')), @@ -79,7 +79,7 @@ public function test_array_merge_when_left_side_is_not_an_array(): void public function test_array_merge_when_right_side_is_not_an_array(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Expected type "array", got "integer".'); + $this->expectExceptionMessageIsOrContains('Expected type "array", got "integer".'); new FunctionContext(flow_context())->eval( ref('a')->arrayMerge(ref('b')), @@ -107,7 +107,7 @@ public function test_a_list_merged_with_a_map_declares_an_array(): void public function test_lists_without_a_common_element_type_refuse_to_declare(): void { $this->expectException(InvalidTypeException::class); - $this->expectExceptionMessage('Cannot combine types "boolean", "datetime"'); + $this->expectExceptionMessageIsOrContains('Cannot combine types "boolean", "datetime"'); new ReferenceResolver() ->resolve( @@ -120,7 +120,7 @@ public function test_lists_without_a_common_element_type_refuse_to_declare(): vo public function test_array_merge_when_left_side_is_null(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('ArrayMerge function requires two non-null arrays'); + $this->expectExceptionMessageIsOrContains('ArrayMerge function requires two non-null arrays'); new FunctionContext(flow_context())->eval( ref('a')->arrayMerge(ref('b')), diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayReverseTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayReverseTest.php index e1afcf305a..3473906790 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayReverseTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayReverseTest.php @@ -44,7 +44,7 @@ public function test_array_reverse_array_entry(): void public function test_array_reverse_in_strict_mode(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Expected type "array", got "integer".'); + $this->expectExceptionMessageIsOrContains('Expected type "array", got "integer".'); new FunctionContext(flow_context(config()))->eval( ref('a')->arrayReverse(), @@ -56,7 +56,7 @@ public function test_array_reverse_in_strict_mode(): void public function test_array_reverse_non_array_entry(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Expected type "array", got "integer".'); + $this->expectExceptionMessageIsOrContains('Expected type "array", got "integer".'); new FunctionContext(flow_context())->eval(ref('a')->arrayReverse(), ['a' => 123], schema(int_schema('a'))); } @@ -117,7 +117,7 @@ public function test_reversal_crosses_the_required_and_optional_buckets(): void public function test_array_reverse_on_null(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('ArrayReverse function requires non-null array'); + $this->expectExceptionMessageIsOrContains('ArrayReverse function requires non-null array'); new FunctionContext(flow_context())->eval( ref('list')->arrayReverse(), diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArraySortTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArraySortTest.php index 70a80e4552..dccb9b2ad4 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArraySortTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArraySortTest.php @@ -36,7 +36,7 @@ final class ArraySortTest extends FlowTestCase public function test_array_sort_in_strict_mode(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Expected type "array", got "string".'); + $this->expectExceptionMessageIsOrContains('Expected type "array", got "string".'); new FunctionContext(flow_context(config()))->eval( ref('array')->arraySort(), @@ -236,7 +236,7 @@ public function test_sorting_nested_associative_array(): void public function test_sorting_non_array_value(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Expected type "array", got "string".'); + $this->expectExceptionMessageIsOrContains('Expected type "array", got "string".'); new FunctionContext(flow_context())->eval( ref('array')->arraySort(), @@ -248,7 +248,7 @@ public function test_sorting_non_array_value(): void public function test_sorting_null_array(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('ArraySort function requires non-null array'); + $this->expectExceptionMessageIsOrContains('ArraySort function requires non-null array'); new FunctionContext(flow_context())->eval( ref('array')->arraySort(), diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayUnpackTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayUnpackTest.php index 476b151ebf..ee247ade8a 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayUnpackTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayUnpackTest.php @@ -63,7 +63,7 @@ public function test_array_unpack(): void public function test_array_unpack_with_null_in_strict_mode(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('array_unpack() requires a non-null array'); + $this->expectExceptionMessageIsOrContains('array_unpack() requires a non-null array'); new FunctionContext(flow_context(config()))->eval( new ArrayUnpack(ref('array_entry'), schema(str_schema('status'))), @@ -78,7 +78,7 @@ public function test_array_unpack_with_null_in_strict_mode(): void public function test_it_refuses_an_empty_schema(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('array_unpack() requires at least one declared column'); + $this->expectExceptionMessageIsOrContains('array_unpack() requires at least one declared column'); new ArrayUnpack(ref('array_entry'), schema()); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayValuesTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayValuesTest.php index e94a381b43..c4931a6d00 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayValuesTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ArrayValuesTest.php @@ -44,7 +44,7 @@ public function test_array_values(): void public function test_array_values_in_strict_mode(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Expected type "array", got "string".'); + $this->expectExceptionMessageIsOrContains('Expected type "array", got "string".'); new FunctionContext(flow_context(config()))->eval( ref('map')->arrayValues(), @@ -56,7 +56,7 @@ public function test_array_values_in_strict_mode(): void public function test_array_values_on_non_array(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Expected type "array", got "string".'); + $this->expectExceptionMessageIsOrContains('Expected type "array", got "string".'); new FunctionContext(flow_context())->eval( ref('map')->arrayValues(), @@ -100,7 +100,7 @@ public function test_a_structure_whose_fields_do_not_unify_refuses_to_declare(): public function test_array_values_on_null(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('ArrayValues function requires non-null array'); + $this->expectExceptionMessageIsOrContains('ArrayValues function requires non-null array'); new FunctionContext(flow_context())->eval( ref('map')->arrayValues(), @@ -123,7 +123,7 @@ public function test_a_map_operand_declares_the_map_value_type(): void public function test_a_scalar_operand_refuses_to_declare(): void { $this->expectException(SchemaNotDerivableException::class); - $this->expectExceptionMessage('the array operand declares "string", which has no element type'); + $this->expectExceptionMessageIsOrContains('the array operand declares "string", which has no element type'); new ReferenceResolver() ->resolve(ref('map')->arrayValues(), schema(str_schema('map'))) diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/AsciiTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/AsciiTest.php index 4fb2ff48b5..6bde8bdab0 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/AsciiTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/AsciiTest.php @@ -27,7 +27,7 @@ public function test_ascii(): void public function test_ascii_on_null(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Ascii function requires non-null value'); + $this->expectExceptionMessageIsOrContains('Ascii function requires non-null value'); new FunctionContext(flow_context())->eval( ref('str')->ascii(), diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/BetweenTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/BetweenTest.php index 9a9d3c674f..a19336e9e4 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/BetweenTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/BetweenTest.php @@ -144,7 +144,9 @@ public function test_between_right_inclusive(): void public function test_between_with_invalid_boundary_in_strict_mode(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Expected type "object", got "string".'); + $this->expectExceptionMessageIsOrContains( + 'Expected type "object", got "string".', + ); new FunctionContext(flow_context())->eval( between(ref('value'), lit(10), lit(50), lit('invalid')), @@ -158,7 +160,7 @@ public function test_between_with_invalid_boundary_in_strict_mode(): void public function test_between_refuses_incomparable_bounds_at_bind(): void { $this->expectException(TypesInvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( "Can't compare '(date >= integer)' due to data type mismatch - an explicit cast is required.", ); @@ -171,7 +173,7 @@ public function test_between_refuses_incomparable_bounds_at_bind(): void public function test_between_refuses_a_value_incomparable_with_its_bounds(): void { $this->expectException(TypesInvalidArgumentException::class); - $this->expectExceptionMessage('due to data type mismatch - an explicit cast is required.'); + $this->expectExceptionMessageIsOrContains('due to data type mismatch - an explicit cast is required.'); between(lit(new DateTimeImmutable('2024-01-01')), lit(1), lit(2))->returns(); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/BinaryComparisonsTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/BinaryComparisonsTest.php index 8de7041ad5..763a95981c 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/BinaryComparisonsTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/BinaryComparisonsTest.php @@ -479,7 +479,7 @@ public function test_is_type(): void public function test_is_type_with_non_existing_type_class(): void { - $this->expectExceptionMessage('Unknown type \'aaa\''); + $this->expectExceptionMessageIsOrContains('Unknown type \'aaa\''); static::assertFalse(new FunctionContext(flow_context())->eval( new IsType(ref('a'), 'aaa'), diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/BinaryLengthTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/BinaryLengthTest.php index 1fdf4e5efa..754cdeae74 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/BinaryLengthTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/BinaryLengthTest.php @@ -45,7 +45,7 @@ public function test_binary_length_empty_string(): void public function test_binary_length_throws_on_null_input(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('BinaryLength function requires non-null value'); + $this->expectExceptionMessageIsOrContains('BinaryLength function requires non-null value'); new FunctionContext(flow_context())->eval( ref('str')->binaryLength(), diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/CallUserFuncTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/CallUserFuncTest.php index 3f9b5817f5..83c9a1af8e 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/CallUserFuncTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/CallUserFuncTest.php @@ -66,7 +66,7 @@ public function test_a_non_scalar_function_cannot_replace_the_callable_child(): $function = new CallUserFunc(lit('count'), type_integer(), [lit([1, 2, 3])]); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('CallUserFunc requires a ScalarFunction as its first child'); + $this->expectExceptionMessageIsOrContains('CallUserFunc requires a ScalarFunction as its first child'); $function->withChildren([row_number(), lit([1, 2, 3])]); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/CapitalizeTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/CapitalizeTest.php index 96ecd333da..217600f6ba 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/CapitalizeTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/CapitalizeTest.php @@ -46,7 +46,7 @@ public function test_capitalize_an_integer(): void public function test_capitalize_on_null(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Capitalize function requires non-null value'); + $this->expectExceptionMessageIsOrContains('Capitalize function requires non-null value'); new FunctionContext(flow_context())->eval( ref('string')->capitalize(), diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/CastTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/CastTest.php index c5349433d5..eefa21cd8f 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/CastTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/CastTest.php @@ -56,7 +56,7 @@ final class CastTest extends FlowTestCase public function test_cast_of_a_null_value_throws(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Cast function requires non-null value'); + $this->expectExceptionMessageIsOrContains('Cast function requires non-null value'); new FunctionContext(flow_context())->eval( cast(ref('value'), 'int'), @@ -252,7 +252,7 @@ public function test_a_refused_cast_keeps_the_casting_error_as_the_cause(): void public function test_casting_an_unconvertible_value_to_an_optional_target_throws(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Cast function failed: Can\'t cast "string" into "datetime" type'); + $this->expectExceptionMessageIsOrContains('Cast function failed: Can\'t cast "string" into "datetime" type'); new FunctionContext(flow_context())->eval( cast(ref('value'), type_optional(type_datetime())), @@ -266,7 +266,7 @@ public function test_casting_an_unconvertible_value_to_an_optional_target_throws public function test_constructor_rejects_a_non_representable_target(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Cast function does not support type: object'); + $this->expectExceptionMessageIsOrContains('Cast function does not support type: object'); cast(ref('value'), 'object'); } @@ -292,7 +292,7 @@ public function test_double_and_real_resolve_to_float(): void public function test_constructor_rejects_json_pretty(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Cast function does not support type: json_pretty'); + $this->expectExceptionMessageIsOrContains('Cast function does not support type: json_pretty'); cast(ref('value'), 'json_pretty'); } @@ -316,7 +316,7 @@ public static function union_targets(): Generator public function test_constructor_rejects_a_union_target(Type $type, string $described): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Cast function does not support type: ' . $described); + $this->expectExceptionMessageIsOrContains('Cast function does not support type: ' . $described); cast(ref('value'), $type); } @@ -425,7 +425,7 @@ public function test_cast(mixed $from, Definition $definition, string $to, mixed public function test_casting_a_scalar_to_array_names_the_remedy(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Cast function failed: Can\'t cast "string" into "array" type: wrap the value first, e.g. type_list(type_string())', ); @@ -439,7 +439,7 @@ public function test_casting_a_scalar_to_array_names_the_remedy(): void public function test_casting_integer_to_timezone(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Cast function failed: Can\'t cast "int" into "timezone" type'); + $this->expectExceptionMessageIsOrContains('Cast function failed: Can\'t cast "int" into "timezone" type'); new FunctionContext(flow_context())->eval( ref('value')->cast('timezone'), @@ -451,7 +451,7 @@ public function test_casting_integer_to_timezone(): void public function test_casting_integer_to_xml(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Cast function failed: Can\'t cast "int" into "xml" type'); + $this->expectExceptionMessageIsOrContains('Cast function failed: Can\'t cast "int" into "xml" type'); new FunctionContext(flow_context())->eval( ref('value')->cast('xml'), @@ -463,7 +463,7 @@ public function test_casting_integer_to_xml(): void public function test_casting_invalid_string_to_timezone(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Cast function failed: Can\'t cast "string" into "timezone" type'); + $this->expectExceptionMessageIsOrContains('Cast function failed: Can\'t cast "string" into "timezone" type'); new FunctionContext(flow_context())->eval( ref('value')->cast('timezone'), @@ -475,7 +475,7 @@ public function test_casting_invalid_string_to_timezone(): void public function test_casting_non_xml_string_to_xml(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Cast function failed: Can\'t cast "string" into "xml" type'); + $this->expectExceptionMessageIsOrContains('Cast function failed: Can\'t cast "string" into "xml" type'); new FunctionContext(flow_context())->eval( ref('value')->cast('xml'), diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ChunkTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ChunkTest.php index 2eaa35cebe..9de410b998 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ChunkTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ChunkTest.php @@ -51,7 +51,7 @@ public function test_chunk_larger_than_string_length(): void public function test_chunk_negative_size(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Chunk function requires non-null, positive size'); + $this->expectExceptionMessageIsOrContains('Chunk function requires non-null, positive size'); new FunctionContext(flow_context())->eval(ref('str')->chunk(-1), ['str' => 'hello'], schema(str_schema('str'))); } @@ -59,7 +59,7 @@ public function test_chunk_negative_size(): void public function test_chunk_null_input(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Chunk function requires non-null value'); + $this->expectExceptionMessageIsOrContains('Chunk function requires non-null value'); new FunctionContext(flow_context())->eval( ref('str')->chunk(3), @@ -83,7 +83,7 @@ public function test_chunk_string_basic_functionality(): void public function test_chunk_with_null_size(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Chunk function requires non-null, positive size'); + $this->expectExceptionMessageIsOrContains('Chunk function requires non-null, positive size'); new FunctionContext(flow_context())->eval( ref('str')->chunk(ref('size')), @@ -107,7 +107,7 @@ public function test_chunk_with_scalar_function_size(): void public function test_chunk_zero_size(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Chunk function requires non-null, positive size'); + $this->expectExceptionMessageIsOrContains('Chunk function requires non-null, positive size'); new FunctionContext(flow_context())->eval(ref('str')->chunk(0), ['str' => 'hello'], schema(str_schema('str'))); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/CoalesceTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/CoalesceTest.php index 8302ab9725..bdc8225c23 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/CoalesceTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/CoalesceTest.php @@ -128,7 +128,9 @@ public function test_a_null_row_keeps_later_rows_of_the_first_argument(): void public function test_branches_without_a_common_type_refuse_to_declare(): void { $this->expectException(InvalidTypeException::class); - $this->expectExceptionMessage('Cannot combine types "integer", "list" - an explicit cast is required.'); + $this->expectExceptionMessageIsOrContains( + 'Cannot combine types "integer", "list" - an explicit cast is required.', + ); new ReferenceResolver() ->resolve( diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/CodePointLengthTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/CodePointLengthTest.php index a0de3d8082..ec928bb366 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/CodePointLengthTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/CodePointLengthTest.php @@ -36,7 +36,7 @@ public function test_code_point_length_empty_string(): void public function test_code_point_length_throws_on_null_input(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('CodePointLength function requires non-null value'); + $this->expectExceptionMessageIsOrContains('CodePointLength function requires non-null value'); new FunctionContext(flow_context())->eval( ref('str')->codePointLength(), diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/CollapseWhitespaceTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/CollapseWhitespaceTest.php index 923ca18e2c..d17f193c9b 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/CollapseWhitespaceTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/CollapseWhitespaceTest.php @@ -63,7 +63,7 @@ public function test_multiple_spaces_between_words(): void public function test_null_value(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('CollapseWhitespace function requires non-null value'); + $this->expectExceptionMessageIsOrContains('CollapseWhitespace function requires non-null value'); static::assertNull(new FunctionContext(flow_context())->eval( ref('str')->collapseWhitespace(), diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/CombineTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/CombineTest.php index 9388e28e5f..bdd3cfbbe0 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/CombineTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/CombineTest.php @@ -33,7 +33,7 @@ public function test_operands_that_are_not_lists_are_refused_at_bind(): void ); $this->expectException(SchemaNotDerivableException::class); - $this->expectExceptionMessage('both operands must declare list types'); + $this->expectExceptionMessageIsOrContains('both operands must declare list types'); $resolved->returns(); } @@ -71,7 +71,7 @@ public function test_an_empty_row_keeps_the_rows_after_it(): void public function test_array_combine_when_keys_are_not_array(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Expected type "array", got "string".'); + $this->expectExceptionMessageIsOrContains('Expected type "array", got "string".'); new FunctionContext(flow_context())->eval(combine(lit('a'), lit([1, 2, 3])), [], schema()); } @@ -91,7 +91,9 @@ public function test_array_combine_when_keys_are_not_unique(): void public function test_array_combine_when_one_of_arrays_is_empty(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Combine function requires keys and values arrays to have the same length'); + $this->expectExceptionMessageIsOrContains( + 'Combine function requires keys and values arrays to have the same length', + ); new FunctionContext(flow_context())->eval(combine(lit(['a', 'b', 'c']), lit([])), [], schema()); } @@ -107,7 +109,7 @@ public function test_array_combine_with_a_single_key(): void public function test_array_combine_when_keys_are_null(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Combine function requires non-null arrays'); + $this->expectExceptionMessageIsOrContains('Combine function requires non-null arrays'); new FunctionContext(flow_context())->eval( combine(ref('keys'), ref('values')), @@ -122,7 +124,7 @@ public function test_array_combine_when_keys_are_null(): void public function test_array_combine_when_first_key_is_a_float_and_second_an_integer(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Combine function requires keys to be strings or integers'); + $this->expectExceptionMessageIsOrContains('Combine function requires keys to be strings or integers'); new FunctionContext(flow_context())->eval(combine(lit([1.5, 2]), lit([1, 2])), [], schema()); } @@ -130,7 +132,7 @@ public function test_array_combine_when_first_key_is_a_float_and_second_an_integ public function test_array_combine_when_the_only_key_is_a_float(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Combine function requires keys to be strings or integers'); + $this->expectExceptionMessageIsOrContains('Combine function requires keys to be strings or integers'); new FunctionContext(flow_context())->eval(combine(lit([1.5]), lit([1])), [], schema()); } @@ -138,7 +140,7 @@ public function test_array_combine_when_the_only_key_is_a_float(): void public function test_array_combine_when_a_later_key_is_a_float(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Combine function requires keys to be strings or integers'); + $this->expectExceptionMessageIsOrContains('Combine function requires keys to be strings or integers'); new FunctionContext(flow_context())->eval(combine(lit(['a', 1.5]), lit([1, 2])), [], schema()); } @@ -146,7 +148,7 @@ public function test_array_combine_when_a_later_key_is_a_float(): void public function test_array_combine_when_a_later_key_is_a_boolean(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Combine function requires keys to be strings or integers'); + $this->expectExceptionMessageIsOrContains('Combine function requires keys to be strings or integers'); new FunctionContext(flow_context())->eval(combine(lit(['a', true]), lit([1, 2])), [], schema()); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ComparisonTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ComparisonTest.php index b9c983cdf7..beb21c56e2 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ComparisonTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ComparisonTest.php @@ -57,7 +57,7 @@ final class ComparisonTest extends FlowTestCase public function test_refuses_an_operator_that_does_not_compare_two_values(Operator $operator): void { $this->expectException(EtlInvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Comparison does not support "' . $operator->value . '", use one of: ==, !=, ===, !==, >, >=, <, <=', ); @@ -83,7 +83,7 @@ public function test_equality_casts_a_temporal_string(): void public function test_identity_refuses_a_temporal_string(Operator $operator): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( "Can't compare '(date " . $operator->value . " string)' due to data type mismatch - an explicit cast is required.", @@ -97,7 +97,7 @@ public function test_identity_refuses_a_temporal_string(Operator $operator): voi public function test_a_cast_error_names_the_column_read_never_the_alias(): void { $this->expectException(EvaluationException::class); - $this->expectExceptionMessage("Column \"a\" value 'x' cannot be cast to integer to compare"); + $this->expectExceptionMessageIsOrContains("Column \"a\" value 'x' cannot be cast to integer to compare"); new FunctionContext(flow_context())->eval( ref('a')->as('b')->equals(lit(1)), @@ -238,7 +238,7 @@ public function test_a_datetime_equals_a_literal_of_the_same_instant_in_another_ public function test_a_uuid_is_not_comparable_with_a_string(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage("Can't compare '(uuid == string)' due to data type mismatch"); + $this->expectExceptionMessageIsOrContains("Can't compare '(uuid == string)' due to data type mismatch"); new ReferenceResolver() ->resolve( diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/DOMElementAttributeValueTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/DOMElementAttributeValueTest.php index 54ec6b2ff6..04422eaf3e 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/DOMElementAttributeValueTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/DOMElementAttributeValueTest.php @@ -105,7 +105,7 @@ public function test_a_missing_attribute_keeps_the_rows_after_it(): void public function test_xml_extracting_attribute_from_null_entry(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('DOMElementAttributeValue requires non-null DOMNode'); + $this->expectExceptionMessageIsOrContains('DOMElementAttributeValue requires non-null DOMNode'); new FunctionContext(flow_context())->eval( ref('value')->domElementAttributeValue('baz'), diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/DOMElementAttributesCountTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/DOMElementAttributesCountTest.php index de7f147695..6c830f0a76 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/DOMElementAttributesCountTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/DOMElementAttributesCountTest.php @@ -119,7 +119,7 @@ public function test_xml_attributes_count_on_element_with_zero_attributes(): voi public function test_xml_attributes_count_on_null_entry(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('DOMElementAttributesCount requires non-null DOMElement'); + $this->expectExceptionMessageIsOrContains('DOMElementAttributesCount requires non-null DOMElement'); new FunctionContext(flow_context())->eval( ref('value')->domElementAttributesCount(), diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/DOMElementNamespaceValueTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/DOMElementNamespaceValueTest.php index a9be211d6f..a574c595fa 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/DOMElementNamespaceValueTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/DOMElementNamespaceValueTest.php @@ -85,7 +85,7 @@ public function test_xml_getting_element_non_default_namespace(): void public function test_xml_getting_namespace_of_null_entry(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('DOMElementNamespaceValue requires non-null DOMNode'); + $this->expectExceptionMessageIsOrContains('DOMElementNamespaceValue requires non-null DOMNode'); new FunctionContext(flow_context())->eval( ref('node')->domElementNamespace(), diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/DOMElementParentTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/DOMElementParentTest.php index 79663dc8c9..4d8bda481e 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/DOMElementParentTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/DOMElementParentTest.php @@ -29,7 +29,7 @@ public function test_html_fails_when_parent_not_available_in_strict_mode(): void $element = HTMLDocument::createFromString('bar', LIBXML_HTML_NOIMPLIED | LIBXML_NOERROR); $context = flow_context(config()); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('DOMElementParent requires non-null DOMNode or HTMLElement.'); + $this->expectExceptionMessageIsOrContains('DOMElementParent requires non-null DOMNode or HTMLElement.'); new FunctionContext($context)->eval( ref('value')->domElementParent(), [ @@ -72,7 +72,7 @@ public function test_xml_fails_when_parent_not_available_in_strict_mode(): void $xml->loadXML('foobar'); $context = flow_context(config()); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('DOMElementParent requires non-null DOMNode or HTMLElement.'); + $this->expectExceptionMessageIsOrContains('DOMElementParent requires non-null DOMNode or HTMLElement.'); static::assertEquals($xml, new FunctionContext($context)->eval( ref('value')->domElementParent(), [ diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/DateTimeFormatTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/DateTimeFormatTest.php index c8a464b316..052d8777e0 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/DateTimeFormatTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/DateTimeFormatTest.php @@ -129,7 +129,7 @@ public function test_formatting_now(): void public function test_invalid_date_time_format(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Expected type "object", got "string".'); + $this->expectExceptionMessageIsOrContains('Expected type "object", got "string".'); new FunctionContext(flow_context())->eval( date_time_format(ref('date_time'), 'Y-m-d H:i:s'), diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/DenseRankTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/DenseRankTest.php index 5d0e756747..a547e0adab 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/DenseRankTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/DenseRankTest.php @@ -66,7 +66,7 @@ public function test_dense_rank_over_multiple_order_columns(): void public function test_dense_rank_requires_an_order_by(): void { - $this->expectExceptionMessage('Dens Rank window function requires to be ordered by one column'); + $this->expectExceptionMessageIsOrContains('Dens Rank window function requires to be ordered by one column'); dense_rank() ->over(window()) @@ -79,7 +79,7 @@ public function test_dense_rank_requires_an_order_by(): void public function test_dense_rank_without_over_clause(): void { - $this->expectExceptionMessage('Window function "dens_rank()" requires an OVER clause.'); + $this->expectExceptionMessageIsOrContains('Window function "dens_rank()" requires an OVER clause.'); dense_rank()->values(RankingContext::salariesDescending(), flow_context()->backend(), new VoidProgress()); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/EnsureEndTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/EnsureEndTest.php index 2200a38d0b..95ab47c82a 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/EnsureEndTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/EnsureEndTest.php @@ -54,7 +54,7 @@ public function test_null_suffix(): void public function test_null_value(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('EnsureEnd function requires non-null value'); + $this->expectExceptionMessageIsOrContains('EnsureEnd function requires non-null value'); static::assertNull(new FunctionContext(flow_context())->eval( ref('str')->ensureEnd('_suffix'), diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/EnsureStartTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/EnsureStartTest.php index 12b32bd8aa..6ece16879c 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/EnsureStartTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/EnsureStartTest.php @@ -54,7 +54,7 @@ public function test_null_prefix(): void public function test_null_value(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('EnsureStart function requires non-null value'); + $this->expectExceptionMessageIsOrContains('EnsureStart function requires non-null value'); static::assertNull(new FunctionContext(flow_context())->eval( ref('str')->ensureStart('prefix_'), diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/EnumNameTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/EnumNameTest.php index f05f75375a..c27ac44850 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/EnumNameTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/EnumNameTest.php @@ -67,7 +67,7 @@ enum_name(ref('e')), public function test_enum_name_throws_in_strict_mode(mixed $input): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('EnumName function requires a UnitEnum value'); + $this->expectExceptionMessageIsOrContains('EnumName function requires a UnitEnum value'); new FunctionContext(flow_context(config()))->eval(enum_name($input), [], schema()); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/EnumValueTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/EnumValueTest.php index b92b18a609..e7bdf2dcf8 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/EnumValueTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/EnumValueTest.php @@ -63,7 +63,7 @@ enum_value(ref('e')), public function test_enum_value_throws_in_strict_mode(mixed $input): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('EnumValue function requires a BackedEnum value'); + $this->expectExceptionMessageIsOrContains('EnumValue function requires a BackedEnum value'); new FunctionContext(flow_context(config()))->eval(enum_value($input), [], schema()); } @@ -74,7 +74,7 @@ public function test_a_non_enum_operand_is_refused_at_bind(): void $resolved = new ReferenceResolver()->resolve(enum_value(ref('e')), schema(str_schema('e'))); $this->expectException(SchemaNotDerivableException::class); - $this->expectExceptionMessage('which is not an enum'); + $this->expectExceptionMessageIsOrContains('which is not an enum'); $resolved->returns(); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/Evaluation/FilterTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/Evaluation/FilterTest.php index 8bbf9ae753..2d2f52a970 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/Evaluation/FilterTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/Evaluation/FilterTest.php @@ -166,7 +166,7 @@ public function test_a_reference_the_schema_lacks_is_refused(): void public function test_an_expanding_predicate_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'filter() cannot contain array_expand(), it turns one row into many rows. Expand with withColumn() first, then use the new column.', ); @@ -176,7 +176,7 @@ public function test_an_expanding_predicate_is_refused(): void public function test_a_predicate_returning_no_boolean_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('filter() requires a predicate returning boolean'); + $this->expectExceptionMessageIsOrContains('filter() requires a predicate returning boolean'); Filter::bind(schema(int_schema('a')), ref('a')); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ExpandingFunctionsTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ExpandingFunctionsTest.php index 45108f3da5..e880c767d0 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ExpandingFunctionsTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ExpandingFunctionsTest.php @@ -51,7 +51,7 @@ public function test_in_finds_an_expand_that_is_an_on_each_operand(): void public function test_refuse_names_the_site(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'filter() cannot contain array_expand(), it turns one row into many rows. Expand with withColumn() first, then use the new column.', ); @@ -69,7 +69,7 @@ public function test_refuse_passes_a_tree_without_an_expand(): void public function test_refuse_nested_refuses_an_expand_below_an_expand(ScalarFunction $tree): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'array_expand() cannot contain another array_expand(). Expand one level per withColumn().', ); diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/GreatestTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/GreatestTest.php index 0c34fefa45..9a9ecd64cf 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/GreatestTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/GreatestTest.php @@ -51,14 +51,14 @@ public function test_greatest_value(): void public function test_greatest_with_non_comparable_values(): void { - $this->expectExceptionMessage('Cannot combine types'); + $this->expectExceptionMessageIsOrContains('Cannot combine types'); greatest(null, 20, lit(new DateTimeImmutable('now')))->returns(); } public function test_an_integer_and_a_string_column_have_no_common_type(): void { - $this->expectExceptionMessage('Cannot combine types "integer", "string"'); + $this->expectExceptionMessageIsOrContains('Cannot combine types "integer", "string"'); greatest(5, 'apple')->returns(); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/HTMLQuerySelectorAllTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/HTMLQuerySelectorAllTest.php index 6bdaf46f64..fa17eacd70 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/HTMLQuerySelectorAllTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/HTMLQuerySelectorAllTest.php @@ -53,7 +53,7 @@ public function test_getting_null_when_nothing_found(): void public function test_invalid_value(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Expected one of'); + $this->expectExceptionMessageIsOrContains('Expected one of'); new FunctionContext(flow_context())->eval( ref('value')->htmlQuerySelectorAll('body div span'), diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/HTMLQuerySelectorTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/HTMLQuerySelectorTest.php index 0621b2d11c..29b35cb11b 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/HTMLQuerySelectorTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/HTMLQuerySelectorTest.php @@ -50,7 +50,7 @@ public function test_getting_null_when_nothing_found(): void public function test_invalid_value(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Expected one of'); + $this->expectExceptionMessageIsOrContains('Expected one of'); new FunctionContext(flow_context())->eval( ref('value')->htmlQuerySelector('body div span'), diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/IndexOfLastTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/IndexOfLastTest.php index eb76d05fb0..1cb6447431 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/IndexOfLastTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/IndexOfLastTest.php @@ -79,7 +79,7 @@ public function test_index_of_last_not_found(): void public function test_index_of_last_throws_on_null_needle(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('IndexOfLast function requires non-null string and needle'); + $this->expectExceptionMessageIsOrContains('IndexOfLast function requires non-null string and needle'); new FunctionContext(flow_context())->eval( ref('str')->indexOfLast(ref('needle')), @@ -91,7 +91,7 @@ public function test_index_of_last_throws_on_null_needle(): void public function test_index_of_last_throws_on_null_string(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('IndexOfLast function requires non-null string and needle'); + $this->expectExceptionMessageIsOrContains('IndexOfLast function requires non-null string and needle'); new FunctionContext(flow_context())->eval( ref('str')->indexOfLast('l'), diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/IndexOfTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/IndexOfTest.php index d3a542d4ca..7194b818ef 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/IndexOfTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/IndexOfTest.php @@ -79,7 +79,7 @@ public function test_index_of_is_case_sensitive_by_default(): void public function test_index_of_throws_on_null_needle(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('IndexOf function requires non-null string and needle'); + $this->expectExceptionMessageIsOrContains('IndexOf function requires non-null string and needle'); new FunctionContext(flow_context())->eval( ref('str')->indexOf(ref('needle')), @@ -91,7 +91,7 @@ public function test_index_of_throws_on_null_needle(): void public function test_index_of_throws_on_null_string(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('IndexOf function requires non-null string and needle'); + $this->expectExceptionMessageIsOrContains('IndexOf function requires non-null string and needle'); new FunctionContext(flow_context())->eval( ref('str')->indexOf('x'), diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/IsInTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/IsInTest.php index 95893bfc4e..09ea62b700 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/IsInTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/IsInTest.php @@ -53,7 +53,7 @@ public function test_is_in_accepts_a_container_haystack_without_a_single_element public function test_a_heterogeneous_haystack_casts_every_candidate_to_the_needle_type(): void { $this->expectException(EvaluationException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( "Column \"needle\" value 'a' cannot be cast to integer to compare: \"a\" is not a number (row 0)", ); @@ -132,7 +132,7 @@ public function test_a_number_candidate_widens_with_the_needle(): void public function test_a_candidate_that_does_not_cast_to_the_needle_type_throws(array $haystack): void { $this->expectException(EvaluationException::class); - $this->expectExceptionMessage("value 'x' cannot be cast to integer to compare"); + $this->expectExceptionMessageIsOrContains("value 'x' cannot be cast to integer to compare"); new FunctionContext(flow_context())->eval(ref('n')->isIn(lit($haystack)), ['n' => 1], schema(int_schema('n'))); } @@ -140,7 +140,7 @@ public function test_a_candidate_that_does_not_cast_to_the_needle_type_throws(ar public function test_a_cast_error_names_the_needle_column_read_never_the_alias(): void { $this->expectException(EvaluationException::class); - $this->expectExceptionMessage("Column \"n\" value 'x' cannot be cast to integer to compare"); + $this->expectExceptionMessageIsOrContains("Column \"n\" value 'x' cannot be cast to integer to compare"); new FunctionContext(flow_context())->eval( ref('n')->as('m')->isIn(lit([1])), @@ -152,7 +152,7 @@ public function test_a_cast_error_names_the_needle_column_read_never_the_alias() public function test_is_in_refuses_an_incomparable_element_type(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( "Can't compare '(string == date)' due to data type mismatch - an explicit cast is required.", ); diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/Join/Condition/AllTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/Join/Condition/AllTest.php index c76545ddcc..0727676484 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/Join/Condition/AllTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/Join/Condition/AllTest.php @@ -25,7 +25,7 @@ final class AllTest extends FlowTestCase public function test_from_description_without_comparisons_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage(All::class . ' holds at least one comparison'); + $this->expectExceptionMessageIsOrContains(All::class . ' holds at least one comparison'); All::fromDescription(['comparisons' => []], new Rebuild()); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/Join/Condition/AnyTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/Join/Condition/AnyTest.php index a68628002f..2f59d0f57b 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/Join/Condition/AnyTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/Join/Condition/AnyTest.php @@ -25,7 +25,7 @@ final class AnyTest extends FlowTestCase public function test_from_description_without_comparisons_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage(Any::class . ' holds at least one comparison'); + $this->expectExceptionMessageIsOrContains(Any::class . ' holds at least one comparison'); Any::fromDescription(['comparisons' => []], new Rebuild()); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/Join/Condition/EqualTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/Join/Condition/EqualTest.php index 915abdc1ba..a719545808 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/Join/Condition/EqualTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/Join/Condition/EqualTest.php @@ -85,7 +85,7 @@ public function test_null_is_not_equal_to_value(): void public function test_a_string_that_does_not_cast_to_the_other_side_throws(): void { $this->expectException(EvaluationException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Column "id" value \'f47ac10b-58cc-4372-a567-0e02b2c3d479\' cannot be cast to integer', ); diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/JsonDecodeTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/JsonDecodeTest.php index c469a14969..6a6ccdbce3 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/JsonDecodeTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/JsonDecodeTest.php @@ -71,7 +71,7 @@ public function test_json_with_511_nested_containers_is_decoded(): void public function test_json_with_512_nested_containers_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('JsonDecode error: Maximum stack depth exceeded'); + $this->expectExceptionMessageIsOrContains('JsonDecode error: Maximum stack depth exceeded'); new FunctionContext(flow_context())->eval( ref('value')->jsonDecode(), @@ -83,7 +83,7 @@ public function test_json_with_512_nested_containers_is_refused(): void public function test_json_decode_expression_with_invalid_json(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('JsonDecode error: Syntax error'); + $this->expectExceptionMessageIsOrContains('JsonDecode error: Syntax error'); new FunctionContext(flow_context())->eval( ref('value')->jsonDecode(), @@ -109,7 +109,7 @@ public function test_invalid_json_keeps_the_decoder_error_as_the_cause(): void public function test_json_decode_on_non_json_value(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('JsonDecode function requires string, array, or Json value'); + $this->expectExceptionMessageIsOrContains('JsonDecode function requires string, array, or Json value'); new FunctionContext(flow_context())->eval( ref('value')->jsonDecode(), @@ -121,7 +121,7 @@ public function test_json_decode_on_non_json_value(): void public function test_json_decode_on_scalar_json_throws(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'JsonDecode function requires JSON that decodes to an array, cast scalar JSON instead', ); diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/LeastTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/LeastTest.php index b6f9dde60d..03e0876920 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/LeastTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/LeastTest.php @@ -42,14 +42,14 @@ public function test_a_non_nullable_operand_makes_the_result_not_nullable(): voi public function test_least_with_non_comparable_values(): void { - $this->expectExceptionMessage('Cannot combine types'); + $this->expectExceptionMessageIsOrContains('Cannot combine types'); least(null, 20, lit(new DateTimeImmutable('now')))->returns(); } public function test_an_integer_and_a_string_column_have_no_common_type(): void { - $this->expectExceptionMessage('Cannot combine types "integer", "string"'); + $this->expectExceptionMessageIsOrContains('Cannot combine types "integer", "string"'); least(5, 'apple')->returns(); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/LiteralTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/LiteralTest.php index 870d5c53e2..6e163d8718 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/LiteralTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/LiteralTest.php @@ -25,7 +25,7 @@ final class LiteralTest extends FlowTestCase public function test_constructor_rejects_a_closure_nested_in_an_array(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'A Closure cannot be used as a literal value: pipeline objects must not hold executable state.', ); @@ -35,7 +35,7 @@ public function test_constructor_rejects_a_closure_nested_in_an_array(): void public function test_constructor_rejects_a_closure(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'A Closure cannot be used as a literal value: pipeline objects must not hold executable state.', ); diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/LiteralValueTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/LiteralValueTest.php index 5e7344f019..18128885ac 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/LiteralValueTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/LiteralValueTest.php @@ -118,7 +118,7 @@ public function test_decode_refuses_an_unknown_shape(): void public function test_decode_refuses_a_missing_key(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('A literal value is encoded as {type, value}'); + $this->expectExceptionMessageIsOrContains('A literal value is encoded as {type, value}'); new LiteralValue()->decode(['type' => ['type' => 'integer']]); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/MatchCasesTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/MatchCasesTest.php index 7c88c01308..f9cf61a3f9 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/MatchCasesTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/MatchCasesTest.php @@ -51,7 +51,7 @@ public function test_children_of_keyed_cases_are_a_list(): void public function test_no_matching_case_without_a_default_still_throws(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Not a single case matches row, consider using default parameter'); + $this->expectExceptionMessageIsOrContains('Not a single case matches row, consider using default parameter'); new FunctionContext(flow_context())->eval( match_cases([ @@ -88,7 +88,7 @@ public function test_case_match(): void public function test_not_matching_anything_in_strict_mode(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Not a single case matches row, consider using default parameter, row: {"string":"weirdstring"}', ); @@ -124,7 +124,7 @@ public function test_a_condition_with_a_non_deterministic_branch_is_not_determin public function test_branches_without_a_common_type_refuse_to_declare(): void { $this->expectException(InvalidTypeException::class); - $this->expectExceptionMessage('Cannot combine types'); + $this->expectExceptionMessageIsOrContains('Cannot combine types'); match_cases([match_condition(lit(true), lit(true))], default: lit(new DateTimeImmutable()))->returns(); } @@ -132,7 +132,7 @@ public function test_branches_without_a_common_type_refuse_to_declare(): void public function test_a_condition_that_gives_an_array_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Expected type "boolean", got "array".'); + $this->expectExceptionMessageIsOrContains('Expected type "boolean", got "array".'); new FunctionContext(flow_context())->eval( match_cases([match_condition(ref('list'), lit(1))], default: lit(0)), diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/MathTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/MathTest.php index 2658f8856f..d22b2cc13f 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/MathTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/MathTest.php @@ -36,7 +36,7 @@ public function test_divide(): void public function test_divide_with_null_right_value(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Divide function requires non-null values'); + $this->expectExceptionMessageIsOrContains('Divide function requires non-null values'); new FunctionContext(flow_context())->eval( ref('a')->divide(ref('b')), @@ -48,7 +48,7 @@ public function test_divide_with_null_right_value(): void public function test_divide_by_zero(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Divide function cannot divide by zero'); + $this->expectExceptionMessageIsOrContains('Divide function cannot divide by zero'); new FunctionContext(flow_context())->eval( ref('a')->divide(ref('b')), diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/MinusTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/MinusTest.php index f82bb883b9..c5f83285df 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/MinusTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/MinusTest.php @@ -54,7 +54,7 @@ public function test_integers_stay_integers(): void public function test_integer_overflow_names_its_row(): void { $this->expectException(EvaluationException::class); - $this->expectExceptionMessage('Minus function integer overflow (row 0)'); + $this->expectExceptionMessageIsOrContains('Minus function integer overflow (row 0)'); new FunctionContext(flow_context())->eval( ref('a')->minus(ref('b')), @@ -101,7 +101,7 @@ public function test_a_refusal_message(Backend $backend, array $row, string $mes public function test_exact_refuses_a_null_right_operand(): void { $this->expectException(EvaluationException::class); - $this->expectExceptionMessage('Minus function requires non-null values (row 0)'); + $this->expectExceptionMessageIsOrContains('Minus function requires non-null values (row 0)'); new FunctionContext(flow_context())->eval( ref('a')->minus(ref('b'), exact: true), @@ -113,7 +113,7 @@ public function test_exact_refuses_a_null_right_operand(): void public function test_a_non_numeric_right_operand_refuses_to_declare(): void { $this->expectException(InvalidTypeException::class); - $this->expectExceptionMessage('Cannot combine types "integer", "string"'); + $this->expectExceptionMessageIsOrContains('Cannot combine types "integer", "string"'); lit(1)->minus(lit('a'))->returns(); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ModifyDateTimeTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ModifyDateTimeTest.php index 1b0fc41b63..a9e145558c 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ModifyDateTimeTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ModifyDateTimeTest.php @@ -53,7 +53,7 @@ public function test_modify_datetime(): void public function test_modify_using_invalid_modifier(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Expected type "string", got "integer".'); + $this->expectExceptionMessageIsOrContains('Expected type "string", got "integer".'); new FunctionContext(flow_context())->eval( ref('datetime')->modifyDateTime(lit(1)), @@ -67,7 +67,7 @@ public function test_modify_using_invalid_modifier(): void public function test_a_null_modifier_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('ModifyDateTime function requires non-null values'); + $this->expectExceptionMessageIsOrContains('ModifyDateTime function requires non-null values'); new FunctionContext(flow_context())->eval( ref('datetime')->modifyDateTime(ref('modifier')), diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/MultiplyTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/MultiplyTest.php index e5b8c23c14..f3bfe633ab 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/MultiplyTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/MultiplyTest.php @@ -53,7 +53,7 @@ public function test_integers_stay_integers(): void public function test_integer_overflow_names_its_row(): void { $this->expectException(EvaluationException::class); - $this->expectExceptionMessage('Multiply function integer overflow (row 0)'); + $this->expectExceptionMessageIsOrContains('Multiply function integer overflow (row 0)'); new FunctionContext(flow_context())->eval( ref('a')->multiply(ref('b')), @@ -100,7 +100,7 @@ public function test_a_refusal_message(Backend $backend, array $row, string $mes public function test_exact_refuses_a_null_right_operand(): void { $this->expectException(EvaluationException::class); - $this->expectExceptionMessage('Multiply function requires non-null values (row 0)'); + $this->expectExceptionMessageIsOrContains('Multiply function requires non-null values (row 0)'); new FunctionContext(flow_context())->eval( ref('a')->multiply(ref('b'), exact: true), @@ -112,7 +112,7 @@ public function test_exact_refuses_a_null_right_operand(): void public function test_a_non_numeric_right_operand_refuses_to_declare(): void { $this->expectException(InvalidTypeException::class); - $this->expectExceptionMessage('Cannot combine types "integer", "string"'); + $this->expectExceptionMessageIsOrContains('Cannot combine types "integer", "string"'); lit(1)->multiply(lit('a'))->returns(); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/MultisetHashTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/MultisetHashTest.php index fb2d3e7f86..3634b0e70d 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/MultisetHashTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/MultisetHashTest.php @@ -150,7 +150,7 @@ public function test_an_unresolved_reference_leaves_the_hash_unresolved(): void public function test_with_children_refuses_another_number_of_children(): void { $this->expectException(InvalidLogicException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'multiset_hash() has 1 reference children; withChildren() must receive them back.', ); @@ -160,7 +160,9 @@ public function test_with_children_refuses_another_number_of_children(): void public function test_a_named_column_the_batch_lacks_is_refused_with_a_suggestion(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Schema definition for column "emal" not found. Did you mean one of: [email]?'); + $this->expectExceptionMessageIsOrContains( + 'Schema definition for column "emal" not found. Did you mean one of: [email]?', + ); multiset_hash(ref('emal')) ->aggregate(array_to_rows([['email' => 'x']], schema(str_schema('email'))), [0], new PhpBackend()); diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/MultisetHashesByGroupTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/MultisetHashesByGroupTest.php index f9c09bb62d..13300d0cbb 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/MultisetHashesByGroupTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/MultisetHashesByGroupTest.php @@ -86,7 +86,7 @@ public function test_it_absorbs_only_grouped_multiset_hashes(): void $backend = new PhpBackend(); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Grouped multiset hashes absorb only other grouped multiset hashes'); + $this->expectExceptionMessageIsOrContains('Grouped multiset hashes absorb only other grouped multiset hashes'); new MultisetHashesByGroup([], $backend->groupedMultisetHashes(HashAlgorithm::xxh128))->absorbEarlier( new CountsByGroup(null, $backend->groupedCounts()), @@ -103,7 +103,9 @@ public function test_a_named_column_the_batch_lacks_is_refused_with_a_suggestion $hashes = new MultisetHashesByGroup(['valu'], $backend->groupedMultisetHashes(HashAlgorithm::xxh128)); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Schema definition for column "valu" not found. Did you mean one of: [value]?'); + $this->expectExceptionMessageIsOrContains( + 'Schema definition for column "valu" not found. Did you mean one of: [value]?', + ); $hashes->aggregateGroups($rows, $backend->groupTable(['g'], $schema)->assign($rows), $backend); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/NowTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/NowTest.php index 2d72160ff0..f72159b42a 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/NowTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/NowTest.php @@ -68,7 +68,7 @@ public function test_function_zone_value_is_in_the_declared_zone(): void public function test_function_zone_null_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Now function requires valid DateTimeZone'); + $this->expectExceptionMessageIsOrContains('Now function requires valid DateTimeZone'); new FunctionContext(flow_context())->eval( now(ref('tz')), diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/NumberFormatTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/NumberFormatTest.php index 292a8a7e31..9c5d759665 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/NumberFormatTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/NumberFormatTest.php @@ -54,7 +54,7 @@ public function test_number_format_dsl(): void public function test_number_format_on_decimals_that_are_not_integer(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Expected type "integer", got "float".'); + $this->expectExceptionMessageIsOrContains('Expected type "integer", got "float".'); new FunctionContext(flow_context())->eval( new NumberFormat(ref('value'), ref('decimals'), ref('decimal_separator'), ref('thousands_separator')), @@ -84,7 +84,7 @@ public function test_number_format_on_null_parameter( ?string $thousandsSeparator, ): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('NumberFormat function requires non-null values'); + $this->expectExceptionMessageIsOrContains('NumberFormat function requires non-null values'); new FunctionContext(flow_context())->eval( new NumberFormat(ref('value'), ref('decimals'), ref('decimal_separator'), ref('thousands_separator')), @@ -106,7 +106,7 @@ public function test_number_format_on_null_parameter( public function test_number_format_on_non_int_entry(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Expected type "numeric", got "string".'); + $this->expectExceptionMessageIsOrContains('Expected type "numeric", got "string".'); new FunctionContext(flow_context())->eval( new NumberFormat(ref('value'), ref('decimals'), ref('decimal_separator'), ref('thousands_separator')), diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/OnEachElementSchemaTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/OnEachElementSchemaTest.php index 2085d1a8bd..1693b7d4eb 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/OnEachElementSchemaTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/OnEachElementSchemaTest.php @@ -78,7 +78,9 @@ public function test_a_structure_whose_fields_do_not_unify_is_refused(): void public function test_an_operand_with_no_element_type_is_refused(): void { $this->expectException(SchemaNotDerivableException::class); - $this->expectExceptionMessage('the array operand declares "array", which has no element type'); + $this->expectExceptionMessageIsOrContains( + 'the array operand declares "array", which has no element type', + ); new OnEachElementSchema()->of(type_array()); } @@ -86,7 +88,7 @@ public function test_an_operand_with_no_element_type_is_refused(): void public function test_a_scalar_operand_is_refused(): void { $this->expectException(SchemaNotDerivableException::class); - $this->expectExceptionMessage('the array operand declares "float", which has no element type'); + $this->expectExceptionMessageIsOrContains('the array operand declares "float", which has no element type'); new OnEachElementSchema()->of(type_float()); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/OnEachTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/OnEachTest.php index f3f41618e4..b9e4c491ea 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/OnEachTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/OnEachTest.php @@ -51,7 +51,7 @@ final class OnEachTest extends FlowTestCase public function test_a_throwing_body_is_not_swallowed(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Expected type "string", got "integer"'); + $this->expectExceptionMessageIsOrContains('Expected type "string", got "integer"'); new FunctionContext(flow_context())->eval( new ReferenceResolver()->resolve( @@ -182,7 +182,7 @@ public function test_on_each_over_an_untyped_array_operand_is_refused(): void // an ArrayType column is declared by a JsonDefinition, so this is what an untyped array // operand reaches on_each() as - either way it carries no element type $this->expectException(SchemaNotDerivableException::class); - $this->expectExceptionMessage('the array operand declares "json", which has no element type'); + $this->expectExceptionMessageIsOrContains('the array operand declares "json", which has no element type'); new FunctionContext(flow_context())->eval( new ReferenceResolver()->resolve( @@ -289,7 +289,7 @@ public function test_a_structure_with_non_unifying_fields_refuses_to_declare(): public function test_an_expand_in_the_body_is_refused_when_the_expression_is_built(ScalarFunction $body): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'onEach() cannot contain array_expand(), it turns one row into many rows. Expand with withColumn() first, then use the new column.', ); @@ -308,7 +308,7 @@ public static function bodies_holding_an_expand(): Generator public function test_a_null_array_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('OnEach requires non-null array'); + $this->expectExceptionMessageIsOrContains('OnEach requires non-null array'); new FunctionContext(flow_context())->eval( ref('tags')->onEach(ref('element')), diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ParameterTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ParameterTest.php index aff7894757..f5287f9ae2 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ParameterTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ParameterTest.php @@ -638,7 +638,7 @@ public function test_as_types_propagates_null(): void public function test_as_types_throws_when_no_type_matches(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Expected one of "integer", "boolean", got "string". (row 0)'); + $this->expectExceptionMessageIsOrContains('Expected one of "integer", "boolean", got "string". (row 0)'); new Parameter(new ReferenceResolver()->resolve( ref('value'), diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/PlusTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/PlusTest.php index df09a2e95e..2c24c7baf1 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/PlusTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/PlusTest.php @@ -54,7 +54,7 @@ public function test_integers_stay_integers(): void public function test_integer_overflow_names_its_row(): void { $this->expectException(EvaluationException::class); - $this->expectExceptionMessage('Plus function integer overflow (row 0)'); + $this->expectExceptionMessageIsOrContains('Plus function integer overflow (row 0)'); new FunctionContext(flow_context())->eval( ref('a')->plus(ref('b')), @@ -102,7 +102,7 @@ public function test_a_refusal_message(Backend $backend, array $row, string $mes public function test_a_non_numeric_right_operand_refuses_to_declare(): void { $this->expectException(InvalidTypeException::class); - $this->expectExceptionMessage('Cannot combine types "integer", "string"'); + $this->expectExceptionMessageIsOrContains('Cannot combine types "integer", "string"'); lit(1)->plus(lit('a'))->returns(); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/PowerTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/PowerTest.php index 079010e971..ec0e4a0f76 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/PowerTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/PowerTest.php @@ -24,7 +24,7 @@ final class PowerTest extends FlowTestCase public function test_power_non_numeric_values(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Expected type "integer", got "string".'); + $this->expectExceptionMessageIsOrContains('Expected type "integer", got "string".'); new FunctionContext(flow_context())->eval( ref('int')->power(lit('non numeric')), @@ -68,7 +68,9 @@ public function test_floats_use_ieee_arithmetic(): void public function test_a_negative_exponent_of_an_integer_is_refused(): void { $this->expectException(EvaluationException::class); - $this->expectExceptionMessage('Power function of an integer requires a non-negative exponent (row 0)'); + $this->expectExceptionMessageIsOrContains( + 'Power function of an integer requires a non-negative exponent (row 0)', + ); new FunctionContext(flow_context())->eval( ref('a')->power(ref('b')), @@ -89,7 +91,7 @@ public function test_a_zero_exponent_of_an_integer_is_one(): void public function test_a_null_exponent_is_refused(): void { $this->expectException(EvaluationException::class); - $this->expectExceptionMessage('Power function requires non-null values (row 0)'); + $this->expectExceptionMessageIsOrContains('Power function requires non-null values (row 0)'); new FunctionContext(flow_context())->eval( ref('a')->power(ref('b')), @@ -115,7 +117,7 @@ public function test_exact_evaluates_every_row(): void public function test_a_non_numeric_exponent_refuses_to_declare(): void { $this->expectException(InvalidTypeException::class); - $this->expectExceptionMessage('Cannot combine types "integer", "string"'); + $this->expectExceptionMessageIsOrContains('Cannot combine types "integer", "string"'); lit(2)->power(lit('a'))->returns(); } @@ -128,7 +130,7 @@ public function test_a_float_exponent_declares_float(): void public function test_integer_overflow_names_its_row(): void { $this->expectException(EvaluationException::class); - $this->expectExceptionMessage('Power function integer overflow (row 0)'); + $this->expectExceptionMessageIsOrContains('Power function integer overflow (row 0)'); new FunctionContext(flow_context())->eval( ref('a')->power(ref('b')), diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/PrependTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/PrependTest.php index 92f3a66c0f..000d9046be 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/PrependTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/PrependTest.php @@ -68,7 +68,7 @@ public function test_prepend_with_null_prefix_keeps_the_next_rows(): void public function test_prepend_with_null_value(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Prepend function requires non-null value'); + $this->expectExceptionMessageIsOrContains('Prepend function requires non-null value'); static::assertNull(new FunctionContext(flow_context())->eval( ref('str')->prepend('Hello '), diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/RankTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/RankTest.php index e87dba66df..2653b4bed2 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/RankTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/RankTest.php @@ -66,7 +66,7 @@ public function test_rank_over_multiple_order_columns(): void public function test_rank_requires_an_order_by(): void { - $this->expectExceptionMessage('Rank window function requires to be ordered by one column'); + $this->expectExceptionMessageIsOrContains('Rank window function requires to be ordered by one column'); rank() ->over(window()) @@ -79,7 +79,7 @@ public function test_rank_requires_an_order_by(): void public function test_rank_without_over_clause(): void { - $this->expectExceptionMessage('Window function "rank()" requires an OVER clause.'); + $this->expectExceptionMessageIsOrContains('Window function "rank()" requires an OVER clause.'); rank()->values(RankingContext::salariesDescending(), flow_context()->backend(), new VoidProgress()); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ReferenceResolverTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ReferenceResolverTest.php index 564ea3fd54..8f8695bd4d 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ReferenceResolverTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ReferenceResolverTest.php @@ -161,7 +161,7 @@ public function test_an_exists_operand_is_not_walked(): void public function test_an_impossible_comparison_fails_at_bind(): void { // Until 04b wires the DataFrame bind, the bind moment is resolve() + returns(). - $this->expectExceptionMessage("Can't compare"); + $this->expectExceptionMessageIsOrContains("Can't compare"); /** @var ScalarFunction $predicate */ $predicate = new ReferenceResolver()->resolve( @@ -174,7 +174,9 @@ public function test_an_impossible_comparison_fails_at_bind(): void public function test_assert_resolved_names_the_column_and_the_available_ones(): void { $this->expectException(SchemaDefinitionNotFoundException::class); - $this->expectExceptionMessage('Schema definition for column "scoree" not found. Did you mean one of: [score]?'); + $this->expectExceptionMessageIsOrContains( + 'Schema definition for column "scoree" not found. Did you mean one of: [score]?', + ); $schema = schema(int_schema('id'), int_schema('score')); @@ -225,7 +227,7 @@ public function test_bind_refuses_an_unknown_column(): void public function test_bind_refuses_an_expansion_naming_the_method(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('over() cannot contain array_expand()'); + $this->expectExceptionMessageIsOrContains('over() cannot contain array_expand()'); new ReferenceResolver()->bind( array_expand(ref('list')), @@ -237,7 +239,7 @@ public function test_bind_refuses_an_expansion_naming_the_method(): void public function test_bind_refuses_a_result_of_another_type_than_required(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('until() requires a predicate returning boolean'); + $this->expectExceptionMessageIsOrContains('until() requires a predicate returning boolean'); new ReferenceResolver()->bind(ref('id'), schema(int_schema('id')), 'until', type_boolean()); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/RegexAllTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/RegexAllTest.php index 0f213c474d..5cac82449c 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/RegexAllTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/RegexAllTest.php @@ -25,7 +25,7 @@ final class RegexAllTest extends FlowTestCase public function test_regex_all_expression_on_invalid_subject(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Expected type "string", got "integer".'); + $this->expectExceptionMessageIsOrContains('Expected type "string", got "integer".'); new FunctionContext(flow_context())->eval(regex_all(lit('/\d+/'), lit(2)), [], schema()); } @@ -61,7 +61,7 @@ public function test_regex_all_expression_on_valid_strings(): void public function test_a_flag_that_changes_the_result_shape_is_refused(int $flag): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'RegexAll does not support PREG_OFFSET_CAPTURE, PREG_UNMATCHED_AS_NULL or PREG_SET_ORDER flags', ); @@ -79,7 +79,7 @@ public function test_the_default_offset_starts_at_the_beginning(): void public function test_a_null_subject_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('RegexAll requires non-null subject'); + $this->expectExceptionMessageIsOrContains('RegexAll requires non-null subject'); new FunctionContext(flow_context())->eval( regex_all(lit('/a/'), ref('subject')), @@ -105,7 +105,7 @@ public function test_every_matching_row_gives_its_matches(): void public function test_regex_expression_on_invalid_pattern(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Expected type "string", got "integer".'); + $this->expectExceptionMessageIsOrContains('Expected type "string", got "integer".'); new FunctionContext(flow_context())->eval(regex_all(lit(1), lit('12 apples and 45 oranges')), [], schema()); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/RegexMatchAllTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/RegexMatchAllTest.php index 4ebeb2e69f..c68a8cf384 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/RegexMatchAllTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/RegexMatchAllTest.php @@ -21,7 +21,7 @@ final class RegexMatchAllTest extends FlowTestCase public function test_regex_match_all_expression_on_invalid_flags(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Expected type "integer", got "string".'); + $this->expectExceptionMessageIsOrContains('Expected type "integer", got "string".'); new FunctionContext(flow_context())->eval( regex_match_all(lit('/\d+/'), lit('12 apples and 45 oranges'), lit('invalid')), @@ -33,7 +33,7 @@ public function test_regex_match_all_expression_on_invalid_flags(): void public function test_regex_match_all_expression_on_invalid_pattern(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Expected type "string", got "integer".'); + $this->expectExceptionMessageIsOrContains('Expected type "string", got "integer".'); new FunctionContext(flow_context())->eval( regex_match_all(lit(1), lit('12 apples and 45 oranges')), @@ -45,7 +45,7 @@ public function test_regex_match_all_expression_on_invalid_pattern(): void public function test_regex_match_all_expression_on_invalid_subject(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Expected type "string", got "integer".'); + $this->expectExceptionMessageIsOrContains('Expected type "string", got "integer".'); new FunctionContext(flow_context())->eval(regex_match_all(lit('/\d+/'), lit(2)), [], schema()); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/RegexMatchTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/RegexMatchTest.php index 7e803afedc..176ea66445 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/RegexMatchTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/RegexMatchTest.php @@ -21,7 +21,7 @@ final class RegexMatchTest extends FlowTestCase public function test_regex_match_expression_on_invalid_pattern(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Expected type "string", got "integer".'); + $this->expectExceptionMessageIsOrContains('Expected type "string", got "integer".'); new FunctionContext(flow_context())->eval(regex_match(lit(1), lit('12 apples and 45 oranges')), [], schema()); } @@ -29,7 +29,7 @@ public function test_regex_match_expression_on_invalid_pattern(): void public function test_regex_match_expression_on_invalid_subject(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Expected type "string", got "integer".'); + $this->expectExceptionMessageIsOrContains('Expected type "string", got "integer".'); new FunctionContext(flow_context())->eval(regex_match(lit('/\d+/'), lit(2)), [], schema()); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/RegexReplaceTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/RegexReplaceTest.php index 9d7d0b56e8..d45c137406 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/RegexReplaceTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/RegexReplaceTest.php @@ -43,7 +43,7 @@ public function test_a_limit_caps_the_replacements(): void public function test_regex_replace_on_invalid_pattern(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Expected type "string", got "integer".'); + $this->expectExceptionMessageIsOrContains('Expected type "string", got "integer".'); new FunctionContext(flow_context())->eval( regex_replace(lit(1), lit('bar'), lit('foo is awesome')), @@ -55,7 +55,7 @@ public function test_regex_replace_on_invalid_pattern(): void public function test_regex_replace_on_invalid_replacement(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Expected type "string", got "integer".'); + $this->expectExceptionMessageIsOrContains('Expected type "string", got "integer".'); new FunctionContext(flow_context())->eval( regex_replace(lit('/(foo)/'), lit(2), lit('foo is awesome')), @@ -67,7 +67,7 @@ public function test_regex_replace_on_invalid_replacement(): void public function test_regex_replace_on_invalid_subject(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Expected type "string", got "integer".'); + $this->expectExceptionMessageIsOrContains('Expected type "string", got "integer".'); new FunctionContext(flow_context())->eval(regex_replace(lit('/(foo)/'), lit('bar'), lit(3)), [], schema()); } @@ -84,7 +84,7 @@ public function test_the_limit_survives_a_describe_round_trip(): void public function test_a_null_subject_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('RegexReplace requires non-null subject'); + $this->expectExceptionMessageIsOrContains('RegexReplace requires non-null subject'); new FunctionContext(flow_context())->eval( regex_replace(lit('/a/'), lit('b'), ref('subject')), diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/RegexTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/RegexTest.php index b8362edb3f..a99de3e145 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/RegexTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/RegexTest.php @@ -30,7 +30,7 @@ final class RegexTest extends FlowTestCase public function test_regex_expression_on_invalid_pattern(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Expected type "string", got "integer".'); + $this->expectExceptionMessageIsOrContains('Expected type "string", got "integer".'); new FunctionContext(flow_context())->eval(regex(lit(1), lit('12 apples and 45 oranges')), [], schema()); } @@ -38,7 +38,7 @@ public function test_regex_expression_on_invalid_pattern(): void public function test_regex_expression_on_invalid_subject(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Expected type "string", got "integer".'); + $this->expectExceptionMessageIsOrContains('Expected type "string", got "integer".'); new FunctionContext(flow_context())->eval(regex(lit('/\d+/'), lit(2)), [], schema()); } @@ -63,7 +63,7 @@ public function test_regex_expression_on_a_match_at_the_start(): void public function test_regex_expression_on_null_subject(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Regex requires non-null subject'); + $this->expectExceptionMessageIsOrContains('Regex requires non-null subject'); new FunctionContext(flow_context())->eval( regex(lit('/a/'), ref('subject')), @@ -75,7 +75,9 @@ public function test_regex_expression_on_null_subject(): void public function test_regex_refuses_unmatched_as_null_flag(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Regex does not support PREG_OFFSET_CAPTURE or PREG_UNMATCHED_AS_NULL flags'); + $this->expectExceptionMessageIsOrContains( + 'Regex does not support PREG_OFFSET_CAPTURE or PREG_UNMATCHED_AS_NULL flags', + ); new Regex(lit('/a/'), lit('a'), PREG_UNMATCHED_AS_NULL, 0); } @@ -114,7 +116,7 @@ public function test_a_description_rebuilds_through_the_constructor_checks(): vo ]; $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Regex does not support PREG_OFFSET_CAPTURE'); + $this->expectExceptionMessageIsOrContains('Regex does not support PREG_OFFSET_CAPTURE'); new Rebuild()->of($data, ScalarFunction::class); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/RepeatTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/RepeatTest.php index 39527f32c2..9b8887bc26 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/RepeatTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/RepeatTest.php @@ -28,7 +28,7 @@ public function test_repeat_empty_string(): void public function test_repeat_negative_times(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Repeat function requires non-null, positive times'); + $this->expectExceptionMessageIsOrContains('Repeat function requires non-null, positive times'); new FunctionContext(flow_context())->eval( ref('str')->repeat(-1), @@ -40,7 +40,7 @@ public function test_repeat_negative_times(): void public function test_repeat_null_input(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Repeat function requires non-null value'); + $this->expectExceptionMessageIsOrContains('Repeat function requires non-null value'); new FunctionContext(flow_context())->eval( ref('str')->repeat(3), @@ -61,7 +61,7 @@ public function test_repeat_string_multiple_times(): void public function test_repeat_with_null_times(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Repeat function requires non-null, positive times'); + $this->expectExceptionMessageIsOrContains('Repeat function requires non-null, positive times'); new FunctionContext(flow_context())->eval( ref('str')->repeat(ref('times')), @@ -82,7 +82,7 @@ public function test_repeat_with_scalar_function_times(): void public function test_repeat_zero_times(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Repeat function requires non-null, positive times'); + $this->expectExceptionMessageIsOrContains('Repeat function requires non-null, positive times'); new FunctionContext(flow_context())->eval(ref('str')->repeat(0), ['str' => 'hello'], schema(str_schema('str'))); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ReverseTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ReverseTest.php index fe316f1bab..af7c41c814 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ReverseTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ReverseTest.php @@ -36,7 +36,7 @@ public function test_reverse_empty_string(): void public function test_reverse_throws_on_null_input(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Reverse function requires non-null value'); + $this->expectExceptionMessageIsOrContains('Reverse function requires non-null value'); new FunctionContext(flow_context())->eval( ref('str')->reverse(), diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/RoundTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/RoundTest.php index 684413e78b..8ffa2d9376 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/RoundTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/RoundTest.php @@ -75,7 +75,7 @@ public function test_half_odd_is_the_last_known_mode(): void public function test_an_unknown_mode_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Round mode 9 is unknown, use PHP_ROUND_HALF_UP (1), PHP_ROUND_HALF_DOWN (2), PHP_ROUND_HALF_EVEN (3) or PHP_ROUND_HALF_ODD (4)', ); @@ -85,7 +85,7 @@ public function test_an_unknown_mode_is_refused(): void public function test_round_on_null(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Round function requires non-null values'); + $this->expectExceptionMessageIsOrContains('Round function requires non-null values'); new FunctionContext(flow_context())->eval( ref('float')->round(lit(2)), @@ -97,7 +97,7 @@ public function test_round_on_null(): void public function test_a_null_precision_is_refused(): void { $this->expectException(EvaluationException::class); - $this->expectExceptionMessage('Round function requires non-null values (row 0)'); + $this->expectExceptionMessageIsOrContains('Round function requires non-null values (row 0)'); new FunctionContext(flow_context())->eval( ref('value')->round(ref('precision')), diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/RowHashTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/RowHashTest.php index ed3f0165a7..0e7ceed097 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/RowHashTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/RowHashTest.php @@ -80,7 +80,9 @@ public function test_a_renamed_column_gives_another_hash(): void public function test_a_reference_the_batch_lacks_is_refused_with_a_suggestion(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Schema definition for column "emal" not found. Did you mean one of: [email]?'); + $this->expectExceptionMessageIsOrContains( + 'Schema definition for column "emal" not found. Did you mean one of: [email]?', + ); row_hash(ref('a'), ref('emal'))->eval( array_to_rows([['a' => 1, 'email' => 'x']], schema(int_schema('a'), str_schema('email'))), @@ -121,7 +123,7 @@ public function test_it_returns_a_not_null_string(): void public function test_it_needs_at_least_one_reference(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('row_hash() needs at least one column reference'); + $this->expectExceptionMessageIsOrContains('row_hash() needs at least one column reference'); new RowHash([]); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/SanitizeTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/SanitizeTest.php index 4eddfec2b5..8c31dce8be 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/SanitizeTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/SanitizeTest.php @@ -21,7 +21,7 @@ final class SanitizeTest extends FlowTestCase public function test_sanitize_on_non_string_value(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Expected type "string", got "integer".'); + $this->expectExceptionMessageIsOrContains('Expected type "string", got "integer".'); new FunctionContext(flow_context())->eval( ref('value')->sanitize(), @@ -69,7 +69,7 @@ public function test_sanitize_on_valid_string_with_placeholder(): void public function test_sanitize_on_null(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Sanitize function requires non-null value'); + $this->expectExceptionMessageIsOrContains('Sanitize function requires non-null value'); new FunctionContext(flow_context())->eval( ref('value')->sanitize(), diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/SlugTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/SlugTest.php index b3aa647bb2..f73b19fa11 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/SlugTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/SlugTest.php @@ -30,7 +30,7 @@ public function test_a_malformed_separator_operand_throws(): void public function test_ascii_on_null(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Slug function requires non-null value'); + $this->expectExceptionMessageIsOrContains('Slug function requires non-null value'); new FunctionContext(flow_context())->eval( ref('str')->slug(), diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/SplitTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/SplitTest.php index ae9452dce5..8ae2cb7c4e 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/SplitTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/SplitTest.php @@ -22,7 +22,7 @@ final class SplitTest extends FlowTestCase public function test_split_not_string(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Expected type "string", got "integer".'); + $this->expectExceptionMessageIsOrContains('Expected type "string", got "integer".'); new FunctionContext(flow_context())->eval(split(lit(123), ','), [], schema()); } @@ -46,7 +46,7 @@ public function test_split_string_with_limit(): void public function test_split_on_null(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Split function requires non-null value'); + $this->expectExceptionMessageIsOrContains('Split function requires non-null value'); new FunctionContext(flow_context())->eval( split(ref('value'), ','), @@ -58,7 +58,7 @@ public function test_split_on_null(): void public function test_a_null_separator_is_refused(): void { $this->expectException(EvaluationException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Split function requires non-null separator and limit, separator cannot be empty (row 0)', ); @@ -72,7 +72,7 @@ public function test_a_null_separator_is_refused(): void public function test_a_null_limit_is_refused(): void { $this->expectException(EvaluationException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Split function requires non-null separator and limit, separator cannot be empty (row 0)', ); diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/SprintfTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/SprintfTest.php index 6de0a9d76b..f4f6822de2 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/SprintfTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/SprintfTest.php @@ -25,7 +25,7 @@ final class SprintfTest extends FlowTestCase public function test_sprintf_expression_on_invalid_format(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Expected type "string", got "integer".'); + $this->expectExceptionMessageIsOrContains('Expected type "string", got "integer".'); new FunctionContext(flow_context())->eval(sprintf(lit(1), lit('John'), lit(25)), [], schema()); } @@ -53,7 +53,7 @@ public function test_children_are_the_format_and_every_value_as_a_list(): void public function test_a_null_value_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Sprintf requires non-null format and values'); + $this->expectExceptionMessageIsOrContains('Sprintf requires non-null format and values'); new FunctionContext(flow_context())->eval( sprintf(lit('%s'), ref('value')), diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StrPadTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StrPadTest.php index b04281d2d0..a49ed05076 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StrPadTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StrPadTest.php @@ -29,7 +29,7 @@ public function test_str_pad_on_valid_string(): void public function test_str_pad_on_null(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('StrPad function requires non-null value'); + $this->expectExceptionMessageIsOrContains('StrPad function requires non-null value'); new FunctionContext(flow_context())->eval( ref('value')->strPad(5, '-', STR_PAD_LEFT), diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StrReplaceTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StrReplaceTest.php index 66219a7518..27c258e0c7 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StrReplaceTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StrReplaceTest.php @@ -37,7 +37,7 @@ public function test_str_replace_on_valid_string_with_array_of_replacements(): v public function test_str_replace_on_null(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('StrReplace function requires non-null value'); + $this->expectExceptionMessageIsOrContains('StrReplace function requires non-null value'); new FunctionContext(flow_context())->eval( ref('value')->strReplace('test', '1'), @@ -49,7 +49,7 @@ public function test_str_replace_on_null(): void public function test_a_null_search_is_refused(): void { $this->expectException(EvaluationException::class); - $this->expectExceptionMessage('StrReplace function requires non-null search and replace (row 0)'); + $this->expectExceptionMessageIsOrContains('StrReplace function requires non-null search and replace (row 0)'); new FunctionContext(flow_context())->eval( ref('value')->strReplace(ref('search'), 'x'), diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringAfterLastTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringAfterLastTest.php index 4055480e2d..249f57e7e3 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringAfterLastTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringAfterLastTest.php @@ -55,7 +55,7 @@ public function test_string_after_last_including_needle(): void public function test_string_after_last_throws_on_null_input(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('StringAfterLast function requires non-null value'); + $this->expectExceptionMessageIsOrContains('StringAfterLast function requires non-null value'); new FunctionContext(flow_context())->eval( ref('str')->stringAfterLast('x'), diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringAfterTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringAfterTest.php index 99d4d2f9dd..7915504782 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringAfterTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringAfterTest.php @@ -61,7 +61,7 @@ public function test_string_after_including_needle(): void public function test_string_after_throws_on_null_input(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('StringAfter function requires non-null value'); + $this->expectExceptionMessageIsOrContains('StringAfter function requires non-null value'); new FunctionContext(flow_context())->eval( ref('str')->stringAfter('x'), diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringBeforeLastTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringBeforeLastTest.php index e818eff821..e592b4e51e 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringBeforeLastTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringBeforeLastTest.php @@ -55,7 +55,7 @@ public function test_string_before_last_returns_empty_string(): void public function test_string_before_last_throws_on_null_input(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('StringBeforeLast function requires non-null value'); + $this->expectExceptionMessageIsOrContains('StringBeforeLast function requires non-null value'); new FunctionContext(flow_context())->eval( ref('str')->stringBeforeLast(ref('needle')), diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringBeforeTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringBeforeTest.php index e455af044c..9fc64daafe 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringBeforeTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringBeforeTest.php @@ -61,7 +61,7 @@ public function test_string_before_returns_empty_string(): void public function test_string_before_throws_on_null_input(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('StringBefore function requires non-null value'); + $this->expectExceptionMessageIsOrContains('StringBefore function requires non-null value'); new FunctionContext(flow_context())->eval( ref('str')->stringBefore(ref('needle')), diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringContainsAnyTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringContainsAnyTest.php index 79dc91acf8..3f27035e04 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringContainsAnyTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringContainsAnyTest.php @@ -37,7 +37,7 @@ public function test_a_null_row_does_not_stop_later_rows(): void public function test_contains_any_empty_needles_array(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('StringContainsAny function requires a non-empty needles array'); + $this->expectExceptionMessageIsOrContains('StringContainsAny function requires a non-empty needles array'); new FunctionContext(flow_context())->eval( ref('str')->stringContainsAny([]), diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringFoldTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringFoldTest.php index 18438c9be6..9db19d2e88 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringFoldTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringFoldTest.php @@ -27,7 +27,7 @@ public function test_string_folded(): void public function test_string_fold_throws_on_null_input(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('StringFold function requires non-null value'); + $this->expectExceptionMessageIsOrContains('StringFold function requires non-null value'); new FunctionContext(flow_context())->eval( ref('str')->stringFold(), diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringMatchAllTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringMatchAllTest.php index a791325c36..27bb14a09d 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringMatchAllTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringMatchAllTest.php @@ -54,7 +54,7 @@ public function test_no_matches_found(): void public function test_null_haystack(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('StringMatchAll function requires non-null haystack'); + $this->expectExceptionMessageIsOrContains('StringMatchAll function requires non-null haystack'); new FunctionContext(flow_context())->eval( ref('str')->stringMatchAll('/hello/'), @@ -66,7 +66,7 @@ public function test_null_haystack(): void public function test_null_pattern(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('StringMatchAll function requires non-null pattern'); + $this->expectExceptionMessageIsOrContains('StringMatchAll function requires non-null pattern'); new FunctionContext(flow_context())->eval( ref('str')->stringMatchAll(ref('pattern')), diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringMatchTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringMatchTest.php index e17ffa9f2f..8c9424b47d 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringMatchTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringMatchTest.php @@ -29,7 +29,7 @@ public function test_no_matches_found(): void public function test_null_haystack(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('StringMatch function requires non-null haystack'); + $this->expectExceptionMessageIsOrContains('StringMatch function requires non-null haystack'); static::assertNull(new FunctionContext(flow_context())->eval( ref('str')->stringMatch('/hello/'), @@ -41,7 +41,7 @@ public function test_null_haystack(): void public function test_null_pattern(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('StringMatch function requires non-null pattern'); + $this->expectExceptionMessageIsOrContains('StringMatch function requires non-null pattern'); static::assertNull(new FunctionContext(flow_context())->eval( ref('str')->stringMatch(ref('pattern')), diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringNormalizeTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringNormalizeTest.php index 71957a6a6c..57679a9132 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringNormalizeTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringNormalizeTest.php @@ -77,7 +77,7 @@ public function test_normalize_nfd(): void public function test_normalize_throws_on_null_input(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('StringNormalize function requires non-null value'); + $this->expectExceptionMessageIsOrContains('StringNormalize function requires non-null value'); new FunctionContext(flow_context())->eval( ref('str')->stringNormalize(), diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringStyleTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringStyleTest.php index 7cec290092..bb39df638a 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringStyleTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringStyleTest.php @@ -21,7 +21,7 @@ final class StringStyleTest extends FlowTestCase public function test_a_null_value_throws(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('StringStyle function requires non-null value'); + $this->expectExceptionMessageIsOrContains('StringStyle function requires non-null value'); new FunctionContext(flow_context())->eval( ref('value')->stringStyle(StringStyles::LOWER), diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringTitleTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringTitleTest.php index dd57918fc0..592c2326e8 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringTitleTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringTitleTest.php @@ -46,7 +46,7 @@ public function test_string_title_allwords(): void public function test_string_title_throws_on_null_input(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('StringTitle function requires non-null value'); + $this->expectExceptionMessageIsOrContains('StringTitle function requires non-null value'); new FunctionContext(flow_context())->eval( ref('str')->stringTitle(), diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringWidthTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringWidthTest.php index 309da28778..3d8116132d 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringWidthTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StringWidthTest.php @@ -36,7 +36,7 @@ public function test_width_empty_string(): void public function test_width_throws_on_null_input(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('StringWidth function requires non-null value'); + $this->expectExceptionMessageIsOrContains('StringWidth function requires non-null value'); new FunctionContext(flow_context())->eval( ref('str')->stringWidth(), diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StructureSelectTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StructureSelectTest.php index 7a78e0302e..79570dafae 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StructureSelectTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StructureSelectTest.php @@ -107,7 +107,7 @@ public function test_a_non_structure_operand_is_refused_at_bind(): void ); $this->expectException(SchemaNotDerivableException::class); - $this->expectExceptionMessage('which is not a structure'); + $this->expectExceptionMessageIsOrContains('which is not a structure'); $resolved->returns(); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StructureTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StructureTest.php index ba945bd022..e2578b4b93 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StructureTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StructureTest.php @@ -74,7 +74,7 @@ public function test_eval_with_numeric_keys(): void public function test_list_shaped_keys_are_rejected(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Structure keys cannot be a list (0, 1, 2, ...). Name the elements or use non-sequential keys.', ); @@ -158,7 +158,7 @@ public function test_with_children_keeps_keys(): void public function test_with_children_rejects_arity_change(): void { $this->expectException(InvalidLogicException::class); - $this->expectExceptionMessage('Structure expects 2 children, got 0.'); + $this->expectExceptionMessageIsOrContains('Structure expects 2 children, got 0.'); structure(['id' => ref('line_id'), 'quantity' => ref('quantity')])->withChildren([]); } @@ -166,7 +166,7 @@ public function test_with_children_rejects_arity_change(): void public function test_empty_elements_are_rejected(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Structure requires at least one element.'); + $this->expectExceptionMessageIsOrContains('Structure requires at least one element.'); structure([]); } @@ -203,7 +203,7 @@ public function test_a_description_rebuilds_through_the_constructor_checks(): vo ]; $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Structure keys cannot be a list'); + $this->expectExceptionMessageIsOrContains('Structure keys cannot be a list'); new Rebuild()->of($data, ScalarFunction::class); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StructureValuesTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StructureValuesTest.php index fef57bf2ba..4ce1246692 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StructureValuesTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/StructureValuesTest.php @@ -43,7 +43,7 @@ public function test_a_nullable_field_makes_the_unified_type_nullable(): void public function test_refuses_fields_that_do_not_unify(): void { $this->expectException(SchemaNotDerivableException::class); - $this->expectExceptionMessage('whose field types do not unify'); + $this->expectExceptionMessageIsOrContains('whose field types do not unify'); StructureValues::type('fn', StructureType::fromElements([ 'a' => type_boolean(), diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ToDateTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ToDateTest.php index afd7bde24e..fd28027279 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ToDateTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ToDateTest.php @@ -25,7 +25,7 @@ final class ToDateTest extends FlowTestCase public function test_null_value_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('ToDate function requires non-null values'); + $this->expectExceptionMessageIsOrContains('ToDate function requires non-null values'); new FunctionContext(flow_context())->eval( to_date(ref('value')), @@ -37,7 +37,7 @@ public function test_null_value_is_refused(): void public function test_null_format_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('ToDate function requires non-null values'); + $this->expectExceptionMessageIsOrContains('ToDate function requires non-null values'); new FunctionContext(flow_context())->eval( to_date(ref('value'), ref('format')), diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ToDateTimeTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ToDateTimeTest.php index 6fb9faf1ad..b08698fb6f 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ToDateTimeTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ToDateTimeTest.php @@ -285,7 +285,7 @@ public function test_mutable_datetime_is_converted_without_mutation(): void public function test_non_datetime_object_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('ToDateTime function requires DateTimeInterface object'); + $this->expectExceptionMessageIsOrContains('ToDateTime function requires DateTimeInterface object'); new FunctionContext(flow_context())->eval(to_date_time(lit(new stdClass())), [], schema()); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ToLowerTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ToLowerTest.php index 8572472ab0..c4a4c5a3ae 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ToLowerTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ToLowerTest.php @@ -25,7 +25,7 @@ public function test_string_to_lower(): void public function test_lower_on_null(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('ToLower function requires non-null value'); + $this->expectExceptionMessageIsOrContains('ToLower function requires non-null value'); new FunctionContext(flow_context())->eval( lower(ref('string')), diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ToTimeZoneTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ToTimeZoneTest.php index 0c648469b5..e333281f35 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ToTimeZoneTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ToTimeZoneTest.php @@ -31,7 +31,7 @@ final class ToTimeZoneTest extends FlowTestCase public function test_abbreviation_zone_is_refused(): void { $this->expectException(TypesInvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Time zone "PST" cannot be a datetime column zone, use an IANA name like "Europe/Warsaw", "UTC" or an offset "+HH:MM"', ); @@ -87,7 +87,7 @@ public function test_with_children_keeps_the_zone(): void public function test_null_value_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('ToTimeZone function requires non-null values'); + $this->expectExceptionMessageIsOrContains('ToTimeZone function requires non-null values'); new FunctionContext(flow_context())->eval( to_timezone(ref('at'), 'UTC'), @@ -112,7 +112,7 @@ public function test_describe_round_trips(): void public function test_a_null_in_a_datetime_column_is_refused_at_its_row(): void { $this->expectException(EvaluationException::class); - $this->expectExceptionMessage('ToTimeZone function requires non-null values (row 1)'); + $this->expectExceptionMessageIsOrContains('ToTimeZone function requires non-null values (row 1)'); new FunctionContext(flow_context())->column( to_timezone(ref('at'), 'UTC'), diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ToUpperTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ToUpperTest.php index 8a6c980628..19035a6a34 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ToUpperTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/ToUpperTest.php @@ -25,7 +25,7 @@ public function test_string_to_upper(): void public function test_upper_on_null(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('ToUpper function requires non-null value'); + $this->expectExceptionMessageIsOrContains('ToUpper function requires non-null value'); new FunctionContext(flow_context())->eval( upper(ref('string')), diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/TrimTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/TrimTest.php index b43b83755a..6779753af3 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/TrimTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/TrimTest.php @@ -46,7 +46,7 @@ public function test_trim_right_valid_string(): void public function test_trim_on_null(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Trim function requires non-null value'); + $this->expectExceptionMessageIsOrContains('Trim function requires non-null value'); new FunctionContext(flow_context())->eval( ref('string')->trim(), diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/TruncateTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/TruncateTest.php index 8f260e2ae4..ba12783377 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/TruncateTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/TruncateTest.php @@ -46,7 +46,7 @@ public function test_truncate_exact_length(): void public function test_truncate_throws_on_null_input(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Truncate function requires non-null value'); + $this->expectExceptionMessageIsOrContains('Truncate function requires non-null value'); new FunctionContext(flow_context())->eval( ref('str')->truncate(10), diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/UlidTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/UlidTest.php index 6c66a0a13b..f2a122550f 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/UlidTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/UlidTest.php @@ -68,7 +68,7 @@ public function test_ulid_is_unique(): void public function test_ulid_with_invalid_value_throws(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Ulid requires valid ULID string: Invalid ULID'); + $this->expectExceptionMessageIsOrContains('Ulid requires valid ULID string: Invalid ULID'); new FunctionContext(flow_context())->eval(ulid(lit('')), [], schema()); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/UnicodeLengthTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/UnicodeLengthTest.php index e4c8253187..4052e843c1 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/UnicodeLengthTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/UnicodeLengthTest.php @@ -36,7 +36,7 @@ public function test_unicode_length_empty_string(): void public function test_unicode_length_throws_on_null_input(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('UnicodeLength function requires non-null value'); + $this->expectExceptionMessageIsOrContains('UnicodeLength function requires non-null value'); new FunctionContext(flow_context())->eval( ref('str')->unicodeLength(), diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/UuidTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/UuidTest.php index fc070273c2..88f71e0c9d 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/UuidTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/UuidTest.php @@ -123,7 +123,7 @@ public function test_uuid7_has_its_date_time_as_child(): void public function test_uuid_v7_requires_a_date_time(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Uuid uuid7 function requires a DateTimeInterface value'); + $this->expectExceptionMessageIsOrContains('Uuid uuid7 function requires a DateTimeInterface value'); new FunctionContext(flow_context())->eval(uuid_v7(lit('')), [], schema()); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/WhenTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/WhenTest.php index c47d1a5e72..81b56f854e 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/WhenTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/WhenTest.php @@ -102,7 +102,7 @@ public function test_with_children_keeps_the_then_branch(): void public function test_branches_without_a_common_type_refuse_to_declare(): void { $this->expectException(InvalidTypeException::class); - $this->expectExceptionMessage('Cannot combine types'); + $this->expectExceptionMessageIsOrContains('Cannot combine types'); new When(lit(true), lit(true), lit(new DateTimeImmutable()))->returns(); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/Window/FrameBoundTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/Window/FrameBoundTest.php index a9914d22bf..84745280e2 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/Window/FrameBoundTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/Window/FrameBoundTest.php @@ -35,7 +35,7 @@ public function test_current_row_resolves_to_the_current_index(): void public function test_current_row_with_an_offset_is_rejected(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Frame bound of type CURRENT_ROW must not define an offset.'); + $this->expectExceptionMessageIsOrContains('Frame bound of type CURRENT_ROW must not define an offset.'); new FrameBound(FrameBoundType::CURRENT_ROW, 1); } @@ -66,7 +66,7 @@ public function test_following_resolves_forward_from_the_current_index(): void public function test_following_without_an_offset_is_rejected(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Frame bound of type FOLLOWING requires an offset.'); + $this->expectExceptionMessageIsOrContains('Frame bound of type FOLLOWING requires an offset.'); new FrameBound(FrameBoundType::FOLLOWING); } @@ -74,7 +74,7 @@ public function test_following_without_an_offset_is_rejected(): void public function test_negative_offset_is_rejected(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Frame bound offset must not be negative, got -1.'); + $this->expectExceptionMessageIsOrContains('Frame bound offset must not be negative, got -1.'); new FrameBound(FrameBoundType::PRECEDING, -1); } @@ -92,7 +92,7 @@ public function test_preceding_resolves_below_zero_without_clamping(): void public function test_preceding_without_an_offset_is_rejected(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Frame bound of type PRECEDING requires an offset.'); + $this->expectExceptionMessageIsOrContains('Frame bound of type PRECEDING requires an offset.'); new FrameBound(FrameBoundType::PRECEDING); } @@ -105,7 +105,7 @@ public function test_unbounded_following_resolves_to_the_last_index(): void public function test_unbounded_following_with_an_offset_is_rejected(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Frame bound of type UNBOUNDED_FOLLOWING must not define an offset.'); + $this->expectExceptionMessageIsOrContains('Frame bound of type UNBOUNDED_FOLLOWING must not define an offset.'); new FrameBound(FrameBoundType::UNBOUNDED_FOLLOWING, 5); } @@ -118,7 +118,7 @@ public function test_unbounded_preceding_resolves_to_zero(): void public function test_unbounded_preceding_with_an_offset_is_rejected(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Frame bound of type UNBOUNDED_PRECEDING must not define an offset.'); + $this->expectExceptionMessageIsOrContains('Frame bound of type UNBOUNDED_PRECEDING must not define an offset.'); new FrameBound(FrameBoundType::UNBOUNDED_PRECEDING, 0); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/WordwrapTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/WordwrapTest.php index e3b5fab571..0a5d153ea8 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/WordwrapTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Functions/WordwrapTest.php @@ -48,7 +48,7 @@ public function test_null_break_character(): void public function test_null_value(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Wordwrap function requires non-null value'); + $this->expectExceptionMessageIsOrContains('Wordwrap function requires non-null value'); static::assertNull(new FunctionContext(flow_context())->eval( ref('str')->wordwrap(10), diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/ArrayExtractorTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/ArrayExtractorTest.php index 3ee3c2157d..36274287e5 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/ArrayExtractorTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/ArrayExtractorTest.php @@ -53,7 +53,7 @@ final class ArrayExtractorTest extends FlowTestCase public function test_a_key_first_seen_after_the_inference_sample_is_a_schema_error(): void { $this->expectException(InferredSchemaException::class); - $this->expectExceptionMessage('"c"'); + $this->expectExceptionMessageIsOrContains('"c"'); ExtractedRows::of(from_array([ ['a' => 1, 'b' => 2], @@ -85,7 +85,7 @@ public function test_a_value_that_does_not_cast_to_the_declared_type_is_a_corrup public function test_an_empty_source_refuses_to_infer_a_schema(): void { $this->expectException(InferredSchemaException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'from_array() has nothing to infer a schema from: no row carries a column. Declare the schema with ->withSchema(...).', ); @@ -108,7 +108,7 @@ public function test_an_empty_source_extracts_nothing_without_a_declared_schema( public function test_an_empty_generator_refuses_to_infer_a_schema(): void { $this->expectException(InferredSchemaException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'from_array() has nothing to infer a schema from: no row carries a column. Declare the schema with ' . '->withSchema(...).', ); @@ -201,7 +201,7 @@ public function test_infer_schema_after_a_one_shot_source_was_consumed_is_refuse $extractor->schema(); $this->expectException(InvalidLogicException::class); - $this->expectExceptionMessage('cannot change its inference options'); + $this->expectExceptionMessageIsOrContains('cannot change its inference options'); $extractor->inferSchema(infer_schema()->allStrings()); } @@ -292,7 +292,7 @@ public function test_a_retry_after_the_source_broke_is_refused_rather_than_re_re // Re-reading the half-consumed source would answer with 0 columns and extract 0 rows, silently, // for every shape whose exhaustion is quiet. $this->expectException(InvalidLogicException::class); - $this->expectExceptionMessage('The dataset was already consumed'); + $this->expectExceptionMessageIsOrContains('The dataset was already consumed'); $extractor->schema(); } @@ -366,7 +366,9 @@ public function test_a_bounded_sample_types_only_its_prefix(): void ); $this->expectException(InferredSchemaException::class); - $this->expectExceptionMessage('Row 3 of from_array() does not fit the schema inferred from its first 3 rows'); + $this->expectExceptionMessageIsOrContains( + 'Row 3 of from_array() does not fit the schema inferred from its first 3 rows', + ); iterator_to_array( from_array($dataset) @@ -386,7 +388,7 @@ public function test_the_default_sample_is_the_first_20480_rows(): void static::assertSame('integer', from_array($dataset)->schema()->get('code')->type()->toString()); $this->expectException(InferredSchemaException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Row 20480 of from_array() does not fit the schema inferred from its first 20480 rows', ); @@ -467,7 +469,7 @@ public function test_statistics_are_computed_at_most_once(): void public function test_an_empty_memory_refuses_to_infer_a_schema(): void { $this->expectException(InferredSchemaException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'from_memory() has nothing to infer a schema from: no row carries a column. Declare the schema with ->withSchema(...).', ); @@ -492,7 +494,9 @@ public function test_a_memory_is_read_in_place_with_its_declared_schema(): void public function test_a_bounded_sample_of_a_memory_names_from_memory_when_outrun(): void { $this->expectException(InferredSchemaException::class); - $this->expectExceptionMessage('Row 2 of from_memory() does not fit the schema inferred from its first 2 rows'); + $this->expectExceptionMessageIsOrContains( + 'Row 2 of from_memory() does not fit the schema inferred from its first 2 rows', + ); iterator_to_array( from_memory(new ArrayMemory([['code' => 1000], ['code' => 1001], ['code' => 'AB-01']])) diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/ChainExtractorTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/ChainExtractorTest.php index c8a70689ab..5e9d8527c7 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/ChainExtractorTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/ChainExtractorTest.php @@ -87,7 +87,7 @@ public function test_a_declared_schema_wins_over_infer_schema(): void public function test_a_chain_without_extractors_refuses_to_infer_a_schema(): void { $this->expectException(InferredSchemaException::class); - $this->expectExceptionMessage('from_all() has nothing to infer a schema from: it chains no extractor. Declare the schema with ' + $this->expectExceptionMessageIsOrContains('from_all() has nothing to infer a schema from: it chains no extractor. Declare the schema with ' . '->withSchema(...).'); from_all()->schema(); diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/CriteriaTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/CriteriaTest.php index d7dcb3eeba..04408d597a 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/CriteriaTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/CriteriaTest.php @@ -36,7 +36,7 @@ public function test_default_criteria_push_nothing_and_narrow_nothing(): void public function test_a_limit_below_one_is_refused(int $limit): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Limit must be greater than 0'); + $this->expectExceptionMessageIsOrContains('Limit must be greater than 0'); new Criteria($limit); } @@ -150,7 +150,7 @@ public function test_pushed_columns_survive_every_other_push(): void public function test_an_offset_below_zero_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Offset must be greater than or equal to 0, given: -1'); + $this->expectExceptionMessageIsOrContains('Offset must be greater than or equal to 0, given: -1'); new Criteria(offset: -1); } @@ -183,7 +183,7 @@ public function test_offsets_add_up_and_keep_limit_path_filter_and_conjuncts(): public function test_a_negative_offset_push_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Offset must be greater than or equal to 0, given: -1'); + $this->expectExceptionMessageIsOrContains('Offset must be greater than or equal to 0, given: -1'); new Criteria(offset: 5)->withOffset(-1); } @@ -191,7 +191,7 @@ public function test_a_negative_offset_push_is_refused(): void public function test_a_read_with_an_offset_cannot_be_split(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('A read with an offset cannot be split, given offset: 3'); + $this->expectExceptionMessageIsOrContains('A read with an offset cannot be split, given offset: 3'); new Criteria(offset: 3)->withSplit(new FileSplit(path('memory://orders.csv'), 0, 1_024)); } @@ -199,7 +199,7 @@ public function test_a_read_with_an_offset_cannot_be_split(): void public function test_a_split_read_refuses_an_offset(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('A read with an offset cannot be split, given offset: 3'); + $this->expectExceptionMessageIsOrContains('A read with an offset cannot be split, given offset: 3'); new Criteria() ->withSplit(new FileSplit(path('memory://orders.csv'), 0, 1_024)) diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/ByteUnitTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/ByteUnitTest.php index f9a6f4e7ca..277e3ede95 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/ByteUnitTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/ByteUnitTest.php @@ -17,7 +17,7 @@ final class ByteUnitTest extends FlowTestCase public function test_a_negative_value_is_rejected(int $start, int $bytes, int $rows, string $message): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage($message); + $this->expectExceptionMessageIsOrContains($message); new ByteUnit($start, $bytes, $rows); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/DerivedSchemaTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/DerivedSchemaTest.php index 855ae7e9c7..4e61cce681 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/DerivedSchemaTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/DerivedSchemaTest.php @@ -27,7 +27,7 @@ public function test_a_file_of_the_derived_schema_passes(): void public function test_a_file_of_another_schema_is_refused_naming_both_files(): void { $this->expectException(InferredSchemaException::class); - $this->expectExceptionMessage('memory://b.floe'); + $this->expectExceptionMessageIsOrContains('memory://b.floe'); new DerivedSchema(schema(int_schema('id')), 'memory://a.floe')->refuseDivergence( 'memory://b.floe', diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/FileColumnsTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/FileColumnsTest.php index 6817b355ad..a9abb48add 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/FileColumnsTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/FileColumnsTest.php @@ -61,7 +61,7 @@ public function test_an_uncastable_partition_value_names_the_file_and_the_column $fileColumns = FileColumnsContext::discovering(types: partition_types(year: type_integer())); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Partition column "year" of file "memory://orders/year=abc/part-0.parquet" declares type integer, ' . 'but its path value "abc" cannot be cast to it.', ); @@ -97,7 +97,7 @@ public function test_a_missing_partition_under_a_not_null_declaration_is_null(): $fileColumns = FileColumnsContext::discovering(names: ['year' => true]); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Partition column "year" of file "memory://orders/data.csv" declares type string, ' . 'but its path value NULL cannot be cast to it.', ); @@ -113,7 +113,7 @@ public function test_a_hive_null_value_under_a_not_null_declaration_is_null(): v $fileColumns = FileColumnsContext::discovering(names: ['year' => true]); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Partition column "year" of file "memory://orders/year=__HIVE_DEFAULT_PARTITION__/data.csv" declares ' . 'type string, but its path value NULL cannot be cast to it.', ); diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/FileSplitTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/FileSplitTest.php index a426145ba5..a3bce890c7 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/FileSplitTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/FileSplitTest.php @@ -26,7 +26,7 @@ final class FileSplitTest extends FlowTestCase public function test_a_negative_start_is_rejected(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('File split start must not be negative, given: -1'); + $this->expectExceptionMessageIsOrContains('File split start must not be negative, given: -1'); new FileSplit(path('memory://orders.csv'), -1, null); } @@ -39,7 +39,7 @@ public function test_a_null_length_means_to_the_end_of_the_file(): void public function test_a_zero_length_is_rejected(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('File split length must be greater than 0, given: 0'); + $this->expectExceptionMessageIsOrContains('File split length must be greater than 0, given: 0'); new FileSplit(path('memory://orders.csv'), 0, 0); } @@ -88,7 +88,7 @@ public function test_it_is_a_window_of_one_file(): void public function test_a_negative_size_is_rejected(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('File split size must not be negative, given: -1'); + $this->expectExceptionMessageIsOrContains('File split size must not be negative, given: -1'); new FileSplit(path('memory://orders.csv'), 0, null, -1); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/FooterStatisticsTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/FooterStatisticsTest.php index bd123dc2ea..94974ffe2e 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/FooterStatisticsTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/FooterStatisticsTest.php @@ -67,7 +67,7 @@ public function test_a_scaled_estimate_rounds_to_the_nearest_integer(): void public function test_a_negative_footer_count_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Read footer count must not be negative, given: -1'); + $this->expectExceptionMessageIsOrContains('Read footer count must not be negative, given: -1'); new FooterStatistics(new Statistics(), -1); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/InferredColumnsTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/InferredColumnsTest.php index 5e8c9b4d26..8f7d1d4c62 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/InferredColumnsTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/InferredColumnsTest.php @@ -42,7 +42,7 @@ public function test_a_file_without_columns_passes(): void public function test_a_file_whose_columns_diverge_is_refused_naming_both_sources(): void { $this->expectException(InferredSchemaException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Columns of memory://b.csv do not match the schema inferred from memory://a.csv: unexpected [age], missing [name]', ); diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/PartitionTypesTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/PartitionTypesTest.php index 6db0655cd5..22c891a0d3 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/PartitionTypesTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/PartitionTypesTest.php @@ -51,7 +51,7 @@ public function test_nullability_still_comes_from_path_coverage(): void public function test_naming_a_column_that_is_not_a_partition_throws(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Column "month" is not a partition of this read, discovered partitions: ["year"]', ); @@ -61,7 +61,7 @@ public function test_naming_a_column_that_is_not_a_partition_throws(): void public function test_an_undeclared_name_is_refused_by_get(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('No partition type declared for "month"'); + $this->expectExceptionMessageIsOrContains('No partition type declared for "month"'); new PartitionTypes()->get('month'); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/ReadWindowTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/ReadWindowTest.php index e5885a98a9..27ecbac89b 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/ReadWindowTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/ReadWindowTest.php @@ -17,7 +17,7 @@ final class ReadWindowTest extends FlowTestCase public function test_a_negative_offset_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('ReadWindow offset must be 0 or more, got -1'); + $this->expectExceptionMessageIsOrContains('ReadWindow offset must be 0 or more, got -1'); new ReadWindow(offset: -1); } @@ -25,7 +25,7 @@ public function test_a_negative_offset_is_refused(): void public function test_a_negative_limit_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('ReadWindow limit must be 0 or more, got -1'); + $this->expectExceptionMessageIsOrContains('ReadWindow limit must be 0 or more, got -1'); new ReadWindow(limit: -1); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/RowRangeTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/RowRangeTest.php index 44b80f38aa..cb64b14e06 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/RowRangeTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/RowRangeTest.php @@ -13,7 +13,7 @@ final class RowRangeTest extends FlowTestCase public function test_a_negative_count_is_rejected(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Row range count must not be negative, given: -1'); + $this->expectExceptionMessageIsOrContains('Row range count must not be negative, given: -1'); new RowRange(0, -1); } @@ -21,7 +21,7 @@ public function test_a_negative_count_is_rejected(): void public function test_a_negative_offset_is_rejected(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Row range offset must not be negative, given: -1'); + $this->expectExceptionMessageIsOrContains('Row range offset must not be negative, given: -1'); new RowRange(-1, 0); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/SkippedRowsTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/SkippedRowsTest.php index 58307c5cb9..f11d943603 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/SkippedRowsTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/File/SkippedRowsTest.php @@ -23,7 +23,7 @@ public function test_zero_skipped_rows_are_accepted(): void public function test_a_negative_count_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Skipped rows cannot be negative, given: -1'); + $this->expectExceptionMessageIsOrContains('Skipped rows cannot be negative, given: -1'); new SkippedRows(-1); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/FileListingExtractorTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/FileListingExtractorTest.php index 07ec169f4e..3f17c54c70 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/FileListingExtractorTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/FileListingExtractorTest.php @@ -32,7 +32,7 @@ final class FileListingExtractorTest extends FlowTestCase public function test_a_path_the_filesystem_does_not_serve_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('paths, given: "memory://dir"'); + $this->expectExceptionMessageIsOrContains('paths, given: "memory://dir"'); files('memory://dir'); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/Memory/SpilledRowsTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/Memory/SpilledRowsTest.php index cf846cf047..484f9366f9 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/Memory/SpilledRowsTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/Memory/SpilledRowsTest.php @@ -77,7 +77,7 @@ public function test_a_second_sniff_is_refused(): void $spill->sniff(0, null, new VoidProgress()); $this->expectException(InvalidLogicException::class); - $this->expectExceptionMessage('The dataset was already consumed'); + $this->expectExceptionMessageIsOrContains('The dataset was already consumed'); $spill->sniff(0, null, new VoidProgress()); } @@ -266,7 +266,7 @@ public function test_rows_refuses_an_abandoned_sampler(): void } $this->expectException(InvalidLogicException::class); - $this->expectExceptionMessage('The dataset was already consumed'); + $this->expectExceptionMessageIsOrContains('The dataset was already consumed'); $spill->rows(); } @@ -289,7 +289,7 @@ public function test_sniff_refuses_a_consumed_source_up_front(): void $spill->sniff(0, null, new VoidProgress()); $this->expectException(InvalidLogicException::class); - $this->expectExceptionMessage('The dataset was already consumed'); + $this->expectExceptionMessageIsOrContains('The dataset was already consumed'); $spill->sniff(0, null, new VoidProgress()); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/RowsExtractorTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/RowsExtractorTest.php index 9cd8756eab..d7da789f66 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/RowsExtractorTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/RowsExtractorTest.php @@ -23,7 +23,7 @@ final class RowsExtractorTest extends FlowTestCase public function test_an_empty_source_refuses_to_infer_a_schema(): void { $this->expectException(InferredSchemaException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'from_rows() has nothing to infer a schema from: no row carries a column. Declare the schema with ->withSchema(...).', ); diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/SequenceExtractorTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/SequenceExtractorTest.php index f3c56615a2..14fe793e06 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/SequenceExtractorTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/SequenceExtractorTest.php @@ -39,7 +39,7 @@ final class SequenceExtractorTest extends FlowTestCase public function test_an_empty_source_refuses_to_infer_a_schema(): void { $this->expectException(InferredSchemaException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'the sequence has nothing to infer a schema from: it generates no item. Declare the schema with ->withSchema(...).', ); @@ -183,7 +183,9 @@ public function test_a_bounded_sample_types_only_its_prefix(): void ); $this->expectException(InferredSchemaException::class); - $this->expectExceptionMessage('Row 1 of the sequence does not fit the schema inferred from its first 1 rows'); + $this->expectExceptionMessageIsOrContains( + 'Row 1 of the sequence does not fit the schema inferred from its first 1 rows', + ); iterator_to_array(FlowTestCase::extracted($extractor, flow_context(config())->backend(), new Criteria())); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/SequenceGenerator/NumberSequenceGeneratorTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/SequenceGenerator/NumberSequenceGeneratorTest.php index 456c3306e5..4480f4f717 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/SequenceGenerator/NumberSequenceGeneratorTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Extractor/SequenceGenerator/NumberSequenceGeneratorTest.php @@ -89,7 +89,7 @@ public function test_a_step_the_range_rejects_is_rejected_the_same_way(int $star public function test_generate_rejects_a_step_wider_than_the_span(): void { $this->expectException(ValueError::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'range(): Argument #3 ($step) must be less than the range spanned by argument #1 ($start) and argument #2 ($end)', ); @@ -99,7 +99,7 @@ public function test_generate_rejects_a_step_wider_than_the_span(): void public function test_generate_rejects_a_zero_step_the_way_range_does(): void { $this->expectException(ValueError::class); - $this->expectExceptionMessage('range(): Argument #3 ($step) cannot be 0'); + $this->expectExceptionMessageIsOrContains('range(): Argument #3 ($step) cannot be 0'); iterator_to_array(new NumberSequenceGenerator(1, 10, 0)->generate()); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Filesystem/ScalarFunctionFilterTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Filesystem/ScalarFunctionFilterTest.php index 83310aeef5..bb433384ff 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Filesystem/ScalarFunctionFilterTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Filesystem/ScalarFunctionFilterTest.php @@ -150,7 +150,7 @@ public function test_a_hive_null_partition_value_against_a_declared_non_nullable ); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Partition column "year" of file "flow-file://data/year=__HIVE_DEFAULT_PARTITION__/f.csv" declares ' . 'type integer, but its path value NULL cannot be cast to it.', ); @@ -167,7 +167,7 @@ public function test_a_declared_partition_type_that_the_path_cannot_satisfy_thro ); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Partition column "year" of file "flow-file://data/year=2024a/file.csv" declares type integer, ' . 'but its path value "2024a" cannot be cast to it.', ); diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Floe/FloeExtractorTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Floe/FloeExtractorTest.php index 8d95d7e62a..497b3b6f78 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Floe/FloeExtractorTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Floe/FloeExtractorTest.php @@ -46,7 +46,7 @@ final class FloeExtractorTest extends FlowTestCase public function test_a_path_the_filesystem_does_not_serve_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('paths, given: "memory://data.floe"'); + $this->expectExceptionMessageIsOrContains('paths, given: "memory://data.floe"'); new FloeExtractor(path('memory://data.floe')); } @@ -66,7 +66,7 @@ public function test_a_later_file_with_other_columns_throws_naming_both_files(): ]); $this->expectException(InferredSchemaException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( "Columns of memory://glob/b.floe do not match the schema read from memory://glob/a.floe:\n" . " Unexpected Definitions: \n" . ' |-- extra', @@ -88,7 +88,7 @@ public function test_a_later_file_with_another_column_type_throws(): void ]); $this->expectException(InferredSchemaException::class); - $this->expectExceptionMessage('|-- expected: id, given: id'); + $this->expectExceptionMessageIsOrContains('|-- expected: id, given: id'); iterator_to_array(FlowTestCase::extracted( from_floe(path('memory://glob/*.floe'), filesystem: $memory), diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Floe/FloeLoaderTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Floe/FloeLoaderTest.php index 6e428f6ca3..3ad918d7ae 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Floe/FloeLoaderTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Floe/FloeLoaderTest.php @@ -46,7 +46,7 @@ final class FloeLoaderTest extends TestCase public function test_a_path_the_filesystem_does_not_serve_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('paths, given: "memory://data.floe"'); + $this->expectExceptionMessageIsOrContains('paths, given: "memory://data.floe"'); new FloeLoader(path('memory://data.floe')); } @@ -224,7 +224,7 @@ public function test_a_declared_column_the_rows_do_not_carry_is_refused_not_drop $filesystem = memory_filesystem(); $this->expectException(IncompatibleSchemaException::class); - $this->expectExceptionMessage('Missing Definitions'); + $this->expectExceptionMessageIsOrContains('Missing Definitions'); data_frame() ->read(from_array([['id' => 1, 'name' => 'a']])) diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Formatter/Schema/PHPFormatter/TypeFormatterTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Formatter/Schema/PHPFormatter/TypeFormatterTest.php index dc33b7a5ef..38de3261ad 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Formatter/Schema/PHPFormatter/TypeFormatterTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Formatter/Schema/PHPFormatter/TypeFormatterTest.php @@ -55,7 +55,7 @@ public function test_a_nullable_null_type_is_not_wrapped_in_an_optional(): void public function test_a_type_without_a_dsl_function_is_refused(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('is not a simple definition'); + $this->expectExceptionMessageIsOrContains('is not a simple definition'); new TypeFormatter()->format(type_mixed()); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Inference/ColumnTypesTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Inference/ColumnTypesTest.php index 945931d548..28f7692b64 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Inference/ColumnTypesTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Inference/ColumnTypesTest.php @@ -514,7 +514,7 @@ public function test_sniff_returns_a_partial_equal_to_a_bare_fold_of_the_same_ro public function test_a_negative_row_budget_is_refused_instead_of_read_as_a_budget(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Row budget must be 0 or more. Use null for every row.'); + $this->expectExceptionMessageIsOrContains('Row budget must be 0 or more. Use null for every row.'); // @mago-expect analysis:invalid-argument ColumnTypes::sniff( diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Inference/InferredTypesTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Inference/InferredTypesTest.php index 44bf672525..c114b5a3bd 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Inference/InferredTypesTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Inference/InferredTypesTest.php @@ -50,7 +50,7 @@ public static function rejectedTypes(): array public function test_a_container_or_open_type_cannot_be_inferred(Type $type): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('cannot be inferred from a candidate list'); + $this->expectExceptionMessageIsOrContains('cannot be inferred from a candidate list'); new InferredTypes($type); } @@ -58,7 +58,7 @@ public function test_a_container_or_open_type_cannot_be_inferred(Type $type): vo public function test_an_empty_list_is_rejected(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('At least one type is required'); + $this->expectExceptionMessageIsOrContains('At least one type is required'); new InferredTypes(); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Inference/SampleTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Inference/SampleTest.php index b500991608..c93af4dbdf 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Inference/SampleTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Inference/SampleTest.php @@ -14,7 +14,7 @@ final class SampleTest extends FlowTestCase public function test_negative_bytes_are_rejected(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Sampled bytes must not be negative'); + $this->expectExceptionMessageIsOrContains('Sampled bytes must not be negative'); // @mago-expect analysis:invalid-argument new Sample(ColumnTypesMother::fromStrings()->folded(), -1, true); diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Inference/SchemaInferenceBuilderTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Inference/SchemaInferenceBuilderTest.php index 48ad644e6a..f1b983fd7a 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Inference/SchemaInferenceBuilderTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Inference/SchemaInferenceBuilderTest.php @@ -38,7 +38,7 @@ public function test_all_strings_is_sugar_for_a_string_only_candidate_set(): voi public function test_an_empty_candidate_set_is_rejected(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('At least one type is required'); + $this->expectExceptionMessageIsOrContains('At least one type is required'); infer_schema()->types(); } @@ -46,7 +46,7 @@ public function test_an_empty_candidate_set_is_rejected(): void public function test_a_container_type_is_not_a_candidate(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('cannot be inferred from a candidate list'); + $this->expectExceptionMessageIsOrContains('cannot be inferred from a candidate list'); infer_schema()->types(type_list(type_string())); } @@ -87,7 +87,7 @@ public function test_files_to_sniff_accepts_one(): void public function test_files_to_sniff_rejects_anything_below_one(int $filesToSniff): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Use everySource() to infer from every source.'); + $this->expectExceptionMessageIsOrContains('Use everySource() to infer from every source.'); // @mago-ignore analysis:possibly-invalid-argument infer_schema()->filesToSniff($filesToSniff); @@ -107,7 +107,7 @@ public function test_every_row_keeps_a_finite_files_to_sniff(): void public function test_sample_size_rejects_anything_below_one(int $sampleSize): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Use everyRow() to infer from every row.'); + $this->expectExceptionMessageIsOrContains('Use everyRow() to infer from every row.'); // @mago-ignore analysis:possibly-invalid-argument infer_schema()->sampleSize($sampleSize); diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Inference/SchemaInferenceTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Inference/SchemaInferenceTest.php index ce43ee64d6..116fec15ed 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Inference/SchemaInferenceTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Inference/SchemaInferenceTest.php @@ -76,7 +76,7 @@ public function test_every_row_with_a_finite_files_to_sniff_round_trips(): void public function test_a_size_below_one_is_refused(int $sampleSize, int $filesToSniff, string $message): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage($message); + $this->expectExceptionMessageIsOrContains($message); // @mago-expect analysis:possibly-invalid-argument(2) new SchemaInference($sampleSize, $filesToSniff); diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Inference/SniffedColumnsTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Inference/SniffedColumnsTest.php index 5e3c244581..8323c0fb3a 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Inference/SniffedColumnsTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Inference/SniffedColumnsTest.php @@ -28,7 +28,7 @@ final class SniffedColumnsTest extends FlowTestCase public function test_negative_rows_are_rejected(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Sniffed rows must not be negative'); + $this->expectExceptionMessageIsOrContains('Sniffed rows must not be negative'); // @mago-expect analysis:invalid-argument new SniffedColumns([], -1); diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Loader/File/FileCommitTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Loader/File/FileCommitTest.php index 4a682336b0..069b1bd2c5 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Loader/File/FileCommitTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Loader/File/FileCommitTest.php @@ -183,7 +183,7 @@ public function test_location_is_the_directory_the_files_land_in(string $destina public function test_a_destination_with_a_query_is_refused_before_it_has_a_location(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage("Destination path can't be pattern"); + $this->expectExceptionMessageIsOrContains("Destination path can't be pattern"); new FileCommit($this->memory, path('sftp://user:secret@host/out/rows.csv?token=t'), overwrite(), 'r1'); } @@ -267,7 +267,7 @@ public function test_commit_reports_removing_what_a_task_without_a_result_staged public function test_a_destination_without_an_extension_is_refused(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Stream path must have an extension'); + $this->expectExceptionMessageIsOrContains('Stream path must have an extension'); new FileCommit(memory_filesystem(), path('memory://out'), exception_if_exists(), 'r1'); } @@ -275,7 +275,7 @@ public function test_a_destination_without_an_extension_is_refused(): void public function test_a_pattern_destination_is_refused(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage("Destination path can't be pattern"); + $this->expectExceptionMessageIsOrContains("Destination path can't be pattern"); new FileCommit(memory_filesystem(), path('memory://out/*.csv'), exception_if_exists(), 'r1'); } @@ -283,7 +283,7 @@ public function test_a_pattern_destination_is_refused(): void public function test_a_placeholder_destination_without_partitions_is_refused(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('contains partition placeholders but rows are not partitioned'); + $this->expectExceptionMessageIsOrContains('contains partition placeholders but rows are not partitioned'); new FileCommit(memory_filesystem(), path('memory://out/{name}.csv'), exception_if_exists(), 'r1')->open(); } @@ -353,7 +353,7 @@ public function test_exception_if_exists_refuses_an_existing_plain_file(): void $filesystem->writeTo(path('memory://out/orders.csv'))->append('old')->close(); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Destination path "memory://out/orders.csv" already exists'); + $this->expectExceptionMessageIsOrContains('Destination path "memory://out/orders.csv" already exists'); new FileCommit($filesystem, path('memory://out/orders.csv'), exception_if_exists(), 'r1')->admit(false); } @@ -374,7 +374,7 @@ public function test_a_partitioned_plain_destination_is_decided_once_over_every_ static::assertFalse(new FileCommit($filesystem, path('memory://out/orders.csv'), ignore(), 'r1')->admit(true)); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Destination path "memory://out/**/orders.csv" already exists'); + $this->expectExceptionMessageIsOrContains('Destination path "memory://out/**/orders.csv" already exists'); new FileCommit($filesystem, path('memory://out/orders.csv'), exception_if_exists(), 'r1')->admit(true); } @@ -426,7 +426,7 @@ public function test_admit_refuses_exception_if_exists_over_an_existing_part(): $filesystem->writeTo(path('memory://out/part-00003.csv'))->append('x')->close(); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Destination path "memory://out/part-*.csv" already exists, please change path to different or set different SaveMode', ); @@ -452,7 +452,7 @@ public function test_append_refuses_a_file_at_the_static_root(): void $filesystem->writeTo(path('memory://out'))->append('a file')->close(); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('is a file'); + $this->expectExceptionMessageIsOrContains('is a file'); new FileCommit($filesystem, path('memory://out/orders-{part}.csv'), append(), 'r1')->admit(false); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Loader/File/FileWriteTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Loader/File/FileWriteTest.php index 3634b200eb..20cd304193 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Loader/File/FileWriteTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Loader/File/FileWriteTest.php @@ -146,7 +146,7 @@ public function test_a_write_without_rows_under_exception_if_exists_refuses_an_e $filesystem->writeTo(path('memory://out/part-00007.txt'))->append('old')->close(); $this->expectException(FlowRuntimeException::class); - $this->expectExceptionMessage('already exists'); + $this->expectExceptionMessageIsOrContains('already exists'); new FileWrite( $filesystem, diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Loader/File/PartTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Loader/File/PartTest.php index 92a5142fa4..cbf3eb8432 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Loader/File/PartTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Loader/File/PartTest.php @@ -73,7 +73,7 @@ public function test_fill_without_placeholder_is_identity(): void public function test_a_placeholder_in_a_directory_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('names a file, not a directory'); + $this->expectExceptionMessageIsOrContains('names a file, not a directory'); new Part(3, 10, 'abcd', false)->fill(path('file:///out/{part}/orders.csv')); } @@ -113,7 +113,7 @@ public function test_stale_parts_of_a_partitioned_file_are_globbed_in_its_partit public function test_refuse_reserved_throws_for_a_part_column(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('cannot name the partition column "part"'); + $this->expectExceptionMessageIsOrContains('cannot name the partition column "part"'); Part::refuseReserved(path('file:///out/{part}/orders-{part}.csv'), Partitioning::by('part')); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Loader/File/PartitionRouterTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Loader/File/PartitionRouterTest.php index 98604d31e4..69920fdcb6 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Loader/File/PartitionRouterTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Loader/File/PartitionRouterTest.php @@ -98,7 +98,9 @@ public function test_partitions_keep_declaration_order_not_name_order(): void public function test_partitioning_by_every_column_leaves_nothing_to_write(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('No column left to write, every column is a partition column: "region"'); + $this->expectExceptionMessageIsOrContains( + 'No column left to write, every column is a partition column: "region"', + ); PartitionRoutingContext::route( Partitioning::by('region'), diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Loader/PartitioningTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Loader/PartitioningTest.php index 36d38f939c..3a8307e199 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Loader/PartitioningTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Loader/PartitioningTest.php @@ -33,7 +33,7 @@ public function test_by_takes_a_list_of_names_and_references_in_the_given_order( public function test_by_an_empty_list_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('partitionBy() needs at least one column, an empty list was given'); + $this->expectExceptionMessageIsOrContains('partitionBy() needs at least one column, an empty list was given'); // @mago-ignore analysis:invalid-argument Partitioning::by([]); diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Loader/RowPartitionsTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Loader/RowPartitionsTest.php index 6f2eb54d06..975b2efe11 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Loader/RowPartitionsTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Loader/RowPartitionsTest.php @@ -83,7 +83,7 @@ public function test_a_null_value_stays_null(): void public function test_a_list_column_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('can\'t be used as a partition'); + $this->expectExceptionMessageIsOrContains('can\'t be used as a partition'); new RowPartitions(refs(ref('v')))->of(array_to_rows([['v' => [ 1, @@ -94,7 +94,7 @@ public function test_a_list_column_is_refused(): void public function test_a_structure_column_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('can\'t be used as a partition'); + $this->expectExceptionMessageIsOrContains('can\'t be used as a partition'); $structure = type_structure(['a' => type_string()]); @@ -106,7 +106,7 @@ public function test_a_structure_column_is_refused(): void public function test_an_aliased_reference_needs_a_column_of_the_alias_name(): void { $this->expectException(SchemaDefinitionNotFoundException::class); - $this->expectExceptionMessage('Schema definition for column "day" not found.'); + $this->expectExceptionMessageIsOrContains('Schema definition for column "day" not found.'); new RowPartitions(refs(ref('date')->as('day')))->of(array_to_rows([[ 'date' => '2026-11-20', diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Loader/SchemaValidationLoaderTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Loader/SchemaValidationLoaderTest.php index 1231041684..f1d4e91adf 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Loader/SchemaValidationLoaderTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Loader/SchemaValidationLoaderTest.php @@ -29,7 +29,7 @@ final class SchemaValidationLoaderTest extends FlowTestCase public function test_schema_validation_failed_by_mismatching(): void { $this->expectException(SchemaValidationException::class); - $this->expectExceptionMessage(<<<'EXCEPTION' + $this->expectExceptionMessageIsOrContains(<<<'EXCEPTION' Schema validation failed: Mismatched Definitions: |-- expected: id, given: id @@ -43,7 +43,7 @@ public function test_schema_validation_failed_by_mismatching(): void public function test_schema_validation_failed_by_unexpected(): void { $this->expectException(SchemaValidationException::class); - $this->expectExceptionMessage(<<<'EXCEPTION' + $this->expectExceptionMessageIsOrContains(<<<'EXCEPTION' Schema validation failed: Missing Definitions: |-- id diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Loader/StreamLoaderTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Loader/StreamLoaderTest.php index 675be366dd..03af5d7e2f 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Loader/StreamLoaderTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/IO/Loader/StreamLoaderTest.php @@ -49,7 +49,7 @@ public function test_columns_count_to_php_output_stream(): void public function test_loading_data_into_invalid_stream(): void { - $this->expectExceptionMessage("Can't open stream for url: php://qweqweqw in mode: w"); + $this->expectExceptionMessageIsOrContains("Can't open stream for url: php://qweqweqw in mode: w"); $this->expectException(RuntimeException::class); $loader = to_stream('php://qweqweqw', 0); diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Kernels/Bucketing/HashBucketingTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Kernels/Bucketing/HashBucketingTest.php index 1d0893ad20..ab214bc7fb 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Kernels/Bucketing/HashBucketingTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Kernels/Bucketing/HashBucketingTest.php @@ -231,7 +231,7 @@ public function test_missing_key_column_is_bucketed_as_null_when_the_schema_allo public function test_rows_missing_the_key_column_throw(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Column "id" does not exist.'); + $this->expectExceptionMessageIsOrContains('Column "id" does not exist.'); iterator_to_array(new HashBucketing(new KeyEncoder(['id']), 4, new NativePHPRandomValueGenerator())->bucketize( (static function () { @@ -245,7 +245,7 @@ public function test_rows_missing_the_key_column_throw(): void public function test_throws_when_buckets_count_below_one(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Buckets count must be greater than 0, given: 0'); + $this->expectExceptionMessageIsOrContains('Buckets count must be greater than 0, given: 0'); // @mago-ignore analysis:invalid-argument new HashBucketing(new KeyEncoder(['id']), 0, new NativePHPRandomValueGenerator()); diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Kernels/HashJoin/JoinerTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Kernels/HashJoin/JoinerTest.php index 7821c8387f..43a4ef3bee 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Kernels/HashJoin/JoinerTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Kernels/HashJoin/JoinerTest.php @@ -542,7 +542,7 @@ public function test_prefix_collision_with_left_column_throws(): void }; $this->expectException(SchemaDefinitionNotUniqueException::class); - $this->expectExceptionMessage('Column definitions must be unique, duplicated columns: [left_name]'); + $this->expectExceptionMessageIsOrContains('Column definitions must be unique, duplicated columns: [left_name]'); $joiner = JoinerMother::of( join_on(['id' => 'user_id'], join_prefix: 'left_'), @@ -1048,7 +1048,7 @@ public function test_unmatched_build_rows_are_emitted_in_chunks_of_batch_size(): public function test_a_probe_batch_missing_the_key_column_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Column "id" does not exist.'); + $this->expectExceptionMessageIsOrContains('Column "id" does not exist.'); iterator_to_array(JoinerMother::of(join_on(['id' => 'user_id']), JoinType::inner)->join( JoinSide::of( diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Kernels/Sort/ExternalSortTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Kernels/Sort/ExternalSortTest.php index b54da8fa78..5090275535 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Kernels/Sort/ExternalSortTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Kernels/Sort/ExternalSortTest.php @@ -748,7 +748,7 @@ public function test_merge_sizes_the_cursors_by_one_row_a_frame_when_the_first_f public function test_throws_when_merge_fan_in_below_one(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Merge fan-in must be greater than 0, given: 0'); + $this->expectExceptionMessageIsOrContains('Merge fan-in must be greater than 0, given: 0'); // @mago-ignore analysis:invalid-argument ExternalSortMother::with([ref('id')->asc()], new MemoryRowsStorage(), 0); diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/GroupBy/AggregatorsTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/GroupBy/AggregatorsTest.php index d3953c0afb..b5a0218ec3 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/GroupBy/AggregatorsTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/GroupBy/AggregatorsTest.php @@ -52,7 +52,7 @@ public function test_fresh_drops_state(): void public function test_first_is_refused_without_aggregators(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Aggregators are empty.'); + $this->expectExceptionMessageIsOrContains('Aggregators are empty.'); new Aggregators()->first(); } @@ -86,7 +86,7 @@ public function test_references_are_null_when_any_aggregator_cannot_enumerate_th public function test_resolved_refuses_an_expand_in_an_aggregate(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'aggregate() cannot contain array_expand(), it turns one row into many rows. Expand with withColumn() first, then use the new column.', ); diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/GroupBy/DeclaredPivotValuesTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/GroupBy/DeclaredPivotValuesTest.php index 6cd6bf5a81..1fc7bfc1d6 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/GroupBy/DeclaredPivotValuesTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/GroupBy/DeclaredPivotValuesTest.php @@ -19,7 +19,7 @@ final class DeclaredPivotValuesTest extends FlowTestCase public function test_duplicate_values_are_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Pivot values must be unique'); + $this->expectExceptionMessageIsOrContains('Pivot values must be unique'); new DeclaredPivotValues('USA', 'China', 'USA'); } @@ -32,7 +32,7 @@ public function test_it_keeps_the_declaration_order(): void public function test_no_values_are_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Pivot requires at least one value'); + $this->expectExceptionMessageIsOrContains('Pivot requires at least one value'); new DeclaredPivotValues(); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/GroupBy/DiscoveredPivotValuesTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/GroupBy/DiscoveredPivotValuesTest.php index 1c4a03664b..ac41403808 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/GroupBy/DiscoveredPivotValuesTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/GroupBy/DiscoveredPivotValuesTest.php @@ -20,7 +20,7 @@ final class DiscoveredPivotValuesTest extends FlowTestCase public function test_a_max_values_below_one_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('discover_pivot_values() must allow at least one value, given: 0'); + $this->expectExceptionMessageIsOrContains('discover_pivot_values() must allow at least one value, given: 0'); new DiscoveredPivotValues(0); } @@ -56,7 +56,7 @@ public function test_it_reads_the_frame_so_a_derived_column_is_visible(): void public function test_it_refuses_a_source_with_no_values_to_declare(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('found no values in column "country"'); + $this->expectExceptionMessageIsOrContains('found no values in column "country"'); new DiscoveredPivotValues()->resolve(df()->read(from_array([['country' => null]]))->get(), ref('country')); } @@ -86,7 +86,7 @@ public function test_the_default_bound_allows_ten_thousand_distinct_values(): vo public function test_the_default_bound_refuses_ten_thousand_and_one_distinct_values(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('found more than 10000 distinct values in column "k"'); + $this->expectExceptionMessageIsOrContains('found more than 10000 distinct values in column "k"'); new DiscoveredPivotValues()->resolve( df()->read(from_array(array_map(static fn(int $i): array => ['k' => $i], range(1, 10_001))))->get(), @@ -97,7 +97,7 @@ public function test_the_default_bound_refuses_ten_thousand_and_one_distinct_val public function test_it_refuses_more_distinct_values_than_the_bound_allows(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('found more than 1 distinct values in column "country"'); + $this->expectExceptionMessageIsOrContains('found more than 1 distinct values in column "country"'); new DiscoveredPivotValues(1)->resolve( df()->read(from_array([['country' => 'PL'], ['country' => 'US']]))->get(), @@ -119,7 +119,7 @@ public function test_numeric_looking_strings_are_ordered_by_bytes_as_sort_by_doe public function test_only_string_and_integer_values_can_become_pivot_columns(): void { $this->expectException(InvalidTypeException::class); - $this->expectExceptionMessage('Expected type "integer|string", got "float".'); + $this->expectExceptionMessageIsOrContains('Expected type "integer|string", got "float".'); new DiscoveredPivotValues()->resolve(df()->read(from_array([['code' => 1.5]]))->get(), ref('code')); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/GroupBy/GroupByShapeTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/GroupBy/GroupByShapeTest.php index cd721f30a6..cd0b0232f4 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/GroupBy/GroupByShapeTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/GroupBy/GroupByShapeTest.php @@ -35,7 +35,7 @@ public function test_it_carries_the_input_the_bound_aggregators_and_the_output_s public function test_it_refuses_a_group_column_the_input_does_not_declare(): void { $this->expectException(SchemaDefinitionNotFoundException::class); - $this->expectExceptionMessage('Schema definition for column "missing" not found'); + $this->expectExceptionMessageIsOrContains('Schema definition for column "missing" not found'); GroupByShape::of( new GroupBy(refs('missing'), new Aggregators(sum(ref('age')))), @@ -46,7 +46,7 @@ public function test_it_refuses_a_group_column_the_input_does_not_declare(): voi public function test_it_refuses_an_aggregation_over_a_column_the_input_does_not_declare(): void { $this->expectException(SchemaDefinitionNotFoundException::class); - $this->expectExceptionMessage('Schema definition for column "missing" not found'); + $this->expectExceptionMessageIsOrContains('Schema definition for column "missing" not found'); GroupByShape::of( new GroupBy(refs('country'), new Aggregators(sum(ref('missing')))), diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/GroupBy/PivotShapeTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/GroupBy/PivotShapeTest.php index 538f3bca79..372fb2cf53 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/GroupBy/PivotShapeTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/GroupBy/PivotShapeTest.php @@ -55,7 +55,7 @@ public function test_it_declares_one_column_per_pivot_value(): void public function test_it_refuses_a_group_by_that_does_not_pivot(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('GroupBy does not pivot, there is no pivot shape to derive'); + $this->expectExceptionMessageIsOrContains('GroupBy does not pivot, there is no pivot shape to derive'); PivotShape::of( new GroupBy(refs(ref('k')), new Aggregators(sum(ref('a')))), @@ -66,7 +66,7 @@ public function test_it_refuses_a_group_by_that_does_not_pivot(): void public function test_it_refuses_an_unknown_group_by_column(): void { $this->expectException(SchemaDefinitionNotFoundException::class); - $this->expectExceptionMessage('Schema definition for column "nope" not found'); + $this->expectExceptionMessageIsOrContains('Schema definition for column "nope" not found'); PivotShape::of( new GroupBy(refs(ref('nope')), new Aggregators(sum(ref('a'))), new Pivot(ref('p'), pivot_values('p1'))), @@ -77,7 +77,7 @@ public function test_it_refuses_an_unknown_group_by_column(): void public function test_it_refuses_an_unknown_aggregate_column(): void { $this->expectException(SchemaDefinitionNotFoundException::class); - $this->expectExceptionMessage('Schema definition for column "nope" not found'); + $this->expectExceptionMessageIsOrContains('Schema definition for column "nope" not found'); PivotShape::of( new GroupBy(refs(ref('k')), new Aggregators(min(ref('nope'))), new Pivot(ref('p'), pivot_values('p1'))), diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/GroupBy/PivotedTableTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/GroupBy/PivotedTableTest.php index c942d42f1f..2b360134ce 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/GroupBy/PivotedTableTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/GroupBy/PivotedTableTest.php @@ -27,7 +27,7 @@ public function test_a_float_pivot_value_is_refused(): void $table = PivotedTableMother::boundTo(PivotedTableMother::floatCountrySchema(), sum(ref('amount')), 'USA'); $this->expectException(InvalidTypeException::class); - $this->expectExceptionMessage('Expected type "integer|string", got "float".'); + $this->expectExceptionMessageIsOrContains('Expected type "integer|string", got "float".'); $table->accumulate(array_to_rows([[ 'product' => 'Banana', diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/GroupByTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/GroupByTest.php index 9748e80a27..686234824b 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/GroupByTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/GroupByTest.php @@ -155,7 +155,7 @@ public function test_a_pivot_declares_its_output_schema(): void public function test_a_pivot_without_an_aggregation_is_refused(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Pivot requires exactly one aggregation in group by, given: 0'); + $this->expectExceptionMessageIsOrContains('Pivot requires exactly one aggregation in group by, given: 0'); new GroupBy(refs(ref('product')), new Aggregators(), new Pivot(ref('country'), pivot_values('USA'))); } @@ -163,7 +163,7 @@ public function test_a_pivot_without_an_aggregation_is_refused(): void public function test_a_pivot_with_more_than_one_aggregation_is_refused(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Pivot requires exactly one aggregation in group by, given: 2'); + $this->expectExceptionMessageIsOrContains('Pivot requires exactly one aggregation in group by, given: 2'); new GroupBy( refs(ref('product')), @@ -353,7 +353,7 @@ public function test_group_by_with_pivoting_with_null_pivot_column(): void public function test_a_group_column_absent_from_the_schema_is_refused_at_bind(): void { $this->expectException(SchemaDefinitionNotFoundException::class); - $this->expectExceptionMessage('Schema definition for column "missing" not found'); + $this->expectExceptionMessageIsOrContains('Schema definition for column "missing" not found'); GroupByContext::aggregated( new GroupBy(refs('missing'), new Aggregators(count())), @@ -389,7 +389,7 @@ public function test_a_nullable_group_key_stays_nullable_in_the_output_schema(): public function test_keys_throws_when_a_row_lacks_a_not_null_key(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Column "country" does not exist.'); + $this->expectExceptionMessageIsOrContains('Column "country" does not exist.'); GroupByContext::keys( new GroupBy(refs('country')), @@ -560,7 +560,9 @@ public function test_pivot_schema_names_an_integer_pivot_column_by_its_digits(): public function test_pivot_schema_refuses_a_pivot_value_colliding_with_a_group_by_column(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Pivot value "product" collides with the group-by column of the same name'); + $this->expectExceptionMessageIsOrContains( + 'Pivot value "product" collides with the group-by column of the same name', + ); new GroupBy(refs('product'))->pivotSchema( schema(str_schema('product'), int_schema('amount')), diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Join/CrossJoinTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Join/CrossJoinTest.php index c248dc0408..e6409091f5 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Join/CrossJoinTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Join/CrossJoinTest.php @@ -200,7 +200,7 @@ public function test_a_stop_reaches_the_left_side(): void public function test_a_column_on_both_sides_without_a_prefix_is_refused(): void { $this->expectException(SchemaDefinitionNotUniqueException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Column definitions must be unique, duplicated columns: [active], all: [id, country, active, active]', ); diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Join/HashJoinTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Join/HashJoinTest.php index 729be955ea..8b80a7271a 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Join/HashJoinTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Join/HashJoinTest.php @@ -923,7 +923,7 @@ public function test_duplicated_entries_outside_join_columns_throw_join_exceptio })(); $this->expectException(JoinException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Column definitions must be unique, duplicated columns: [name], all: [id, name, user_id, name]', ); diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Processor/BatchingByProcessorTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Processor/BatchingByProcessorTest.php index 638ebd4fdc..f43f967c07 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Processor/BatchingByProcessorTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Processor/BatchingByProcessorTest.php @@ -39,7 +39,7 @@ final class BatchingByProcessorTest extends FlowTestCase public function test_a_later_batch_that_widens_the_shape_is_refused(): void { $this->expectException(SchemaMismatchException::class); - $this->expectExceptionMessage('column "extra" (row 0) is not declared by the schema'); + $this->expectExceptionMessageIsOrContains('column "extra" (row 0) is not declared by the schema'); iterator_to_array( new BatchingByProcessor(ref('g'))->process( @@ -233,7 +233,7 @@ public function test_respects_min_size(): void public function test_throws_exception_for_invalid_min_size(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Minimum batch size must be greater than 0'); + $this->expectExceptionMessageIsOrContains('Minimum batch size must be greater than 0'); // @mago-ignore analysis:invalid-argument new BatchingByProcessor(ref('group'), minSize: 0); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Processor/BatchingProcessorTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Processor/BatchingProcessorTest.php index 0985b68ddf..048f33d38c 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Processor/BatchingProcessorTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Processor/BatchingProcessorTest.php @@ -51,7 +51,7 @@ public function test_a_batch_under_another_schema_is_conformed_to_the_first(int public function test_a_later_batch_that_widens_the_shape_is_refused(): void { $this->expectException(SchemaMismatchException::class); - $this->expectExceptionMessage('column "extra" (row 0) is not declared by the schema'); + $this->expectExceptionMessageIsOrContains('column "extra" (row 0) is not declared by the schema'); iterator_to_array( new BatchingProcessor(new BatchSize(2))->process( diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Processor/BoundExpansionTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Processor/BoundExpansionTest.php index 7adc74373d..f950a886e1 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Processor/BoundExpansionTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Processor/BoundExpansionTest.php @@ -152,7 +152,7 @@ public function test_an_input_batch_that_expands_to_nothing_yields_one_empty_bat public function test_a_function_without_an_expand_is_not_an_expansion(): void { $this->expectException(InvalidLogicException::class); - $this->expectExceptionMessage('holds no array_expand(), it is not an expansion'); + $this->expectExceptionMessageIsOrContains('holds no array_expand(), it is not an expansion'); BoundExpansion::of( 's', diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Processor/ConstrainedProcessorTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Processor/ConstrainedProcessorTest.php index fe16ecd523..662f07023a 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Processor/ConstrainedProcessorTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Processor/ConstrainedProcessorTest.php @@ -177,7 +177,7 @@ public function violation(Rows $rows, int $index): string public function test_throws_exception_for_invalid_constraint_type(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Pipeline constraints must be of type Flow\ETL\Operators\Constraint'); + $this->expectExceptionMessageIsOrContains('Pipeline constraints must be of type Flow\ETL\Operators\Constraint'); // @mago-ignore analysis:invalid-argument new ConstrainedProcessor(['not a constraint']); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Processor/DistinctProcessorTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Processor/DistinctProcessorTest.php index d260c3cf2a..03f3697824 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Processor/DistinctProcessorTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Processor/DistinctProcessorTest.php @@ -148,7 +148,7 @@ public function test_zero_and_negative_zero_are_duplicates(): void public function test_no_column_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('DistinctProcessor requires at least one column'); + $this->expectExceptionMessageIsOrContains('DistinctProcessor requires at least one column'); new DistinctProcessor([]); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Processor/ExpandingProcessorTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Processor/ExpandingProcessorTest.php index 8c2df2c948..8ec2fff581 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Processor/ExpandingProcessorTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Processor/ExpandingProcessorTest.php @@ -145,7 +145,7 @@ public function test_stop_after_the_first_batch_is_forwarded_upstream(): void public function test_an_expanded_null_under_a_not_null_declaration_names_its_row(): void { $this->expectException(SchemaMismatchException::class); - $this->expectExceptionMessage('column "out" (row 1)'); + $this->expectExceptionMessageIsOrContains('column "out" (row 1)'); ExpandingProcessorContext::rows( flow_context(config()), @@ -347,7 +347,7 @@ public function test_a_null_under_a_not_null_definition_names_its_output_row(): $input = schema(list_schema('tags', type_list(type_optional(type_string())))); $this->expectException(SchemaMismatchException::class); - $this->expectExceptionMessage('column "s" (row 1)'); + $this->expectExceptionMessageIsOrContains('column "s" (row 1)'); ExpandingProcessorContext::rows( flow_context(config()), @@ -449,7 +449,7 @@ public static function zipped_expansions(): Generator public function test_a_padded_null_follows_the_null_rule_of_the_function_reading_it(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Plus function requires non-null values'); + $this->expectExceptionMessageIsOrContains('Plus function requires non-null values'); ExpandingProcessorContext::rows( flow_context(config()), @@ -503,7 +503,7 @@ public function test_the_synthesized_column_does_not_shadow_an_input_column(): v public function test_bind_refuses_an_expand_inside_an_expand(ScalarFunction $function): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'array_expand() cannot contain another array_expand(). Expand one level per withColumn().', ); @@ -522,7 +522,7 @@ public static function expands_inside_an_expand(): Generator public function test_an_unbound_expand_inside_an_expand_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'array_expand() cannot contain another array_expand(). Expand one level per withColumn().', ); diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Processor/OffsetProcessorTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Processor/OffsetProcessorTest.php index bed817749d..dac43b2e44 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Processor/OffsetProcessorTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Processor/OffsetProcessorTest.php @@ -337,7 +337,7 @@ public function test_skips_first_n_rows(): void public function test_throws_exception_for_negative_offset(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Offset must be greater than or equal to 0'); + $this->expectExceptionMessageIsOrContains('Offset must be greater than or equal to 0'); // @mago-ignore analysis:invalid-argument new OffsetProcessor(-1); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Processor/PivotProcessorTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Processor/PivotProcessorTest.php index 6f9c72382a..98df79caa9 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Processor/PivotProcessorTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Processor/PivotProcessorTest.php @@ -103,7 +103,9 @@ public function test_bind_derives_the_group_by_columns_and_one_nullable_column_p public function test_bind_refuses_a_pivot_value_colliding_with_a_group_by_column(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Pivot value "date" collides with the group-by column of the same name'); + $this->expectExceptionMessageIsOrContains( + 'Pivot value "date" collides with the group-by column of the same name', + ); new PivotProcessor( new GroupBy( diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Processor/TopNProcessorTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Processor/TopNProcessorTest.php index 68e7ec2004..f132d7853c 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Processor/TopNProcessorTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Processor/TopNProcessorTest.php @@ -393,7 +393,7 @@ public function test_a_description_whose_config_is_no_sort_config_is_refused(): $data = type_array()->assert(Json::decode(Json::encode($described->normalize()))['data'] ?? null); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('A top-N config is a memory or an external sort config'); + $this->expectExceptionMessageIsOrContains('A top-N config is a memory or an external sort config'); TopNProcessor::fromDescription(['config' => $data['random'] ?? null] + $data, new Rebuild()); } @@ -401,7 +401,7 @@ public function test_a_description_whose_config_is_no_sort_config_is_refused(): public function test_a_limit_below_one_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('TopN limit must be greater than 0, given: 0'); + $this->expectExceptionMessageIsOrContains('TopN limit must be greater than 0, given: 0'); new TopNProcessor([ref('score')->asc()], 0, new MemorySortConfig(), new NativePHPRandomValueGenerator()); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Processor/WindowProcessorTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Processor/WindowProcessorTest.php index 5889fbd3d6..2e280db6cd 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Processor/WindowProcessorTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Processor/WindowProcessorTest.php @@ -188,7 +188,7 @@ public function test_definition_entry_keeps_its_type_and_metadata(): void public function test_an_unknown_partition_reference_is_refused_at_bind(): void { $this->expectException(SchemaDefinitionNotFoundException::class); - $this->expectExceptionMessage('Schema definition for column "missing" not found.'); + $this->expectExceptionMessageIsOrContains('Schema definition for column "missing" not found.'); WindowProcessorContext::values( 'row_number', @@ -200,7 +200,7 @@ public function test_an_unknown_partition_reference_is_refused_at_bind(): void public function test_an_unknown_order_reference_is_refused_at_bind(): void { $this->expectException(SchemaDefinitionNotFoundException::class); - $this->expectExceptionMessage('Schema definition for column "missing" not found.'); + $this->expectExceptionMessageIsOrContains('Schema definition for column "missing" not found.'); WindowProcessorContext::values( 'row_number', @@ -539,7 +539,7 @@ public function test_rows_come_out_sorted_by_the_order_by(): void public function test_bind_refuses_an_expand_in_the_window_function(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'over() cannot contain array_expand(), it turns one row into many rows. Expand with withColumn() first, then use the new column.', ); diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Transformer/AddRowIndexTransformerTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Transformer/AddRowIndexTransformerTest.php index 302b477513..73a804f460 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Transformer/AddRowIndexTransformerTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Transformer/AddRowIndexTransformerTest.php @@ -23,7 +23,7 @@ final class AddRowIndexTransformerTest extends FlowTestCase public function test_an_index_column_colliding_with_an_existing_column_is_rejected(): void { $this->expectException(SchemaDefinitionNotUniqueException::class); - $this->expectExceptionMessage('Column definitions must be unique, duplicated columns: [id]'); + $this->expectExceptionMessageIsOrContains('Column definitions must be unique, duplicated columns: [id]'); new AddRowIndexTransformer('id', StartFrom::ZERO)->transform(array_to_rows([[ 'id' => 1, diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Transformer/DerivedColumnsTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Transformer/DerivedColumnsTest.php index 468ed5ba06..e6cbfef755 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Transformer/DerivedColumnsTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Transformer/DerivedColumnsTest.php @@ -70,7 +70,7 @@ public function test_stored_keeps_null_under_a_nullable_definition(): void public function test_stored_names_the_row_of_a_null_under_a_not_null_definition(): void { $this->expectException(SchemaMismatchException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Rows do not match their schema: column "a" (row 3): could not convert null to integer, column is not nullable', ); diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Transformer/DuplicateRowTransformerTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Transformer/DuplicateRowTransformerTest.php index 1135ef52e4..29965b4cee 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Transformer/DuplicateRowTransformerTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Transformer/DuplicateRowTransformerTest.php @@ -44,7 +44,7 @@ public function test_bind_widens_a_column_an_entry_overwrites_with_another_type( public function test_bind_refuses_an_entry_without_a_common_type_with_the_column_it_overwrites(): void { $this->expectException(InvalidTypeException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Cannot combine types "integer", "list" - an explicit cast is required.', ); @@ -312,7 +312,7 @@ public function test_an_empty_batch_is_bound_against_its_own_schema(): void public function test_bind_refuses_an_expand_in_the_condition(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'duplicateRow() cannot contain array_expand(), it turns one row into many rows. Expand with withColumn() first, then use the new column.', ); @@ -325,7 +325,7 @@ public function test_bind_refuses_an_expand_in_the_condition(): void public function test_bind_refuses_an_expand_in_an_entry(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'duplicateRow() cannot contain array_expand(), it turns one row into many rows. Expand with withColumn() first, then use the new column.', ); @@ -338,7 +338,7 @@ public function test_bind_refuses_an_expand_in_an_entry(): void public function test_an_unbound_transform_refuses_an_expand_in_an_entry(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'duplicateRow() cannot contain array_expand(), it turns one row into many rows. Expand with withColumn() first, then use the new column.', ); diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Transformer/JoinEachRowsTransformerTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Transformer/JoinEachRowsTransformerTest.php index 08bdbf6dde..d68da7d8cb 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Transformer/JoinEachRowsTransformerTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Transformer/JoinEachRowsTransformerTest.php @@ -38,7 +38,7 @@ public function from(Rows $rows): Extractor }; $this->expectException(DataDependentSchemaException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( "cannot describe its output before rows flow: its right side is built from each left batch's row values", ); @@ -269,7 +269,7 @@ public function test_inner_join_into_empty(): void public function test_inner_join_with_duplicated_entries(): void { $this->expectException(SchemaDefinitionNotUniqueException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Column definitions must be unique, duplicated columns: [id], all: [id, country, id, code, name]', ); @@ -478,7 +478,7 @@ public function test_left_join_to_empty(): void public function test_left_join_with_the_duplicated_columns(): void { $this->expectException(SchemaDefinitionNotUniqueException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Column definitions must be unique, duplicated columns: [id], all: [id, country, id, code, name]', ); @@ -613,7 +613,7 @@ public function test_right_join_to_empty(): void public function test_right_join_with_duplicated_entry_names(): void { $this->expectException(SchemaDefinitionNotUniqueException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Column definitions must be unique, duplicated columns: [id], all: [id, country, id, code, name]', ); diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Transformer/LimitTransformerTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Transformer/LimitTransformerTest.php index 4fc122f3f2..84e6c8c8c7 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Transformer/LimitTransformerTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Transformer/LimitTransformerTest.php @@ -59,7 +59,7 @@ public function test_exact_fill_reaches_the_limit_on_the_same_batch(): void public function test_limit_below_one_is_rejected(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage("Limit can't be lower or equal zero, given: 0"); + $this->expectExceptionMessageIsOrContains("Limit can't be lower or equal zero, given: 0"); new LimitTransformer(0); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Transformer/RenameEachColumnTransformerTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Transformer/RenameEachColumnTransformerTest.php index a255953f09..0a60327ebd 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Transformer/RenameEachColumnTransformerTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Transformer/RenameEachColumnTransformerTest.php @@ -71,7 +71,7 @@ public function test_bind_chains_strategies_through_a_numeric_entry_name(): void public function test_renaming_fails_without_any_strategy(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('At least one strategy must be provided.'); + $this->expectExceptionMessageIsOrContains('At least one strategy must be provided.'); new RenameEachColumnTransformer(); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Transformer/ScalarFunctionFilterTransformerTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Transformer/ScalarFunctionFilterTransformerTest.php index 8e3f04aa16..76a23c977f 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Transformer/ScalarFunctionFilterTransformerTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Transformer/ScalarFunctionFilterTransformerTest.php @@ -212,7 +212,7 @@ public function test_same(): void public function test_a_non_boolean_predicate_is_rejected_at_bind(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('filter() requires a predicate returning boolean'); + $this->expectExceptionMessageIsOrContains('filter() requires a predicate returning boolean'); new ScalarFunctionFilterTransformer(ref('score'))->transform(array_to_rows([ ['score' => 1], @@ -249,7 +249,7 @@ public function test_an_empty_batch_is_bound_against_its_own_schema(): void public function test_bind_refuses_an_expand_in_the_predicate(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'filter() cannot contain array_expand(), it turns one row into many rows. Expand with withColumn() first, then use the new column.', ); @@ -259,7 +259,7 @@ public function test_bind_refuses_an_expand_in_the_predicate(): void public function test_bind_refuses_a_root_expand_over_booleans(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'filter() cannot contain array_expand(), it turns one row into many rows. Expand with withColumn() first, then use the new column.', ); diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Transformer/ScalarFunctionTransformerTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Transformer/ScalarFunctionTransformerTest.php index b1452fc9e7..7e7d69589b 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Transformer/ScalarFunctionTransformerTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Transformer/ScalarFunctionTransformerTest.php @@ -129,7 +129,7 @@ public function test_plus_expression_on_non_empty_rows(): void public function test_plus_expression_on_non_existing_rows(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Schema definition for column "num" not found.'); + $this->expectExceptionMessageIsOrContains('Schema definition for column "num" not found.'); static::assertEquals( [ @@ -246,7 +246,7 @@ public function test_the_produced_definition_does_not_depend_on_batch_size(): vo public function test_a_null_produced_under_a_not_null_declaration_names_its_row(): void { $this->expectException(SchemaMismatchException::class); - $this->expectExceptionMessage('column "out" (row 1)'); + $this->expectExceptionMessageIsOrContains('column "out" (row 1)'); new ScalarFunctionTransformer(int_schema('out'), ref('v'))->transform(array_to_rows([ ['v' => 1], @@ -299,7 +299,7 @@ public static function trees_without_an_expand(): Generator public function test_bind_refuses_an_expanding_function(ScalarFunction $function): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'transform() cannot contain array_expand(), it turns one row into many rows. ' . 'Expand with withColumn() first, then use the new column.', ); @@ -320,7 +320,7 @@ public static function expanding_functions(): Generator public function test_transform_refuses_an_expanding_function(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('transform() cannot contain array_expand()'); + $this->expectExceptionMessageIsOrContains('transform() cannot contain array_expand()'); new ScalarFunctionTransformer('v', ref('tags')->expand())->transform( ListColumnsMother::rows()->matchTo(ListColumnsMother::schema(), new AdaptiveBackend()), @@ -331,7 +331,7 @@ public function test_transform_refuses_an_expanding_function(): void public function test_bind_refuses_an_unpack_whose_type_is_not_a_structure(): void { $this->expectException(InvalidLogicException::class); - $this->expectExceptionMessage(NonStructureUnpackStub::class + $this->expectExceptionMessageIsOrContains(NonStructureUnpackStub::class . ' unpacks into N columns, so returns() must be a StructureType, got "string".'); new ScalarFunctionTransformer('u', new NonStructureUnpackStub())->bind(schema()); diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Transformer/SelectColumnsTransformerTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Transformer/SelectColumnsTransformerTest.php index 3a98faf970..edfb69629b 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Transformer/SelectColumnsTransformerTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Transformer/SelectColumnsTransformerTest.php @@ -50,7 +50,7 @@ public function test_bind_names_an_aliased_column_by_its_alias_with_the_read_col public function test_bind_refuses_two_references_that_output_one_name(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('select() would output column "name" twice'); + $this->expectExceptionMessageIsOrContains('select() would output column "name" twice'); new SelectColumnsTransformer(ref('id')->as('name'), 'name')->bind(schema(int_schema('id'), str_schema('name'))); } @@ -58,7 +58,7 @@ public function test_bind_refuses_two_references_that_output_one_name(): void public function test_bind_refuses_a_column_missing_from_the_input(): void { $this->expectException(SchemaDefinitionNotFoundException::class); - $this->expectExceptionMessage('Schema definition for column "not_existing" not found'); + $this->expectExceptionMessageIsOrContains('Schema definition for column "not_existing" not found'); new SelectColumnsTransformer('not_existing')->bind(schema(int_schema('id'))); } @@ -89,7 +89,7 @@ public function test_selecting_not_existing_entries(): void ); $this->expectException(SchemaDefinitionNotFoundException::class); - $this->expectExceptionMessage('Schema definition for column "not_existing" not found'); + $this->expectExceptionMessageIsOrContains('Schema definition for column "not_existing" not found'); new SelectColumnsTransformer('not_existing')->transform($rows, flow_context(config())->backend()); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Transformer/UnserializeTransformerTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Transformer/UnserializeTransformerTest.php index 8ec1e63025..fed820ef34 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Transformer/UnserializeTransformerTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Transformer/UnserializeTransformerTest.php @@ -35,7 +35,7 @@ public function test_a_payload_written_with_another_type_is_refused(): void ]], schema(str_schema('id'))))); $this->expectException(SchemaMismatchException::class); - $this->expectExceptionMessage('column "id" (row 0): could not convert \'12\' (string) to integer'); + $this->expectExceptionMessageIsOrContains('column "id" (row 0): could not convert \'12\' (string) to integer'); new UnserializeTransformer('serialized', schema(int_schema('id')), config()->serializer())->transform( array_to_rows([[ diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Transformer/UntilTransformerTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Transformer/UntilTransformerTest.php index 8aa6cfa46e..052d368f59 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Transformer/UntilTransformerTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Operators/Transformer/UntilTransformerTest.php @@ -125,7 +125,7 @@ public function test_a_reached_limit_stops_the_next_batch(): void public function test_a_non_boolean_predicate_is_rejected_at_bind(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('until() requires a predicate returning boolean'); + $this->expectExceptionMessageIsOrContains('until() requires a predicate returning boolean'); new UntilTransformer(ref('id'))->transform(array_to_rows([[ 'id' => 1, @@ -156,7 +156,7 @@ public function test_a_reached_limit_stops_an_empty_next_batch(): void public function test_bind_refuses_an_expand_in_the_predicate(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'until() cannot contain array_expand(), it turns one row into many rows. Expand with withColumn() first, then use the new column.', ); diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Logical/LogicalPlanTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Logical/LogicalPlanTest.php index 564e7f8bbe..3aa55704a1 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Logical/LogicalPlanTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Logical/LogicalPlanTest.php @@ -145,7 +145,7 @@ public function test_transform_up_refuses_an_outputs_consumer_rewritten_to_a_non $plan = new LogicalPlan(new Outputs(new Result($read), new Write($read, to_memory(new ArrayMemory())))); $this->expectException(InvalidLogicException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'An Outputs consumer rewrite must return a Result, a Write or a Transaction, ' . Node\Read::class . ' given', @@ -264,7 +264,7 @@ public function test_source_throws_when_the_row_input_chain_does_not_end_in_a_re $leaf = new ChildlessNode(); $this->expectException(InvalidLogicException::class); - $this->expectExceptionMessage('A logical plan must end in a Read, ' . $leaf::class . ' found'); + $this->expectExceptionMessageIsOrContains('A logical plan must end in a Read, ' . $leaf::class . ' found'); NodeMother::plan(NodeMother::select($leaf))->source(); } @@ -326,7 +326,9 @@ public function test_spine_throws_when_the_root_carries_no_consumer(): void $read = NodeMother::read(); $this->expectException(InvalidLogicException::class); - $this->expectExceptionMessage('A logical plan must have a consumer root, ' . $read::class . ' found'); + $this->expectExceptionMessageIsOrContains( + 'A logical plan must have a consumer root, ' . $read::class . ' found', + ); new LogicalPlan($read)->spine(); } @@ -334,7 +336,7 @@ public function test_spine_throws_when_the_root_carries_no_consumer(): void public function test_spine_throws_when_the_first_consumer_is_a_transaction(): void { $this->expectException(InvalidLogicException::class); - $this->expectExceptionMessage('The first consumer of a plan cannot be a Transaction'); + $this->expectExceptionMessageIsOrContains('The first consumer of a plan cannot be a Transaction'); new LogicalPlan( new Transaction(new RecordingTransaction(), new Write(NodeMother::read(), to_memory(new ArrayMemory()))), diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Logical/Node/BatchByTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Logical/Node/BatchByTest.php index c459d1c60a..0759bb6070 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Logical/Node/BatchByTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Logical/Node/BatchByTest.php @@ -54,7 +54,7 @@ public function test_a_min_size_of_zero_or_less_is_refused(): void { $column = ref('id'); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Minimum batch size must be greater than 0, given: 0'); + $this->expectExceptionMessageIsOrContains('Minimum batch size must be greater than 0, given: 0'); // @mago-ignore analysis:invalid-argument new BatchBy(NodeMother::read(), $column, 0); diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Logical/Node/CrossJoinTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Logical/Node/CrossJoinTest.php index 5ade0e7067..8404f4ea21 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Logical/Node/CrossJoinTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Logical/Node/CrossJoinTest.php @@ -72,7 +72,7 @@ public function test_a_right_side_that_is_not_a_plan_root_is_refused(): void $input = NodeMother::read(); $this->expectException(InvalidLogicException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'The right side of a join must be a frame\'s plan root (Result or Outputs), ' . Read::class . ' given', ); @@ -85,7 +85,7 @@ public function test_with_children_refuses_a_right_side_that_is_not_a_plan_root( $node = new CrossJoin($input, NodeMother::joinRight(NodeMother::plan(NodeMother::read())), 'r_'); $this->expectException(InvalidLogicException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'The right side of a join must be a frame\'s plan root (Result or Outputs), ' . Read::class . ' given', ); diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Logical/Node/DistinctTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Logical/Node/DistinctTest.php index c83017eb0a..ef5ab3edfa 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Logical/Node/DistinctTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Logical/Node/DistinctTest.php @@ -49,7 +49,7 @@ public function test_declarations(): void public function test_no_entries_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Distinct requires at least one column'); + $this->expectExceptionMessageIsOrContains('Distinct requires at least one column'); new Distinct(NodeMother::read(), []); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Logical/Node/JoinTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Logical/Node/JoinTest.php index 3896ef0f18..bcb8cbe05d 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Logical/Node/JoinTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Logical/Node/JoinTest.php @@ -82,7 +82,7 @@ public function test_a_right_side_that_is_not_a_plan_root_is_refused(): void $input = NodeMother::read(); $this->expectException(InvalidLogicException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'The right side of a join must be a frame\'s plan root (Result or Outputs), ' . Read::class . ' given', ); @@ -101,7 +101,7 @@ public function test_with_children_refuses_a_right_side_that_is_not_a_plan_root( ); $this->expectException(InvalidLogicException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'The right side of a join must be a frame\'s plan root (Result or Outputs), ' . Read::class . ' given', ); diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Logical/Node/LimitTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Logical/Node/LimitTest.php index b209dc8fdf..26a7a34005 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Logical/Node/LimitTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Logical/Node/LimitTest.php @@ -50,7 +50,7 @@ public function test_declarations(): void public function test_a_limit_of_zero_or_less_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Limit can\'t be lower or equal zero, given: 0'); + $this->expectExceptionMessageIsOrContains('Limit can\'t be lower or equal zero, given: 0'); new Limit(NodeMother::read(), 0); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Logical/Node/OffsetTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Logical/Node/OffsetTest.php index 2d5917a756..949943139b 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Logical/Node/OffsetTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Logical/Node/OffsetTest.php @@ -55,7 +55,7 @@ public function test_declarations(): void public function test_a_negative_offset_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Offset must be greater than or equal to 0, given: -1'); + $this->expectExceptionMessageIsOrContains('Offset must be greater than or equal to 0, given: -1'); // @mago-ignore analysis:invalid-argument new Offset(NodeMother::read(), -1); diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Logical/Node/OutputsTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Logical/Node/OutputsTest.php index 2e61115da4..c9a34de9d5 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Logical/Node/OutputsTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Logical/Node/OutputsTest.php @@ -46,7 +46,7 @@ public function test_writes_are_the_write_and_transaction_consumers(): void public function test_it_needs_two_or_more_consumers(): void { $this->expectException(InvalidLogicException::class); - $this->expectExceptionMessage('Outputs needs two or more consumers'); + $this->expectExceptionMessageIsOrContains('Outputs needs two or more consumers'); new Outputs(new Result(NodeMother::read())); } @@ -65,7 +65,7 @@ public function test_the_spine_consumer_cannot_be_a_transaction(): void $read = NodeMother::read(); $this->expectException(InvalidLogicException::class); - $this->expectExceptionMessage('The first consumer of a plan cannot be a Transaction'); + $this->expectExceptionMessageIsOrContains('The first consumer of a plan cannot be a Transaction'); new Outputs( new Transaction(new RecordingTransaction(), new Write($read, to_memory(new ArrayMemory()))), @@ -111,7 +111,7 @@ public function test_with_children_refuses_a_child_that_is_not_a_consumer(): voi $node = new Outputs(new Result($read), new Write($read, to_memory(new ArrayMemory()))); $this->expectException(InvalidLogicException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'An Outputs consumer rewrite must return a Result, a Write or a Transaction, ' . $read::class . ' given', ); diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Logical/Node/ReadTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Logical/Node/ReadTest.php index 984f300a20..6d83c88900 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Logical/Node/ReadTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Logical/Node/ReadTest.php @@ -99,7 +99,7 @@ public function test_with_offset_is_refused_on_an_extractor_that_is_no_file_extr public function test_with_limit_refuses_zero_or_less(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Limit must be greater than 0'); + $this->expectExceptionMessageIsOrContains('Limit must be greater than 0'); new Read(from_array([['id' => 1]]))->withLimit(0); } @@ -107,7 +107,7 @@ public function test_with_limit_refuses_zero_or_less(): void public function test_a_filter_is_refused_for_an_extractor_that_is_no_file_extractor(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Only a FileExtractor reads a pushed filter, Flow\ETL\IO\Extractor\ArrayExtractor does not', ); @@ -117,7 +117,7 @@ public function test_a_filter_is_refused_for_an_extractor_that_is_no_file_extrac public function test_a_path_filter_is_refused_for_an_extractor_that_is_no_file_extractor(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Only a FileExtractor reads a pushed filter, Flow\ETL\IO\Extractor\ArrayExtractor does not', ); @@ -127,7 +127,7 @@ public function test_a_path_filter_is_refused_for_an_extractor_that_is_no_file_e public function test_pushed_columns_are_refused_for_an_extractor_that_is_no_file_extractor(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Only a FileExtractor reads a pushed filter, Flow\ETL\IO\Extractor\ArrayExtractor does not', ); diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Logical/Node/RenameEachTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Logical/Node/RenameEachTest.php index bd5e9eb18d..cdc8cfa86c 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Logical/Node/RenameEachTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Logical/Node/RenameEachTest.php @@ -51,7 +51,7 @@ public function test_declarations(): void public function test_no_strategies_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('At least one strategy must be provided.'); + $this->expectExceptionMessageIsOrContains('At least one strategy must be provided.'); new RenameEach(NodeMother::read(), []); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Logical/Node/TopNTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Logical/Node/TopNTest.php index e8a236a2a9..facf1056b4 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Logical/Node/TopNTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Logical/Node/TopNTest.php @@ -51,7 +51,7 @@ public function test_with_children_keeps_columns_and_limit_over_a_new_input(): v public function test_a_limit_below_one_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('TopN limit must be greater than 0, given: 0'); + $this->expectExceptionMessageIsOrContains('TopN limit must be greater than 0, given: 0'); new TopN(NodeMother::read(), [ref('id')->asc()], 0); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Logical/Node/TransactionTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Logical/Node/TransactionTest.php index bbca8e844b..1558452ffa 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Logical/Node/TransactionTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Logical/Node/TransactionTest.php @@ -47,7 +47,7 @@ public function test_writes_given_by_key_are_kept_as_a_list(): void public function test_a_transaction_without_a_write_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('At least one write must be provided'); + $this->expectExceptionMessageIsOrContains('At least one write must be provided'); new Transaction(new RecordingTransaction()); } @@ -81,7 +81,7 @@ public function test_with_children_refuses_a_child_that_is_not_a_write(): void ); $this->expectException(InvalidLogicException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'A write root rewrite must return a Write or a Transaction, ' . Read::class . ' given', ); diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Logical/ReplaceNodesTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Logical/ReplaceNodesTest.php index 82cd04e131..14741a233c 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Logical/ReplaceNodesTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Logical/ReplaceNodesTest.php @@ -67,7 +67,9 @@ public function test_a_node_of_other_than_one_child_is_not_removed(): void $replacements = new SplObjectStorage(); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Only a node of one child gives way to it, ' . $target::class . ' has 0'); + $this->expectExceptionMessageIsOrContains( + 'Only a node of one child gives way to it, ' . $target::class . ' has 0', + ); new ReplaceNodes($replacements, [$target])->of($target, $target); } @@ -80,7 +82,9 @@ public function test_a_node_both_replaced_and_removed_is_refused(): void $replacements[$target] = NodeMother::read(); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('A node is either replaced or removed, ' . Filter::class . ' is both'); + $this->expectExceptionMessageIsOrContains( + 'A node is either replaced or removed, ' . Filter::class . ' is both', + ); new ReplaceNodes($replacements, [$target]); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Optimizer/OptimizerTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Optimizer/OptimizerTest.php index 364e0edd0f..3838c552f2 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Optimizer/OptimizerTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Optimizer/OptimizerTest.php @@ -106,7 +106,7 @@ public function test_without_returns_a_new_optimizer(): void public function test_without_throws_on_an_unregistered_rule_name(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage(RecordingRule::class . ' is not a registered optimizer rule'); + $this->expectExceptionMessageIsOrContains(RecordingRule::class . ' is not a registered optimizer rule'); Optimizer::default()->without(RecordingRule::class); } @@ -137,7 +137,7 @@ public function test_with_returns_a_new_optimizer(): void public function test_with_throws_on_a_rule_class_already_registered(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage(CombineLimits::class . ' is already a registered optimizer rule'); + $this->expectExceptionMessageIsOrContains(CombineLimits::class . ' is already a registered optimizer rule'); Optimizer::default()->with(new CombineLimits()); } @@ -145,7 +145,7 @@ public function test_with_throws_on_a_rule_class_already_registered(): void public function test_with_throws_on_the_same_rule_class_given_twice(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage(CombineLimits::class . ' is already a registered optimizer rule'); + $this->expectExceptionMessageIsOrContains(CombineLimits::class . ' is already a registered optimizer rule'); new Optimizer()->with(new CombineLimits(), new CombineLimits()); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Optimizer/Rule/PushFilterIntoSourceTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Optimizer/Rule/PushFilterIntoSourceTest.php index 4c45d7aa6b..c68d96ee5e 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Optimizer/Rule/PushFilterIntoSourceTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Optimizer/Rule/PushFilterIntoSourceTest.php @@ -507,7 +507,9 @@ public function test_a_filter_inside_a_joined_frame_is_pushed_with_that_frames_c public function test_a_string_partition_compared_with_a_date_is_cast_and_a_non_date_value_fails(): void { $this->expectException(EvaluationException::class); - $this->expectExceptionMessage('Cast function failed: Can\'t cast "string" into "date" type (row 0)'); + $this->expectExceptionMessageIsOrContains( + 'Cast function failed: Can\'t cast "string" into "date" type (row 0)', + ); df() ->read(PartitionedSourceMother::yearMonth()) diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Optimizer/Rule/PushLimitIntoSourceTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Optimizer/Rule/PushLimitIntoSourceTest.php index 211b7455af..f2c103b0ef 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Optimizer/Rule/PushLimitIntoSourceTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Optimizer/Rule/PushLimitIntoSourceTest.php @@ -206,7 +206,9 @@ public function test_a_plan_without_a_limit_pushes_nothing(): void public function test_a_row_input_chain_that_does_not_end_in_a_read_throws(): void { $this->expectException(InvalidLogicException::class); - $this->expectExceptionMessage('A logical plan must end in a Read, ' . ChildlessNode::class . ' found'); + $this->expectExceptionMessageIsOrContains( + 'A logical plan must end in a Read, ' . ChildlessNode::class . ' found', + ); new PushLimitIntoSource()->apply( NodeMother::plan(NodeMother::limit(NodeMother::select(new ChildlessNode()), 10)), diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Physical/NodeTranslatorTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Physical/NodeTranslatorTest.php index 4a9a0c2bd1..05a1df82f6 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Physical/NodeTranslatorTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Physical/NodeTranslatorTest.php @@ -723,7 +723,7 @@ public function test_write_the_instance_the_node_holds_is_the_step(): void public function test_a_node_without_a_translation_throws(): void { $this->expectException(InvalidLogicException::class); - $this->expectExceptionMessage('No physical steps are known for node ' . ChildlessNode::class); + $this->expectExceptionMessageIsOrContains('No physical steps are known for node ' . ChildlessNode::class); NodeTranslatorMother::of(config())->steps(new ChildlessNode()); } @@ -742,7 +742,7 @@ public function test_top_n_steps_are_the_exact_list_in_order(): void public function test_a_write_partitioned_by_part_into_a_part_destination_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('cannot name the partition column "part"'); + $this->expectExceptionMessageIsOrContains('cannot name the partition column "part"'); NodeTranslatorMother::of(config())->steps( new Write( diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Physical/PhysicalPlanTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Physical/PhysicalPlanTest.php index 3096dc1271..b81379b6a9 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Physical/PhysicalPlanTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Physical/PhysicalPlanTest.php @@ -71,7 +71,7 @@ public function test_a_refusal_from_elsewhere_keeps_the_returned_rows_schema(): public function test_a_plan_without_a_schema_or_a_refusal_is_refused(): void { $this->expectException(InvalidLogicException::class); - $this->expectExceptionMessage('A plan without a schema requires a refusal'); + $this->expectExceptionMessageIsOrContains('A plan without a schema requires a refusal'); new PhysicalPlan(PipelinesMother::root(from_array([['id' => 1]]), []), null); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Physical/PlannedNodesTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Physical/PlannedNodesTest.php index c7407dfa1f..1d165be68e 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Physical/PlannedNodesTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Physical/PlannedNodesTest.php @@ -40,7 +40,7 @@ public function test_an_added_node_is_returned_by_identity(): void public function test_of_throws_for_a_node_never_planned(): void { $this->expectException(InvalidLogicException::class); - $this->expectExceptionMessage('was never planned'); + $this->expectExceptionMessageIsOrContains('was never planned'); new PlannedNodes()->of(NodeMother::read()); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Physical/PlannerTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Physical/PlannerTest.php index b0dd744bbc..d6d345710d 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Physical/PlannerTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Physical/PlannerTest.php @@ -779,7 +779,7 @@ public function test_a_spine_that_does_not_end_in_a_read_is_refused(): void $planned->add($leaf, new PlannedNode([], [], null)); $this->expectException(InvalidLogicException::class); - $this->expectExceptionMessage('A logical plan must end in a Read, ' . $leaf::class . ' found'); + $this->expectExceptionMessageIsOrContains('A logical plan must end in a Read, ' . $leaf::class . ' found'); config()->planner()->pipelines(new LogicalPlan(new Result($leaf)), $planned); } @@ -1061,7 +1061,9 @@ public function test_a_write_outside_a_transaction_sharing_a_node_with_one_of_it $shared = NodeMother::select($read); $this->expectException(InvalidLogicException::class); - $this->expectExceptionMessage('A write outside a transaction cannot share a node with one of its children'); + $this->expectExceptionMessageIsOrContains( + 'A write outside a transaction cannot share a node with one of its children', + ); config_builder() ->optimizer(new Optimizer()) @@ -1127,7 +1129,7 @@ public function test_two_writes_at_one_node_are_two_steps(): void public function test_a_write_sharing_no_node_with_the_spine_is_refused(): void { $this->expectException(InvalidLogicException::class); - $this->expectExceptionMessage('A write root shares no node with the plan: ' . MemoryLoader::class); + $this->expectExceptionMessageIsOrContains('A write root shares no node with the plan: ' . MemoryLoader::class); config_builder() ->optimizer(new Optimizer()) @@ -1150,7 +1152,7 @@ public function test_the_children_of_one_transaction_must_attach_to_the_same_nod $select = NodeMother::select($read); $this->expectException(InvalidLogicException::class); - $this->expectExceptionMessage('Every write of one transaction must attach to the same node'); + $this->expectExceptionMessageIsOrContains('Every write of one transaction must attach to the same node'); config_builder() ->optimizer(new Optimizer()) @@ -1217,7 +1219,7 @@ public function test_a_write_that_does_not_translate_to_a_loader_is_refused(): v $planned->add($write, new PlannedNode([], [], null)); $this->expectException(InvalidLogicException::class); - $this->expectExceptionMessage('A Write must translate to a Loader, null given'); + $this->expectExceptionMessageIsOrContains('A Write must translate to a Loader, null given'); config()->planner()->pipelines($logical, $planned); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Physical/WritePlannerTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Physical/WritePlannerTest.php index bdb7fc9dbc..923d20b084 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Physical/WritePlannerTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Planning/Physical/WritePlannerTest.php @@ -119,7 +119,9 @@ public function test_a_write_outside_a_transaction_sharing_a_node_with_one_of_it [$planner, $onSpine] = WritePlannerMother::over($writes, $read); $this->expectException(InvalidLogicException::class); - $this->expectExceptionMessage('A write outside a transaction cannot share a node with one of its children'); + $this->expectExceptionMessageIsOrContains( + 'A write outside a transaction cannot share a node with one of its children', + ); $planner->attach($writes, $onSpine); } @@ -138,7 +140,7 @@ public function test_the_children_of_one_transaction_must_attach_to_the_same_nod [$planner, $onSpine] = WritePlannerMother::over($writes, $read, $select); $this->expectException(InvalidLogicException::class); - $this->expectExceptionMessage('Every write of one transaction must attach to the same node'); + $this->expectExceptionMessageIsOrContains('Every write of one transaction must attach to the same node'); $planner->attach($writes, $onSpine); } @@ -150,7 +152,7 @@ public function test_a_write_sharing_no_node_with_the_spine_is_refused(): void [$planner, $onSpine] = WritePlannerMother::over($writes, $read); $this->expectException(InvalidLogicException::class); - $this->expectExceptionMessage('A write root shares no node with the plan: ' . MemoryLoader::class); + $this->expectExceptionMessageIsOrContains('A write root shares no node with the plan: ' . MemoryLoader::class); $planner->attach($writes, $onSpine); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Runtime/ErrorHandler/ErrorHandlingTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Runtime/ErrorHandler/ErrorHandlingTest.php index 6d2f030419..f02732ffd5 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Runtime/ErrorHandler/ErrorHandlingTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Runtime/ErrorHandler/ErrorHandlingTest.php @@ -148,7 +148,7 @@ public function load(Rows $rows, Backend $backend): void }; $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Transformer Exception'); + $this->expectExceptionMessageIsOrContains('Transformer Exception'); data_frame()->read($extractor)->onError(throw_error_handler())->with($brokenTransformer)->write($loader)->run(); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Runtime/Executor/ExecutorTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Runtime/Executor/ExecutorTest.php index c937a027fe..21290b110f 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Runtime/Executor/ExecutorTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Runtime/Executor/ExecutorTest.php @@ -1163,7 +1163,9 @@ public function test_a_plan_reading_back_from_itself_throws_cyclic_plan_on_run() $read = NodeMother::read(); $this->expectException(InvalidLogicException::class); - $this->expectExceptionMessage('Cannot run this plan: it reads from a DataFrame that reads back from it.'); + $this->expectExceptionMessageIsOrContains( + 'Cannot run this plan: it reads from a DataFrame that reads back from it.', + ); iterator_to_array(ExecutedPlan::of( NodeMother::plan(new Transform($read, new PlanDrainingTransformer(NodeMother::plan($read), $context))), diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Runtime/Executor/PartitionedOutputHasherTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Runtime/Executor/PartitionedOutputHasherTest.php index f9701de966..a98ad30fff 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Runtime/Executor/PartitionedOutputHasherTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Runtime/Executor/PartitionedOutputHasherTest.php @@ -192,7 +192,7 @@ public function test_a_later_batch_of_another_type_names_its_partition_in_the_de public function test_a_float_partition_column_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'analyze()->withDatasetHash() cannot group by the float column "price": 0.0 and -0.0 are one value but two ' . 'partition names. Cast it to a decimal string or an integer first.', ); @@ -205,7 +205,7 @@ public function test_a_float_partition_column_is_refused(): void public function test_a_json_partition_column_is_refused(): void { $this->expectException(PartitionException::class); - $this->expectExceptionMessage('Column "payload" of type json can\'t be used as a partition'); + $this->expectExceptionMessageIsOrContains('Column "payload" of type json can\'t be used as a partition'); new PartitionedOutputHasher(refs('payload'), HashAlgorithm::xxh128)->add(array_to_rows([[ 'payload' => '{"a":1}', @@ -215,7 +215,7 @@ public function test_a_json_partition_column_is_refused(): void public function test_a_first_batch_without_a_named_column_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'analyze()->withDatasetHash() groups by "country", but a batch has no column "country". Name only columns ' . 'that every row of the output has.', ); @@ -250,7 +250,7 @@ public function test_a_later_batch_without_a_non_nullable_named_column_is_refuse ); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'analyze()->withDatasetHash() groups by "country", but a batch has no column "country".', ); @@ -337,7 +337,7 @@ public function test_a_rebuilt_hasher_keeps_its_algorithm(): void public function test_an_aliased_partition_reference_fails_as_the_partitioned_loader_fails(): void { $this->expectException(SchemaDefinitionNotFoundException::class); - $this->expectExceptionMessage('Schema definition for column "day" not found.'); + $this->expectExceptionMessageIsOrContains('Schema definition for column "day" not found.'); new PartitionedOutputHasher(refs(ref('date')->as('day')), HashAlgorithm::xxh128)->add( array_to_rows([['date' => '2026-11-20', 'id' => 1]], schema(str_schema('date'), int_schema('id'))), diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Runtime/Executor/RunCountsTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Runtime/Executor/RunCountsTest.php index 0c54bd7000..c8f46fbe17 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Runtime/Executor/RunCountsTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Runtime/Executor/RunCountsTest.php @@ -469,7 +469,7 @@ public function test_a_partitioned_hash_refuses_rows_without_columns_that_no_par $counts = new RunCounts(new PartitionedOutputHasher(refs('country'), HashAlgorithm::xxh128)); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'analyze()->withDatasetHash() groups by "country", but a batch has no column "country".', ); @@ -487,7 +487,7 @@ public function test_a_partitioned_hash_refuses_the_uncovered_part_of_partly_cov $counts->absorbOutputHash($worker->hash()); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'analyze()->withDatasetHash() groups by "country", but a batch has no column "country".', ); @@ -550,7 +550,7 @@ public function test_a_partitioned_hash_refuses_uncovered_rows_without_columns_a ); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'analyze()->withDatasetHash() groups by "country", but a batch has no column "country".', ); diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Runtime/Executor/StepRunnerTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Runtime/Executor/StepRunnerTest.php index c52997c833..e79904fec3 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Runtime/Executor/StepRunnerTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Runtime/Executor/StepRunnerTest.php @@ -472,7 +472,7 @@ public function test_extraction_error_propagates_under_throw_error(): void $extractor = new CountingExtractor(schema(int_schema('id'))); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('source failed'); + $this->expectExceptionMessageIsOrContains('source failed'); iterator_to_array(new StepRunner()->steps( $steps, @@ -1131,7 +1131,7 @@ public function process(Generator $rows, Backend $backend): Generator VmStackContext::fillWithInts(); $this->expectException(Exception::class); - $this->expectExceptionMessage('Cannot rewind a generator that was already run'); + $this->expectExceptionMessageIsOrContains('Cannot rewind a generator that was already run'); iterator_to_array($steps, false); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Runtime/Executor/WholeOutputHasherTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Runtime/Executor/WholeOutputHasherTest.php index 188bd735d5..d39a31851d 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Runtime/Executor/WholeOutputHasherTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Runtime/Executor/WholeOutputHasherTest.php @@ -54,7 +54,7 @@ public function test_another_algorithm_is_hashed_reported_and_described(): void public function test_absorb_refuses_a_partial_of_another_algorithm(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('A md5 dataset hash cannot be added to a xxh128 dataset hash'); + $this->expectExceptionMessageIsOrContains('A md5 dataset hash cannot be added to a xxh128 dataset hash'); new WholeOutputHasher(HashAlgorithm::xxh128)->absorb(new DatasetHash(Hash::empty(), [], HashAlgorithm::md5)); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Runtime/Heartbeat/HeartbeatStageTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Runtime/Heartbeat/HeartbeatStageTest.php index bdc5d64e2a..70d5adc60c 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Runtime/Heartbeat/HeartbeatStageTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Runtime/Heartbeat/HeartbeatStageTest.php @@ -279,7 +279,7 @@ public function test_describes_its_name_id_and_location(): void public function test_from_description_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage(HeartbeatStage::class . ' is rebuilt by Rebuild::progress()'); + $this->expectExceptionMessageIsOrContains(HeartbeatStage::class . ' is rebuilt by Rebuild::progress()'); HeartbeatStage::fromDescription([], new Rebuild()); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Runtime/Heartbeat/ScheduledHeartbeatTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Runtime/Heartbeat/ScheduledHeartbeatTest.php index aa4022c468..5db1dae1ff 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Runtime/Heartbeat/ScheduledHeartbeatTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Runtime/Heartbeat/ScheduledHeartbeatTest.php @@ -20,7 +20,7 @@ final class ScheduledHeartbeatTest extends FlowTestCase public function test_refuses_a_zero_interval(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Heartbeat interval must be at least 0.1 seconds, got 0'); + $this->expectExceptionMessageIsOrContains('Heartbeat interval must be at least 0.1 seconds, got 0'); new ScheduledHeartbeat(new RecordingHeartbeat(), 0); } @@ -137,7 +137,7 @@ public function test_a_quarter_second_interval_beats_four_times_a_second(): void public function test_an_interval_below_a_tenth_of_a_second_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Heartbeat interval must be at least 0.1 seconds, got 0.05'); + $this->expectExceptionMessageIsOrContains('Heartbeat interval must be at least 0.1 seconds, got 0.05'); new ScheduledHeartbeat(new RecordingHeartbeat(), 0.05); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Runtime/Metrics/DatasetHashTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Runtime/Metrics/DatasetHashTest.php index 608d5b2272..53c06568a6 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Runtime/Metrics/DatasetHashTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Runtime/Metrics/DatasetHashTest.php @@ -249,7 +249,7 @@ public function test_a_stored_hash_keeps_its_algorithm(): void public function test_from_array_needs_the_algorithm(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('A dataset hash needs "algorithm" of type string'); + $this->expectExceptionMessageIsOrContains('A dataset hash needs "algorithm" of type string'); DatasetHash::fromArray(['total' => ['rows' => 0, 'value' => ''], 'partitions' => []]); } @@ -257,7 +257,7 @@ public function test_from_array_needs_the_algorithm(): void public function test_from_array_refuses_an_unknown_algorithm(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Unknown hash algorithm "crc32", use one of: md5, sha256, xxh128'); + $this->expectExceptionMessageIsOrContains('Unknown hash algorithm "crc32", use one of: md5, sha256, xxh128'); DatasetHash::fromArray([ 'algorithm' => 'crc32', @@ -269,7 +269,7 @@ public function test_from_array_refuses_an_unknown_algorithm(): void public function test_plus_refuses_a_hash_of_another_algorithm(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'A sha256 dataset hash cannot be added to a xxh128 dataset hash, hash both datasets with the same algorithm', ); @@ -281,7 +281,7 @@ public function test_plus_refuses_a_hash_of_another_algorithm(): void public function test_from_array_names_a_missing_key(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('A dataset hash needs "total" of type array'); + $this->expectExceptionMessageIsOrContains('A dataset hash needs "total" of type array'); DatasetHash::fromArray(['algorithm' => 'xxh128', 'partitions' => []]); } @@ -289,7 +289,7 @@ public function test_from_array_names_a_missing_key(): void public function test_from_array_names_a_key_of_another_type(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('A dataset hash needs "partitions" of type list>'); + $this->expectExceptionMessageIsOrContains('A dataset hash needs "partitions" of type list>'); DatasetHash::fromArray([ 'algorithm' => 'xxh128', @@ -301,7 +301,7 @@ public function test_from_array_names_a_key_of_another_type(): void public function test_from_array_names_a_missing_key_of_the_total(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('A hash needs "value" of type string'); + $this->expectExceptionMessageIsOrContains('A hash needs "value" of type string'); DatasetHash::fromArray(['algorithm' => 'xxh128', 'total' => ['rows' => 3], 'partitions' => []]); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Runtime/Metrics/HashTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Runtime/Metrics/HashTest.php index d59bf73a28..19126b4782 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Runtime/Metrics/HashTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Runtime/Metrics/HashTest.php @@ -44,7 +44,7 @@ public function test_from_array_reads_back_what_normalize_wrote(): void public function test_from_array_names_a_missing_key(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('A hash needs "rows" of type integer'); + $this->expectExceptionMessageIsOrContains('A hash needs "rows" of type integer'); Hash::fromArray(['value' => 'ab8476f29c95212a306bffff897d7afb']); } @@ -52,7 +52,7 @@ public function test_from_array_names_a_missing_key(): void public function test_from_array_names_a_key_of_another_type(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('A hash needs "value" of type string'); + $this->expectExceptionMessageIsOrContains('A hash needs "value" of type string'); Hash::fromArray(['rows' => 120, 'value' => 7]); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Runtime/Metrics/PartitionHashTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Runtime/Metrics/PartitionHashTest.php index 5a9ef5c089..0bf41f5893 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Runtime/Metrics/PartitionHashTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Runtime/Metrics/PartitionHashTest.php @@ -40,7 +40,7 @@ public function test_from_array_reads_back_what_normalize_wrote(): void public function test_from_array_names_a_missing_key(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('A partition hash needs "hash" of type array'); + $this->expectExceptionMessageIsOrContains('A partition hash needs "hash" of type array'); PartitionHash::fromArray(['partitions' => ['date' => '2026-11-20']]); } @@ -48,7 +48,7 @@ public function test_from_array_names_a_missing_key(): void public function test_from_array_names_a_key_of_another_type(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('A partition hash needs "partitions" of type map'); + $this->expectExceptionMessageIsOrContains('A partition hash needs "partitions" of type map'); PartitionHash::fromArray(['partitions' => ['date' => 1], 'hash' => ['rows' => 1, 'value' => 'ab']]); } @@ -56,7 +56,7 @@ public function test_from_array_names_a_key_of_another_type(): void public function test_from_array_names_a_missing_key_of_the_hash(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('A hash needs "rows" of type integer'); + $this->expectExceptionMessageIsOrContains('A hash needs "rows" of type integer'); PartitionHash::fromArray(['partitions' => ['date' => '2026-11-20'], 'hash' => ['value' => 'ab']]); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Runtime/Metrics/Statistics/ColumnsTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Runtime/Metrics/Statistics/ColumnsTest.php index 1564367cd0..b8e67d0b26 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Runtime/Metrics/Statistics/ColumnsTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Runtime/Metrics/Statistics/ColumnsTest.php @@ -49,7 +49,7 @@ public function test_get_non_existing_column(): void $columns = new Columns(); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Column "non_existing" does not exist.'); + $this->expectExceptionMessageIsOrContains('Column "non_existing" does not exist.'); $columns->get('non_existing'); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Runtime/Telemetry/TraceableRowsStorageTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Runtime/Telemetry/TraceableRowsStorageTest.php index fff878ca11..0583bc7c1c 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Runtime/Telemetry/TraceableRowsStorageTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Runtime/Telemetry/TraceableRowsStorageTest.php @@ -153,7 +153,7 @@ public function test_remove_records_exception_on_error(): void $cache = new TraceableRowsStorage(new ThrowingRemoveRowsStorage(new MemoryRowsStorage()), $this->telemetry); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('spill clear failed'); + $this->expectExceptionMessageIsOrContains('spill clear failed'); try { $cache->remove('test-key'); diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Storage/ApcuRowsStorageTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Storage/ApcuRowsStorageTest.php index fb98ec8d4d..49d567b31c 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Storage/ApcuRowsStorageTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Storage/ApcuRowsStorageTest.php @@ -137,7 +137,7 @@ public function test_a_chunk_another_writer_replaced_is_refused(): void apcu_store('flow_php_cache_test:rows:chunk:0', 42); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Rows under "rows" are corrupted or were not written by ApcuCache.'); + $this->expectExceptionMessageIsOrContains('Rows under "rows" are corrupted or were not written by ApcuCache.'); iterator_to_array($this->cache->get('rows')); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Storage/FilesystemRowsStorageTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Storage/FilesystemRowsStorageTest.php index d97a02e09f..636b66335f 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Storage/FilesystemRowsStorageTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Storage/FilesystemRowsStorageTest.php @@ -102,7 +102,7 @@ public function test_sections_start_at_the_row_offset_of_each_write_session(): v public function test_a_batch_size_of_zero_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Batch size must be at least 1'); + $this->expectExceptionMessageIsOrContains('Batch size must be at least 1'); // @mago-ignore analysis:invalid-argument new FilesystemRowsStorage(memory_filesystem(), path('memory://cache'), new PhpBackend(), 0); diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Storage/Floe/FloeFilesTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Storage/Floe/FloeFilesTest.php index 74d649138c..78800bd218 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Storage/Floe/FloeFilesTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Storage/Floe/FloeFilesTest.php @@ -149,7 +149,7 @@ public function test_negative_offset_throws(): void ->close(); $this->expectException(FloeException::class); - $this->expectExceptionMessage('offset must be greater or equal to 0'); + $this->expectExceptionMessageIsOrContains('offset must be greater or equal to 0'); iterator_to_array( new FloeFiles($filesystem, new AdaptiveBackend()) @@ -167,7 +167,7 @@ public function test_non_positive_limit_throws(): void ->close(); $this->expectException(FloeException::class); - $this->expectExceptionMessage('limit must be greater than 0'); + $this->expectExceptionMessageIsOrContains('limit must be greater than 0'); iterator_to_array( new FloeFiles($filesystem, new AdaptiveBackend()) @@ -402,7 +402,7 @@ public function test_corrupt_row_body_throws_wrapped_exception(): void $stream->close(); $this->expectException(FloeException::class); - $this->expectExceptionMessage('Floe BATCH frame is truncated, its directory is incomplete'); + $this->expectExceptionMessageIsOrContains('Floe BATCH frame is truncated, its directory is incomplete'); iterator_to_array( new FloeFiles($filesystem, new AdaptiveBackend()) @@ -424,7 +424,7 @@ public function test_corrupted_frame_chain_throws(): void $stream->close(); $this->expectException(FloeException::class); - $this->expectExceptionMessage('frame body is incomplete'); + $this->expectExceptionMessageIsOrContains('frame body is incomplete'); iterator_to_array( new FloeFiles($filesystem, new AdaptiveBackend()) @@ -534,7 +534,7 @@ public function test_footer_length_exceeding_file_throws(): void $stream->close(); $this->expectException(FloeException::class); - $this->expectExceptionMessage('footer does not fit inside the file'); + $this->expectExceptionMessageIsOrContains('footer does not fit inside the file'); new FloeFiles($filesystem, new AdaptiveBackend()) ->read($path) @@ -550,7 +550,7 @@ public function test_footer_of_file_smaller_than_header_and_trailer_throws(): vo $stream->close(); $this->expectException(FloeException::class); - $this->expectExceptionMessage('too small'); + $this->expectExceptionMessageIsOrContains('too small'); new FloeFiles($filesystem, new AdaptiveBackend()) ->read($path) @@ -567,7 +567,7 @@ public function test_footer_over_unsized_stream_throws(): void ->close(); $this->expectException(FloeException::class); - $this->expectExceptionMessage('requires a sized stream'); + $this->expectExceptionMessageIsOrContains('requires a sized stream'); new FloeFiles(new UnsizedStreamFilesystem($filesystem), new AdaptiveBackend()) ->read($path) @@ -606,7 +606,7 @@ public function test_open_with_non_noop_codec_throws(): void ->close(); $this->expectException(FloeException::class); - $this->expectExceptionMessage('supports only the no-op codec, got codec 0x09'); + $this->expectExceptionMessageIsOrContains('supports only the no-op codec, got codec 0x09'); new FloeFiles($filesystem, new AdaptiveBackend(), new Options(codec: new CodecStub(0x09)))->read($path); } @@ -620,7 +620,7 @@ public function test_reader_with_mismatched_codec_flags_throws(): void $stream->close(); $this->expectException(FloeException::class); - $this->expectExceptionMessage('written with codec 0x07'); + $this->expectExceptionMessageIsOrContains('written with codec 0x07'); new FloeFiles($filesystem, new AdaptiveBackend()) ->read($path) @@ -660,7 +660,7 @@ public function test_torn_file_without_footer_throws_in_strict_mode(): void ]], schema(int_schema('id')))); $this->expectException(FloeException::class); - $this->expectExceptionMessage('magic'); + $this->expectExceptionMessageIsOrContains('magic'); iterator_to_array( new FloeFiles($filesystem, new AdaptiveBackend()) @@ -682,7 +682,7 @@ public function test_unknown_frame_type_throws(): void $stream->close(); $this->expectException(FloeException::class); - $this->expectExceptionMessage('unknown frame type 0x55'); + $this->expectExceptionMessageIsOrContains('unknown frame type 0x55'); iterator_to_array( new FloeFiles($filesystem, new AdaptiveBackend()) @@ -790,7 +790,7 @@ public function test_append_to_a_zero_row_file_with_an_explicit_schema_validates $writer = new FloeFiles($filesystem, new AdaptiveBackend())->append($path, schema(int_schema('id'))); $this->expectException(IncompatibleSchemaException::class); - $this->expectExceptionMessage('new column "name"'); + $this->expectExceptionMessageIsOrContains('new column "name"'); $writer->write(array_to_rows([['name' => 'flow']], schema(str_schema('name')))); } @@ -820,7 +820,7 @@ public function test_append_over_unsized_stream_throws(): void ->close(); $this->expectException(FloeException::class); - $this->expectExceptionMessage('requires a sized stream'); + $this->expectExceptionMessageIsOrContains('requires a sized stream'); new FloeFiles(new UnsizedStreamFilesystem($filesystem), new AdaptiveBackend())->append($path, schema()); } @@ -834,7 +834,7 @@ public function test_append_with_footer_length_exceeding_file_throws(): void $stream->close(); $this->expectException(FloeException::class); - $this->expectExceptionMessage('footer does not fit inside the file'); + $this->expectExceptionMessageIsOrContains('footer does not fit inside the file'); new FloeFiles($filesystem, new AdaptiveBackend())->append($path, schema()); } @@ -872,7 +872,7 @@ public function test_append_to_file_with_different_codec_flags_throws(): void $stream->close(); $this->expectException(FloeException::class); - $this->expectExceptionMessage('written with codec 0x05'); + $this->expectExceptionMessageIsOrContains('written with codec 0x05'); new FloeFiles($filesystem, new AdaptiveBackend())->append($path, schema()); } @@ -886,7 +886,7 @@ public function test_append_to_torn_file_throws(): void $stream->close(); $this->expectException(FloeException::class); - $this->expectExceptionMessage('torn'); + $this->expectExceptionMessageIsOrContains('torn'); new FloeFiles($filesystem, new AdaptiveBackend())->append($path, schema()); } @@ -900,7 +900,7 @@ public function test_append_to_truncated_stub_throws(): void $stream->close(); $this->expectException(FloeException::class); - $this->expectExceptionMessage('too small'); + $this->expectExceptionMessageIsOrContains('too small'); new FloeFiles($filesystem, new AdaptiveBackend())->append($path, schema()); } @@ -940,7 +940,7 @@ public function test_append_with_new_non_nullable_column_throws(): void $writer->close(); $this->expectException(IncompatibleSchemaException::class); - $this->expectExceptionMessage('new column "email"'); + $this->expectExceptionMessageIsOrContains('new column "email"'); $writer = new FloeFiles($filesystem, new AdaptiveBackend())->append($path, schema(int_schema('id'))); $writer->write(array_to_rows([['id' => 2, 'email' => 'x']], schema(int_schema('id'), str_schema('email')))); @@ -958,7 +958,7 @@ public function test_append_with_new_nullable_column_throws(): void $writer = new FloeFiles($filesystem, new AdaptiveBackend())->append($path, schema(int_schema('id'))); $this->expectException(IncompatibleSchemaException::class); - $this->expectExceptionMessage('new column "email"'); + $this->expectExceptionMessageIsOrContains('new column "email"'); $writer->write(array_to_rows( [['id' => 2, 'email' => null]], @@ -1000,7 +1000,7 @@ public function test_close_twice_throws(): void $writer->close(); $this->expectException(FloeException::class); - $this->expectExceptionMessage('Floe writer session is closed'); + $this->expectExceptionMessageIsOrContains('Floe writer session is closed'); $writer->close(); } @@ -1026,7 +1026,7 @@ public function test_closing_empty_file_writes_header_and_footer_only(): void public function test_create_with_non_noop_codec_throws(): void { $this->expectException(FloeException::class); - $this->expectExceptionMessage('supports only the no-op codec, got codec 0x05'); + $this->expectExceptionMessageIsOrContains('supports only the no-op codec, got codec 0x05'); new FloeFiles(memory_filesystem(), new AdaptiveBackend(), new Options(codec: new CodecStub(0x05)))->create( path('memory://codec.floe'), @@ -1130,7 +1130,7 @@ public function test_write_after_close_throws(): void $writer->close(); $this->expectException(FloeException::class); - $this->expectExceptionMessage('Floe writer session is closed'); + $this->expectExceptionMessageIsOrContains('Floe writer session is closed'); $writer->write(array_to_rows([['id' => 1]], schema(int_schema('id')))); } @@ -1147,7 +1147,7 @@ public function test_append_refuses_a_different_datetime_zone(): void $writer->close(); $this->expectException(IncompatibleSchemaException::class); - $this->expectExceptionMessage('Floe append schema does not match the existing file schema.'); + $this->expectExceptionMessageIsOrContains('Floe append schema does not match the existing file schema.'); new FloeFiles($filesystem, new AdaptiveBackend())->append( $path, diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Storage/Floe/FloeMergerTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Storage/Floe/FloeMergerTest.php index f70250f95f..6d2c5c1dca 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Storage/Floe/FloeMergerTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Storage/Floe/FloeMergerTest.php @@ -184,7 +184,7 @@ public function test_empty_source_contributes_no_rows(): void public function test_empty_sources_list_throws(): void { $this->expectException(FloeException::class); - $this->expectExceptionMessage('at least one source'); + $this->expectExceptionMessageIsOrContains('at least one source'); new FloeMerger(memory_filesystem(), new AdaptiveBackend())->merge([], path('memory://out.floe')); } @@ -206,7 +206,7 @@ public function test_merging_a_source_that_adds_a_non_nullable_column_throws(): // "email" is non-nullable in B but absent from A - padding A's rows with null would // violate its required contract, so the merge is rejected rather than silently widened. $this->expectException(IncompatibleSchemaException::class); - $this->expectExceptionMessage('Floe merge cannot reconcile the schema of'); + $this->expectExceptionMessageIsOrContains('Floe merge cannot reconcile the schema of'); new FloeMerger($fs, new AdaptiveBackend())->merge([ path('memory://a.floe'), @@ -229,7 +229,7 @@ public function test_merging_a_source_that_drops_a_non_nullable_column_throws(): ); $this->expectException(IncompatibleSchemaException::class); - $this->expectExceptionMessage('Floe merge cannot reconcile the schema of'); + $this->expectExceptionMessageIsOrContains('Floe merge cannot reconcile the schema of'); new FloeMerger($fs, new AdaptiveBackend())->merge([ path('memory://a.floe'), @@ -315,7 +315,7 @@ public function test_metadata_is_merged_with_new_keys_winning(): void public function test_missing_source_throws(): void { $this->expectException(FloeException::class); - $this->expectExceptionMessage('does not exist'); + $this->expectExceptionMessageIsOrContains('does not exist'); new FloeMerger(memory_filesystem(), new AdaptiveBackend())->merge([path( 'memory://missing.floe', @@ -468,7 +468,7 @@ public function test_type_conflict_throws(): void ); $this->expectException(IncompatibleSchemaException::class); - $this->expectExceptionMessage('Floe merge cannot reconcile the schema of'); + $this->expectExceptionMessageIsOrContains('Floe merge cannot reconcile the schema of'); new FloeMerger($fs, new AdaptiveBackend())->merge([ path('memory://a.floe'), @@ -486,7 +486,7 @@ public function test_unsized_source_throws(): void ); $this->expectException(FloeException::class); - $this->expectExceptionMessage('does not report its size'); + $this->expectExceptionMessageIsOrContains('does not report its size'); new FloeMerger(new UnsizedStreamFilesystem($fs), new AdaptiveBackend())->merge([path( 'memory://a.floe', @@ -502,7 +502,7 @@ public function test_source_smaller_than_header_and_trailer_throws(): void ->close(); $this->expectException(FloeException::class); - $this->expectExceptionMessage('too small'); + $this->expectExceptionMessageIsOrContains('too small'); new FloeMerger($fs, new AdaptiveBackend())->merge([path('memory://tiny.floe')], path('memory://out.floe')); } @@ -516,7 +516,7 @@ public function test_non_noop_codec_source_throws(): void ->close(); $this->expectException(FloeException::class); - $this->expectExceptionMessage('written with codec 0x05'); + $this->expectExceptionMessageIsOrContains('written with codec 0x05'); new FloeMerger($fs, new AdaptiveBackend())->merge([path('memory://codec.floe')], path('memory://out.floe')); } @@ -530,7 +530,7 @@ public function test_source_with_footer_larger_than_file_throws(): void ->close(); $this->expectException(FloeException::class); - $this->expectExceptionMessage('footer does not fit'); + $this->expectExceptionMessageIsOrContains('footer does not fit'); new FloeMerger($fs, new AdaptiveBackend())->merge([path('memory://torn.floe')], path('memory://out.floe')); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Storage/Floe/FloeSerializerTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Storage/Floe/FloeSerializerTest.php index 98d28fd881..ad25265003 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Storage/Floe/FloeSerializerTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Storage/Floe/FloeSerializerTest.php @@ -164,7 +164,7 @@ public function test_a_rebuilt_batch_size_is_at_least_one_and_keeps_one(): void public function test_batch_size_below_one_throws(): void { $this->expectException(FloeException::class); - $this->expectExceptionMessage('Serializer batch size must be at least 1'); + $this->expectExceptionMessageIsOrContains('Serializer batch size must be at least 1'); // @mago-ignore analysis:invalid-argument new FloeSerializer(new AdaptiveBackend(), 0); @@ -180,7 +180,7 @@ public function test_unserialize_rejects_torn_bytes(): void public function test_unserialize_rejects_empty_payload(): void { $this->expectException(SerializationException::class); - $this->expectExceptionMessage('too small'); + $this->expectExceptionMessageIsOrContains('too small'); unserialize_from_string(new FloeSerializer(new AdaptiveBackend()), ''); } @@ -199,7 +199,7 @@ public function test_unserialize_rejects_row_count_mismatch(): void ); $this->expectException(SerializationException::class); - $this->expectExceptionMessage('decoded 1 of 2 rows'); + $this->expectExceptionMessageIsOrContains('decoded 1 of 2 rows'); unserialize_from_string(new FloeSerializer(new AdaptiveBackend()), $corrupted); } @@ -207,7 +207,7 @@ public function test_unserialize_rejects_row_count_mismatch(): void public function test_unserialize_rejects_payload_smaller_than_header_and_trailer(): void { $this->expectException(SerializationException::class); - $this->expectExceptionMessage('too small'); + $this->expectExceptionMessageIsOrContains('too small'); unserialize_from_string(new FloeSerializer(new AdaptiveBackend()), 'tiny'); } @@ -215,7 +215,7 @@ public function test_unserialize_rejects_payload_smaller_than_header_and_trailer public function test_unserialize_rejects_footer_that_does_not_fit(): void { $this->expectException(SerializationException::class); - $this->expectExceptionMessage('footer does not fit'); + $this->expectExceptionMessageIsOrContains('footer does not fit'); unserialize_from_string( new FloeSerializer(new AdaptiveBackend()), diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Storage/Floe/FloeStreamReaderTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Storage/Floe/FloeStreamReaderTest.php index 921e85f20a..3ded72ac93 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Storage/Floe/FloeStreamReaderTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Storage/Floe/FloeStreamReaderTest.php @@ -70,7 +70,7 @@ public function test_a_row_frame_is_an_unknown_frame_type(): void ); $this->expectException(FloeException::class); - $this->expectExceptionMessage('Floe found unknown frame type 0x02'); + $this->expectExceptionMessageIsOrContains('Floe found unknown frame type 0x02'); iterator_to_array( new FloeFiles($filesystem, new AdaptiveBackend()) diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Storage/Floe/FloeStreamWriterTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Storage/Floe/FloeStreamWriterTest.php index 33274e2670..25c751e240 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Storage/Floe/FloeStreamWriterTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Storage/Floe/FloeStreamWriterTest.php @@ -138,7 +138,7 @@ public function test_a_section_counts_the_rows_of_every_batch_and_the_byte_size_ public function test_create_with_non_noop_codec_throws(): void { $this->expectException(FloeException::class); - $this->expectExceptionMessage('supports only the no-op codec, got codec 0x05'); + $this->expectExceptionMessageIsOrContains('supports only the no-op codec, got codec 0x05'); FloeStreamWriter::create( memory_filesystem()->writeTo(path('memory://codec.floe')), @@ -232,7 +232,7 @@ public function test_batch_omitting_a_not_null_session_column_is_refused(): void $writer->write($first); $this->expectException(IncompatibleSchemaException::class); - $this->expectExceptionMessage('Missing Definitions'); + $this->expectExceptionMessageIsOrContains('Missing Definitions'); $writer->write(array_to_rows([['id' => 2]], schema(int_schema('id')))); } @@ -247,7 +247,7 @@ public function test_batch_introducing_a_new_column_throws_naming_the_column(): $writer->write(array_to_rows([['id' => 1]], schema(int_schema('id')))); $this->expectException(IncompatibleSchemaException::class); - $this->expectExceptionMessage('new column "email"'); + $this->expectExceptionMessageIsOrContains('new column "email"'); $writer->write(array_to_rows([['id' => 2, 'email' => 'x']], schema(int_schema('id'), str_schema('email')))); } @@ -262,7 +262,7 @@ public function test_batch_with_an_incompatible_type_throws_naming_the_column(): $writer->write(array_to_rows([['id' => 1]], schema(int_schema('id')))); $this->expectException(IncompatibleSchemaException::class); - $this->expectExceptionMessage('expected: id, given: id'); + $this->expectExceptionMessageIsOrContains('expected: id, given: id'); $writer->write(array_to_rows([['id' => 'x']], schema(str_schema('id')))); } @@ -277,7 +277,7 @@ public function test_new_column_message_names_the_session_schema_and_the_column( $writer->write(array_to_rows([['id' => 1]], schema(int_schema('id')))); $this->expectException(IncompatibleSchemaException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Floe write session schema is fixed and this batch does not fit it: new column "email".', ); @@ -330,7 +330,7 @@ public function test_writing_a_column_name_with_invalid_utf8_throws(): void ); $this->expectException(FloeException::class); - $this->expectExceptionMessage('failed to encode schema as JSON'); + $this->expectExceptionMessageIsOrContains('failed to encode schema as JSON'); // the schema is stored only in the footer, so the pure PHP engine rejects it when the footer // is written, while the native engine rejects it earlier, when it encodes the batch @@ -350,7 +350,7 @@ public function test_a_later_null_into_a_non_nullable_session_column_is_rejected $writer->write($first); $this->expectException(IncompatibleSchemaException::class); - $this->expectExceptionMessage('expected: opt, given: opt'); + $this->expectExceptionMessageIsOrContains('expected: opt, given: opt'); $writer->write(array_to_rows( [['id' => 2, 'opt' => null]], @@ -386,7 +386,7 @@ public function test_column_absent_from_the_session_schema_throws(): void ); $this->expectException(IncompatibleSchemaException::class); - $this->expectExceptionMessage('new column "b"'); + $this->expectExceptionMessageIsOrContains('new column "b"'); $writer->write(array_to_rows([['a' => 1, 'b' => 2]], schema(int_schema('a'), int_schema('b')))); } @@ -475,7 +475,7 @@ public function test_a_single_overflowing_row_rethrows_offset_overflow(): void ); $this->expectException(OffsetOverflow::class); - $this->expectExceptionMessage('overflow (row 0)'); + $this->expectExceptionMessageIsOrContains('overflow (row 0)'); $writer->write(Rows::fromColumns($schema, ['name' => $name], 1)); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Storage/Floe/FooterReaderTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Storage/Floe/FooterReaderTest.php index 9afb886902..100ca76017 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Storage/Floe/FooterReaderTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Storage/Floe/FooterReaderTest.php @@ -51,7 +51,7 @@ public function test_unsized_stream_throws(): void ->close(); $this->expectException(FloeException::class); - $this->expectExceptionMessage('requires a sized stream'); + $this->expectExceptionMessageIsOrContains('requires a sized stream'); new FooterReader()->read(new UnsizedSourceStream($fs->readFrom($path)), new NoopCodec()); } @@ -59,7 +59,7 @@ public function test_unsized_stream_throws(): void public function test_stream_too_small_throws(): void { $this->expectException(FloeException::class); - $this->expectExceptionMessage('too small'); + $this->expectExceptionMessageIsOrContains('too small'); new FooterReader()->read(new MemorySourceStream('FLOE'), new NoopCodec()); } @@ -67,7 +67,7 @@ public function test_stream_too_small_throws(): void public function test_codec_mismatch_throws(): void { $this->expectException(FloeException::class); - $this->expectExceptionMessage('written with codec 0x05, expected 0x00'); + $this->expectExceptionMessageIsOrContains('written with codec 0x05, expected 0x00'); new FooterReader()->read( new MemorySourceStream('FLOE' . chr(Format::VERSION) . "\x05" . str_repeat("\0", 10)), @@ -85,7 +85,7 @@ public function test_footer_that_does_not_fit_throws(): void ->close(); $this->expectException(FloeException::class); - $this->expectExceptionMessage('footer does not fit inside the file'); + $this->expectExceptionMessageIsOrContains('footer does not fit inside the file'); new FooterReader()->read($fs->readFrom($path), new NoopCodec()); } @@ -120,7 +120,7 @@ public function test_leaves_the_source_open_on_error(): void public function test_a_footer_one_byte_too_long_to_fit_is_torn(): void { - $this->expectExceptionMessage('is torn, footer does not fit inside the file'); + $this->expectExceptionMessageIsOrContains('is torn, footer does not fit inside the file'); new FooterReader()->read( new MemorySourceStream( diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Storage/Floe/FooterStatisticsTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Storage/Floe/FooterStatisticsTest.php index b402e192e8..407a74d783 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Storage/Floe/FooterStatisticsTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Storage/Floe/FooterStatisticsTest.php @@ -14,7 +14,7 @@ final class FooterStatisticsTest extends TestCase public function test_a_missing_key_is_rejected(): void { $this->expectException(FloeException::class); - $this->expectExceptionMessage('Floe footer statistics are malformed'); + $this->expectExceptionMessageIsOrContains('Floe footer statistics are malformed'); FooterStatistics::fromArray(['rows' => 1]); } @@ -44,7 +44,7 @@ public function test_it_round_trips_through_from_array(): void public function test_negative_values_are_rejected(int $rows, int $byteSize, string $message): void { $this->expectException(FloeException::class); - $this->expectExceptionMessage($message); + $this->expectExceptionMessageIsOrContains($message); new FooterStatistics($rows, $byteSize); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Storage/Floe/FooterTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Storage/Floe/FooterTest.php index 2de8c0a045..1ebb82d023 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Storage/Floe/FooterTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Storage/Floe/FooterTest.php @@ -58,7 +58,7 @@ public function test_from_json_requires_all_fields(): void public function test_from_json_with_malformed_json_throws(): void { $this->expectException(FloeException::class); - $this->expectExceptionMessage('failed to decode footer JSON'); + $this->expectExceptionMessageIsOrContains('failed to decode footer JSON'); Footer::fromJson('{broken'); } @@ -73,7 +73,7 @@ public function test_from_json_with_non_integer_version_throws(): void public function test_a_footer_without_a_statistics_block_is_rejected(): void { $this->expectException(FloeException::class); - $this->expectExceptionMessage('Floe footer is malformed'); + $this->expectExceptionMessageIsOrContains('Floe footer is malformed'); Footer::fromJson('{"version":2,"writer":"x","schema":[],"sections":[],"totalRows":0,"metadata":{}}'); } @@ -81,7 +81,7 @@ public function test_a_footer_without_a_statistics_block_is_rejected(): void public function test_malformed_statistics_are_rejected(): void { $this->expectException(FloeException::class); - $this->expectExceptionMessage('Floe footer statistics are malformed'); + $this->expectExceptionMessageIsOrContains('Floe footer statistics are malformed'); Footer::fromJson( '{"version":2,"writer":"x","schema":[],"sections":[],"statistics":{"rows":"0","byteSize":0},"metadata":{}}', @@ -141,7 +141,7 @@ public function test_from_json_round_trips_typed_metadata(): void public function test_from_json_with_non_scalar_metadata_value_throws(): void { $this->expectException(FloeException::class); - $this->expectExceptionMessage('metadata is malformed'); + $this->expectExceptionMessageIsOrContains('metadata is malformed'); Footer::fromJson( '{"version":1,"writer":"x","schema":[],"sections":[],"statistics":{"rows":0,"byteSize":0},"metadata":{"bad":null}}', @@ -233,7 +233,7 @@ public function test_footer_json_with_511_nested_containers_decodes(): void public function test_footer_json_with_512_nested_containers_is_refused(): void { $this->expectException(FloeException::class); - $this->expectExceptionMessage('Floe failed to decode footer JSON: Maximum stack depth exceeded'); + $this->expectExceptionMessageIsOrContains('Floe failed to decode footer JSON: Maximum stack depth exceeded'); Footer::fromJson( '{"x":' . str_repeat('[', 511) . str_repeat(']', 511) . ',' . substr(FooterMother::footer()->toJson(), 1), diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Storage/Floe/FormatTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Storage/Floe/FormatTest.php index e48fcd4054..12a85d697f 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Storage/Floe/FormatTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Storage/Floe/FormatTest.php @@ -36,7 +36,7 @@ public function test_parse_trailer_returns_footer_length(): void public function test_parse_trailer_with_unknown_magic_throws(): void { $this->expectException(FloeException::class); - $this->expectExceptionMessage('magic'); + $this->expectExceptionMessageIsOrContains('magic'); Format::parseTrailer(pack('V', 10) . 'NOPE'); } @@ -44,7 +44,7 @@ public function test_parse_trailer_with_unknown_magic_throws(): void public function test_parse_trailer_with_wrong_length_throws(): void { $this->expectException(FloeException::class); - $this->expectExceptionMessage('exactly 8 bytes'); + $this->expectExceptionMessageIsOrContains('exactly 8 bytes'); Format::parseTrailer('FLOE'); } @@ -65,7 +65,7 @@ public function test_validate_codec_id_accepts_noop(): void public function test_validate_codec_id_rejects_other_codecs(): void { $this->expectException(FloeException::class); - $this->expectExceptionMessage('supports only the no-op codec'); + $this->expectExceptionMessageIsOrContains('supports only the no-op codec'); Format::validateCodecId(0x01); } @@ -78,7 +78,7 @@ public function test_validate_header_returns_flags(): void public function test_validate_header_with_unknown_magic_throws(): void { $this->expectException(FloeException::class); - $this->expectExceptionMessage('magic'); + $this->expectExceptionMessageIsOrContains('magic'); Format::validateHeader('NOPE' . "\x01\x00"); } @@ -86,7 +86,7 @@ public function test_validate_header_with_unknown_magic_throws(): void public function test_validate_header_with_unsupported_version_throws(): void { $this->expectException(FloeException::class); - $this->expectExceptionMessage('version'); + $this->expectExceptionMessageIsOrContains('version'); Format::validateHeader(Format::MAGIC . "\x7F\x00"); } @@ -94,7 +94,7 @@ public function test_validate_header_with_unsupported_version_throws(): void public function test_validate_header_rejects_version_1(): void { $this->expectException(FloeException::class); - $this->expectExceptionMessage('Floe does not support format version 1'); + $this->expectExceptionMessageIsOrContains('Floe does not support format version 1'); Format::validateHeader(Format::MAGIC . "\x01\x00"); } @@ -102,7 +102,7 @@ public function test_validate_header_rejects_version_1(): void public function test_validate_truncated_header_throws(): void { $this->expectException(FloeException::class); - $this->expectExceptionMessage('header is incomplete'); + $this->expectExceptionMessageIsOrContains('header is incomplete'); Format::validateHeader('FLO'); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Storage/Memory/ArrayMemoryTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Storage/Memory/ArrayMemoryTest.php index 1a442c554a..c05494a7db 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Storage/Memory/ArrayMemoryTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Storage/Memory/ArrayMemoryTest.php @@ -15,7 +15,7 @@ final class ArrayMemoryTest extends FlowTestCase public function test_chunk_size_must_be_greater_than_0(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Chunk size must be greater than 0'); + $this->expectExceptionMessageIsOrContains('Chunk size must be greater than 0'); new ArrayMemory()->chunks(0); } @@ -33,7 +33,7 @@ public function test_chunks(): void public function test_create_memory_from_invalid_data_structure(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Memory expects nested array data structure: array>'); + $this->expectExceptionMessageIsOrContains('Memory expects nested array data structure: array>'); // @mago-ignore analysis:invalid-argument new ArrayMemory([1, 2, 3]); @@ -60,7 +60,7 @@ public function test_map(): void public function test_save_memory_from_invalid_data_structure(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Memory expects nested array data structure: array>'); + $this->expectExceptionMessageIsOrContains('Memory expects nested array data structure: array>'); // @mago-ignore analysis:invalid-argument new ArrayMemory()->save([1, 2, 3]); diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Storage/PsrRowsStorageTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Storage/PsrRowsStorageTest.php index 7bffd30b89..a2879dc8f1 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Storage/PsrRowsStorageTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Storage/PsrRowsStorageTest.php @@ -159,7 +159,7 @@ public function test_round_trips_schema_changing_rows(): void public function test_rejects_prefix_with_psr16_reserved_character(string $prefix): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Prefix must not contain PSR-16 reserved characters {}()/\\@:, given: ' + $this->expectExceptionMessageIsOrContains('Prefix must not contain PSR-16 reserved characters {}()/\\@:, given: ' . $prefix); new PsrRowsStorage(new ArrayCache(), new FloeSerializer(new AdaptiveBackend()), prefix: $prefix); diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/BatchSizeTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/BatchSizeTest.php index 2be9de31d7..520de985e0 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/BatchSizeTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/BatchSizeTest.php @@ -26,7 +26,7 @@ public function test_one_row_is_the_smallest_batch(): void public function test_a_size_below_one_is_refused(int $size): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Batch size must be greater than 0, got ' . $size); + $this->expectExceptionMessageIsOrContains('Batch size must be greater than 0, got ' . $size); new BatchSize($size); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/CardinalityTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/CardinalityTest.php index 6af69fbc0a..5ec3273144 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/CardinalityTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/CardinalityTest.php @@ -27,7 +27,7 @@ public function test_a_bound_survives_only_if_both_sides_have_one(): void public function test_a_negative_bound_is_rejected(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Cardinality upper bound must not be negative, given: -1'); + $this->expectExceptionMessageIsOrContains('Cardinality upper bound must not be negative, given: -1'); new Cardinality(atMost: -1); } @@ -35,7 +35,7 @@ public function test_a_negative_bound_is_rejected(): void public function test_a_negative_estimate_is_rejected(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Cardinality estimate must not be negative, given: -1'); + $this->expectExceptionMessageIsOrContains('Cardinality estimate must not be negative, given: -1'); new Cardinality(estimate: -1); } @@ -43,7 +43,7 @@ public function test_a_negative_estimate_is_rejected(): void public function test_a_negative_relative_error_is_rejected(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Relative error must not be negative, given: -0.1'); + $this->expectExceptionMessageIsOrContains('Relative error must not be negative, given: -0.1'); new Cardinality(relativeError: -0.1); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/AdaptiveBackendTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/AdaptiveBackendTest.php index b454209d4a..456bc6f4c9 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/AdaptiveBackendTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/AdaptiveBackendTest.php @@ -56,7 +56,7 @@ public function test_adopt_is_what_the_php_backend_adopts(): void public function test_adopt_refuses_an_untyped_column(): void { $this->expectException(ColumnMismatchException::class); - $this->expectExceptionMessage('column "a": mixed cannot be a batch column'); + $this->expectExceptionMessageIsOrContains('column "a": mixed cannot be a batch column'); new AdaptiveBackend()->adopt(int_schema('a'), new ValueColumn([1])); } @@ -296,7 +296,7 @@ public function test_partition_is_what_the_php_backend_partitions(): void public function test_a_flow_php_of_another_abi_is_refused(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('does not match flow-php/etl'); + $this->expectExceptionMessageIsOrContains('does not match flow-php/etl'); new AdaptiveBackend(new FlowPhpExtension(true, FlowPhpExtension::ABI + 1, '0.46.0')); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/CanonicalEncodingTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/CanonicalEncodingTest.php index 8b06c32788..7147d4e8e8 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/CanonicalEncodingTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/CanonicalEncodingTest.php @@ -574,7 +574,9 @@ public function test_named_of_only_nulls_is_empty(): void public function test_type_outside_the_table_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('type mixed has no canonical encoding, declare the type of the column'); + $this->expectExceptionMessageIsOrContains( + 'type mixed has no canonical encoding, declare the type of the column', + ); new CanonicalEncoding()->ordered([new MistypedColumnStub( ColumnMother::of(int_schema('a'), [1]), diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/ColumnConcatTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/ColumnConcatTest.php index d80a7d7b89..a768e1be6b 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/ColumnConcatTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/ColumnConcatTest.php @@ -89,7 +89,7 @@ public function test_constant_columns_with_different_values_expand(): void public function test_a_mixed_class_concat_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('cannot concat'); + $this->expectExceptionMessageIsOrContains('cannot concat'); ColumnMother::of(int_schema('a'), [1])->concat(new PhpBackend()->constant(int_schema('a'), 7, 2)); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/ColumnWithTypeTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/ColumnWithTypeTest.php index 9748852c67..0d812e0757 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/ColumnWithTypeTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/ColumnWithTypeTest.php @@ -61,7 +61,7 @@ public function test_a_nullable_list_element_with_a_null_does_not_narrow(): void $column = ColumnMother::of(list_schema('a', type_list(type_optional(type_integer()))), [[1, null]]); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('1 null values under a required type'); + $this->expectExceptionMessageIsOrContains('1 null values under a required type'); $column->withType(type_list(type_integer())); } @@ -86,7 +86,7 @@ public function test_an_optional_structure_element_with_an_absent_value_does_not ); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('1 absent values under the required element "y"'); + $this->expectExceptionMessageIsOrContains('1 absent values under the required element "y"'); $column->withType(type_structure(['x' => type_integer(), 'y' => type_integer()])); } @@ -113,7 +113,9 @@ public function test_a_renamed_structure_element_is_another_kind(): void $column = ColumnMother::of(structure_schema('a', type_structure(['x' => type_integer()])), [['x' => 1]]); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('structure{x: integer} and structure{z: integer} are different column kinds'); + $this->expectExceptionMessageIsOrContains( + 'structure{x: integer} and structure{z: integer} are different column kinds', + ); $column->withType(type_structure(['z' => type_integer()])); } @@ -121,7 +123,7 @@ public function test_a_renamed_structure_element_is_another_kind(): void public function test_an_integer_does_not_become_a_string(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('integer and string are different column kinds'); + $this->expectExceptionMessageIsOrContains('integer and string are different column kinds'); ColumnMother::of(int_schema('id'), [1])->withType(type_string()); } @@ -129,7 +131,7 @@ public function test_an_integer_does_not_become_a_string(): void public function test_an_enum_does_not_change_its_class(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('are different column kinds'); + $this->expectExceptionMessageIsOrContains('are different column kinds'); ColumnMother::of(enum_schema('a', BackedStringEnum::class), [BackedStringEnum::one])->withType(type_enum( BackedIntEnum::class, diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Layout/BooleanLayoutTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Layout/BooleanLayoutTest.php index 9fc9a390aa..dec3df086e 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Layout/BooleanLayoutTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Layout/BooleanLayoutTest.php @@ -51,7 +51,7 @@ public function test_eight_rows_fit_in_one_byte(): void public function test_refuses_an_empty_buffer_for_eight_rows(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Boolean values buffer of 0 bytes, expected 1 for 8 rows'); + $this->expectExceptionMessageIsOrContains('Boolean values buffer of 0 bytes, expected 1 for 8 rows'); new BooleanLayout()->decode(new Buffers(['']), 8, array_fill(0, 8, true)); } @@ -59,7 +59,7 @@ public function test_refuses_an_empty_buffer_for_eight_rows(): void public function test_refuses_a_short_buffer(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Boolean values buffer of 1 bytes, expected 2 for 9 rows'); + $this->expectExceptionMessageIsOrContains('Boolean values buffer of 1 bytes, expected 2 for 9 rows'); new BooleanLayout()->decode(new Buffers(["\xFF"]), 9, array_fill(0, 9, true)); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Layout/BufferLayoutTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Layout/BufferLayoutTest.php index da180c7577..42db747ba5 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Layout/BufferLayoutTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Layout/BufferLayoutTest.php @@ -108,7 +108,7 @@ public function test_structure_children_span_their_parent(): void public function test_refuses_a_buffer_count_other_than_the_layout(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Column of type integer holds 1 buffers, its layout needs 2'); + $this->expectExceptionMessageIsOrContains('Column of type integer holds 1 buffers, its layout needs 2'); new BufferLayout()->nodes(type_integer(), 1, 0, ['']); } @@ -116,7 +116,7 @@ public function test_refuses_a_buffer_count_other_than_the_layout(): void public function test_refuses_an_offsets_buffer_of_another_length(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('List offsets buffer of 4 bytes, expected 8 for 1 rows'); + $this->expectExceptionMessageIsOrContains('List offsets buffer of 4 bytes, expected 8 for 1 rows'); new BufferLayout()->nodes(type_list(type_integer()), 1, 0, ['', pack('V', 0), '', '']); } @@ -124,7 +124,7 @@ public function test_refuses_an_offsets_buffer_of_another_length(): void public function test_refuses_a_map_entries_validity(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Map entries validity must be omitted, got 1 bytes'); + $this->expectExceptionMessageIsOrContains('Map entries validity must be omitted, got 1 bytes'); new BufferLayout()->nodes(type_map(type_string(), type_integer()), 1, 0, [ '', @@ -141,7 +141,7 @@ public function test_refuses_a_map_entries_validity(): void public function test_refuses_a_short_child_validity(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Validity bitmap of 1 bytes is too short for 9 rows'); + $this->expectExceptionMessageIsOrContains('Validity bitmap of 1 bytes is too short for 9 rows'); new BufferLayout()->nodes(type_list(type_optional(type_integer())), 1, 0, ['', pack('V2', 0, 9), "\x01", '']); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Layout/BuffersTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Layout/BuffersTest.php index 3d6138d4cd..80f89f8d35 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Layout/BuffersTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Layout/BuffersTest.php @@ -27,7 +27,7 @@ public function test_refuses_when_exhausted(): void $buffers->next(); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Column buffers exhausted'); + $this->expectExceptionMessageIsOrContains('Column buffers exhausted'); $buffers->next(); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Layout/FixedBinary16LayoutTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Layout/FixedBinary16LayoutTest.php index b9db2eb5ee..dc032001f0 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Layout/FixedBinary16LayoutTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Layout/FixedBinary16LayoutTest.php @@ -33,7 +33,7 @@ public function test_round_trips(): void public function test_refuses_a_wrong_length(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('FixedBinary16 values buffer of 15 bytes, expected 16 for 1 rows'); + $this->expectExceptionMessageIsOrContains('FixedBinary16 values buffer of 15 bytes, expected 16 for 1 rows'); new FixedBinary16Layout()->decode(new Buffers([str_repeat('a', 15)]), 1, [true]); } @@ -41,7 +41,7 @@ public function test_refuses_a_wrong_length(): void public function test_refuses_a_wrong_length_for_two_rows(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('FixedBinary16 values buffer of 15 bytes, expected 32 for 2 rows'); + $this->expectExceptionMessageIsOrContains('FixedBinary16 values buffer of 15 bytes, expected 32 for 2 rows'); new FixedBinary16Layout()->decode(new Buffers([str_repeat('a', 15)]), 2, [true, true]); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Layout/Float64LayoutTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Layout/Float64LayoutTest.php index bc1a0a312e..8522278887 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Layout/Float64LayoutTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Layout/Float64LayoutTest.php @@ -36,7 +36,7 @@ public function test_round_trips(): void public function test_refuses_a_wrong_length(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Float64 values buffer of 9 bytes, expected 8 for 1 rows'); + $this->expectExceptionMessageIsOrContains('Float64 values buffer of 9 bytes, expected 8 for 1 rows'); new Float64Layout()->decode(new Buffers([str_repeat("\0", 9)]), 1, [true]); } @@ -44,7 +44,7 @@ public function test_refuses_a_wrong_length(): void public function test_refuses_a_wrong_length_for_two_rows(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Float64 values buffer of 9 bytes, expected 16 for 2 rows'); + $this->expectExceptionMessageIsOrContains('Float64 values buffer of 9 bytes, expected 16 for 2 rows'); new Float64Layout()->decode(new Buffers([str_repeat("\0", 9)]), 2, [true, true]); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Layout/Int32LayoutTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Layout/Int32LayoutTest.php index 2fc641debb..8d4b9cf708 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Layout/Int32LayoutTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Layout/Int32LayoutTest.php @@ -40,7 +40,7 @@ public function test_round_trips_signed_values(): void public function test_refuses_a_wrong_length(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Int32 values buffer of 3 bytes, expected 4 for 1 rows'); + $this->expectExceptionMessageIsOrContains('Int32 values buffer of 3 bytes, expected 4 for 1 rows'); new Int32Layout()->decode(new Buffers(["\0\0\0"]), 1, [true]); } @@ -48,7 +48,7 @@ public function test_refuses_a_wrong_length(): void public function test_refuses_a_wrong_length_for_two_rows(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Int32 values buffer of 3 bytes, expected 8 for 2 rows'); + $this->expectExceptionMessageIsOrContains('Int32 values buffer of 3 bytes, expected 8 for 2 rows'); new Int32Layout()->decode(new Buffers(["\0\0\0"]), 2, [true, true]); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Layout/Int64LayoutTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Layout/Int64LayoutTest.php index 2a9dcd9c98..021d1f7a24 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Layout/Int64LayoutTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Layout/Int64LayoutTest.php @@ -40,7 +40,7 @@ public function test_decodes_zero_rows(): void public function test_refuses_a_wrong_length(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Int64 values buffer of 7 bytes, expected 8 for 1 rows'); + $this->expectExceptionMessageIsOrContains('Int64 values buffer of 7 bytes, expected 8 for 1 rows'); new Int64Layout()->decode(new Buffers(["\0\0\0\0\0\0\0"]), 1, [true]); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Layout/OffsetsTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Layout/OffsetsTest.php index a2e9c70a85..7fab6cd831 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Layout/OffsetsTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Layout/OffsetsTest.php @@ -27,7 +27,9 @@ public function test_packs_the_last_i32_offset(): void public function test_refuses_an_offset_past_the_i32_range(): void { $this->expectException(OffsetOverflow::class); - $this->expectExceptionMessage('Offsets exceed the i32 range of a batch buffer: the last offset is 2147483648'); + $this->expectExceptionMessageIsOrContains( + 'Offsets exceed the i32 range of a batch buffer: the last offset is 2147483648', + ); new Offsets()->pack([0, 2_147_483_648]); } @@ -40,7 +42,7 @@ public function test_unpacks(): void public function test_unpack_refuses_a_wrong_length(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('List offsets buffer of 8 bytes, expected 12 for 2 rows'); + $this->expectExceptionMessageIsOrContains('List offsets buffer of 8 bytes, expected 12 for 2 rows'); new Offsets()->unpack((string) hex2bin('0000000002000000'), 2, 'List'); } @@ -48,7 +50,7 @@ public function test_unpack_refuses_a_wrong_length(): void public function test_unpack_refuses_offsets_that_do_not_start_at_0(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('List offsets start at 1, not 0'); + $this->expectExceptionMessageIsOrContains('List offsets start at 1, not 0'); new Offsets()->unpack((string) hex2bin('0100000002000000'), 1, 'List'); } @@ -56,7 +58,7 @@ public function test_unpack_refuses_offsets_that_do_not_start_at_0(): void public function test_unpack_refuses_offsets_that_decrease(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('List offsets are not monotonic: offset 1 is 3, offset 2 is 2'); + $this->expectExceptionMessageIsOrContains('List offsets are not monotonic: offset 1 is 3, offset 2 is 2'); new Offsets()->unpack((string) hex2bin('000000000300000002000000'), 2, 'List'); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Layout/Utf8LayoutTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Layout/Utf8LayoutTest.php index a86e590a55..695daa7be3 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Layout/Utf8LayoutTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Layout/Utf8LayoutTest.php @@ -35,7 +35,7 @@ public function test_round_trips(): void public function test_refuses_a_last_offset_other_than_the_data_length(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Utf8 data buffer of 3 bytes, the last offset is 2'); + $this->expectExceptionMessageIsOrContains('Utf8 data buffer of 3 bytes, the last offset is 2'); new Utf8Layout()->decode(new Buffers(["\0\0\0\0\x02\0\0\0", 'abc']), 1, [true]); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Layout/ValidityTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Layout/ValidityTest.php index 3ce88bfde7..6918e0ab61 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Layout/ValidityTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Layout/ValidityTest.php @@ -113,7 +113,7 @@ public function test_the_nulls_of_the_flags(): void public function test_refuses_a_short_bitmap(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Validity bitmap of 1 bytes is too short for 9 rows'); + $this->expectExceptionMessageIsOrContains('Validity bitmap of 1 bytes is too short for 9 rows'); new Validity()->valid("\xFF", 9); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/MultisetDigestTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/MultisetDigestTest.php index be77b05ca1..43bf154ed3 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/MultisetDigestTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/MultisetDigestTest.php @@ -50,7 +50,7 @@ public function test_from_hex_reads_back_both_lanes_at_the_limits(): void public function test_from_hex_refuses_a_string_that_is_not_32_lowercase_hex_characters(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'A multiset digest is 32 lowercase hex characters, high lane first, given: "0000000000000000000000000000000"', ); diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Php/CastingColumnBuilderTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Php/CastingColumnBuilderTest.php index 194b0a098c..b184d6d2a3 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Php/CastingColumnBuilderTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Php/CastingColumnBuilderTest.php @@ -49,7 +49,7 @@ public function test_append_many_is_atomic_on_a_refusal(): void public function test_append_refuses_a_value_it_cannot_cast_as_append_many_does(): void { $this->expectException(ColumnMismatchException::class); - $this->expectExceptionMessage("column \"a\": could not convert 'abc' (string) to integer"); + $this->expectExceptionMessageIsOrContains("column \"a\": could not convert 'abc' (string) to integer"); new PhpBackend() ->builder(int_schema('a')) @@ -59,7 +59,9 @@ public function test_append_refuses_a_value_it_cannot_cast_as_append_many_does() public function test_append_many_refuses_null_under_not_null(): void { $this->expectException(SchemaMismatchException::class); - $this->expectExceptionMessage('column "a" (row 1): could not convert null to integer, column is not nullable'); + $this->expectExceptionMessageIsOrContains( + 'column "a" (row 1): could not convert null to integer, column is not nullable', + ); new PhpBackend() ->builder(int_schema('a')) @@ -89,7 +91,7 @@ public function test_append_from_copies_a_physical_cell(): void public function test_append_from_refuses_null_under_not_null(): void { $this->expectException(ColumnMismatchException::class); - $this->expectExceptionMessage('could not convert null to integer, column is not nullable'); + $this->expectExceptionMessageIsOrContains('could not convert null to integer, column is not nullable'); new PhpBackend() ->builder(int_schema('a')) @@ -99,7 +101,7 @@ public function test_append_from_refuses_null_under_not_null(): void public function test_append_take_refuses_null_under_not_null(): void { $this->expectException(ColumnMismatchException::class); - $this->expectExceptionMessage('could not convert null to integer, column is not nullable'); + $this->expectExceptionMessageIsOrContains('could not convert null to integer, column is not nullable'); new PhpBackend() ->builder(int_schema('a')) diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Php/ColumnDecoderTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Php/ColumnDecoderTest.php index 34d6768703..40e499ccda 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Php/ColumnDecoderTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Php/ColumnDecoderTest.php @@ -63,7 +63,9 @@ public function test_a_top_level_null_column(): void public function test_refuses_a_null_count_other_than_the_bitmap(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Column null count 1 disagrees with its validity bitmap (0 nulls in 1 rows)'); + $this->expectExceptionMessageIsOrContains( + 'Column null count 1 disagrees with its validity bitmap (0 nulls in 1 rows)', + ); new ColumnDecoder()->decode(type_integer(), new Buffers(['', "\0\0\0\0\0\0\0\0"]), 1, 1); } @@ -71,7 +73,7 @@ public function test_refuses_a_null_count_other_than_the_bitmap(): void public function test_refuses_nulls_in_a_non_optional_list_element(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('List child holds 1 nulls in a non-nullable integer'); + $this->expectExceptionMessageIsOrContains('List child holds 1 nulls in a non-nullable integer'); new ColumnDecoder()->decode( type_list(type_integer()), @@ -84,7 +86,7 @@ public function test_refuses_nulls_in_a_non_optional_list_element(): void public function test_refuses_nulls_in_a_map_key(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Map key child holds 1 nulls in a non-nullable string'); + $this->expectExceptionMessageIsOrContains('Map key child holds 1 nulls in a non-nullable string'); new ColumnDecoder()->decode( type_map(type_string(), type_integer()), @@ -97,7 +99,7 @@ public function test_refuses_nulls_in_a_map_key(): void public function test_refuses_nulls_in_a_non_optional_map_value(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Map value child holds 1 nulls in a non-nullable integer'); + $this->expectExceptionMessageIsOrContains('Map value child holds 1 nulls in a non-nullable integer'); new ColumnDecoder()->decode( type_map(type_string(), type_integer()), diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Php/ConstantColumnTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Php/ConstantColumnTest.php index 2bfeeccbdf..c64540b4a2 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Php/ConstantColumnTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Php/ConstantColumnTest.php @@ -117,7 +117,7 @@ public function test_with_type_restamps_the_value(): void public function test_with_type_refuses_another_column_kind(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('integer and string are different column kinds'); + $this->expectExceptionMessageIsOrContains('integer and string are different column kinds'); new PhpBackend() ->constant(int_schema('a'), 1, 2) diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Php/ListColumnTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Php/ListColumnTest.php index d1fa4f2d55..c6ccccf2cc 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Php/ListColumnTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Php/ListColumnTest.php @@ -82,7 +82,7 @@ public function test_concat_appends_offsets_and_nulls_of_every_column(): void public function test_with_type_refuses_another_column_kind(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('are different column kinds'); + $this->expectExceptionMessageIsOrContains('are different column kinds'); ColumnMother::of(list_schema('a', type_list(type_time_zone())), [['UTC']])->withType(type_string()); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Php/MapColumnTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Php/MapColumnTest.php index 107ba12a93..0126121479 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Php/MapColumnTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Php/MapColumnTest.php @@ -104,7 +104,7 @@ public function test_take_keeps_nulls_as_true(): void public function test_with_type_refuses_another_column_kind(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('are different column kinds'); + $this->expectExceptionMessageIsOrContains('are different column kinds'); ColumnMother::of(map_schema('a', type_map(type_string(), type_string())), [[ 'a' => 'x', diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Php/PhpGroupedCountsTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Php/PhpGroupedCountsTest.php index 6d5e631530..341b3a554f 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Php/PhpGroupedCountsTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Php/PhpGroupedCountsTest.php @@ -57,7 +57,7 @@ public function test_absorbing_earlier_counts_adds_them_into_the_mapped_groups() public function test_absorbing_an_earlier_group_it_never_counted_fails(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Earlier group 3 has no count'); + $this->expectExceptionMessageIsOrContains('Earlier group 3 has no count'); new PhpGroupedCounts()->absorbEarlier(new PhpGroupedCounts(), [3 => 0]); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Php/PhpGroupedMultisetHashesTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Php/PhpGroupedMultisetHashesTest.php index 1aea8cde19..6331c34517 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Php/PhpGroupedMultisetHashesTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Php/PhpGroupedMultisetHashesTest.php @@ -183,7 +183,7 @@ public function test_a_row_of_only_nulls_counts_as_a_row(): void public function test_an_earlier_group_it_lacks_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Earlier group 3 has no hash'); + $this->expectExceptionMessageIsOrContains('Earlier group 3 has no hash'); new PhpGroupedMultisetHashes(HashAlgorithm::xxh128)->absorbEarlier( new PhpGroupedMultisetHashes(HashAlgorithm::xxh128), diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Php/PhpGroupedTotalsTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Php/PhpGroupedTotalsTest.php index 36c9041f7c..5ff0120ae3 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Php/PhpGroupedTotalsTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Php/PhpGroupedTotalsTest.php @@ -124,7 +124,7 @@ public function test_absorbing_an_earlier_group_it_never_totalled_fails(): void $context = new GroupedTotalsContext(new PhpBackend(), int_schema('v')); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Earlier group 5 has no totals'); + $this->expectExceptionMessageIsOrContains('Earlier group 5 has no totals'); $context->grouped([[[1], [0]]])->absorbEarlier($context->grouped([[[2], [0]]]), [5 => 0]); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/PhpBackendTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/PhpBackendTest.php index 717138b193..51f532991a 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/PhpBackendTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/PhpBackendTest.php @@ -327,7 +327,7 @@ public function test_round_trips_null_under_a_nullable_definition( public function test_refuses_null_under_a_not_null_definition(Definition $definition): void { $this->expectException(ColumnMismatchException::class); - $this->expectExceptionMessage('could not convert null to'); + $this->expectExceptionMessageIsOrContains('could not convert null to'); new PhpBackend() ->builder($definition) @@ -390,7 +390,7 @@ public function test_the_null_definition_holds_nulls_only(): void public function test_refuses(Definition $definition, string $message): void { $this->expectException(ColumnMismatchException::class); - $this->expectExceptionMessage($message); + $this->expectExceptionMessageIsOrContains($message); new PhpBackend()->builder($definition); } @@ -398,7 +398,9 @@ public function test_refuses(Definition $definition, string $message): void public function test_time_refuses_months(): void { $this->expectException(ColumnMismatchException::class); - $this->expectExceptionMessage("Relative DateInterval (with months/years) can't be stored in a time column"); + $this->expectExceptionMessageIsOrContains( + "Relative DateInterval (with months/years) can't be stored in a time column", + ); new PhpBackend() ->builder(time_schema('a')) @@ -413,7 +415,7 @@ public function test_temporal_range(Definition $definition, mixed $value, bool $ { if (!$accepted) { $this->expectException(SchemaMismatchException::class); - $this->expectExceptionMessage('outside the'); + $this->expectExceptionMessageIsOrContains('outside the'); } static::assertIsInt(ColumnMother::of($definition, [$value])->at(0)); @@ -478,7 +480,9 @@ public function test_constant_null(): void public function test_constant_refuses_null_under_a_not_null_definition(): void { $this->expectException(ColumnMismatchException::class); - $this->expectExceptionMessage('column "a": could not convert null to integer, column is not nullable'); + $this->expectExceptionMessageIsOrContains( + 'column "a": could not convert null to integer, column is not nullable', + ); new PhpBackend()->constant(int_schema('a'), null, 2); } @@ -616,7 +620,7 @@ public function test_decode_refuses( string $message, ): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage($message); + $this->expectExceptionMessageIsOrContains($message); new PhpBackend()->decode($definition, $buffers, $count, $nullCount); } @@ -699,7 +703,9 @@ public function test_adopt_refuses_a_null_under_not_null(): void $foreign = new ForeignColumnStub(ColumnMother::of(int_schema('a', nullable: true), [1, null])); $this->expectException(ColumnMismatchException::class); - $this->expectExceptionMessage(ColumnMismatchException::valueDoesNotMatch('a', 'integer', null)->getMessage()); + $this->expectExceptionMessageIsOrContains( + ColumnMismatchException::valueDoesNotMatch('a', 'integer', null)->getMessage(), + ); new PhpBackend()->adopt(int_schema('a'), $foreign); } @@ -707,7 +713,7 @@ public function test_adopt_refuses_a_null_under_not_null(): void public function test_adopt_refuses_an_untyped_column(): void { $this->expectException(ColumnMismatchException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'column "a": mixed cannot be a batch column, an untyped function result exists only inside function evaluation', ); @@ -1096,7 +1102,7 @@ public static function frame_refusals(): Generator public function test_decode_frame_refuses(string $body, string $message): void { $this->expectException(FloeException::class); - $this->expectExceptionMessage($message); + $this->expectExceptionMessageIsOrContains($message); new PhpBackend()->decodeFrame($body, RowsMother::workedExample()->schema(), new NoopCodec()); } @@ -1106,7 +1112,9 @@ public function test_decode_frame_refuses_a_buffer_that_decodes_to_another_lengt $body = new PhpBackend()->encodeFrame(RowsMother::workedExample(), new TrailingZerosCodecStub()); $this->expectException(FloeException::class); - $this->expectExceptionMessage('Floe BATCH frame buffer 1 decodes to 16 bytes, its prefix declares 15'); + $this->expectExceptionMessageIsOrContains( + 'Floe BATCH frame buffer 1 decodes to 16 bytes, its prefix declares 15', + ); new PhpBackend()->decodeFrame( substr_replace($body, pack('P', 15), 72, 8), @@ -1123,7 +1131,9 @@ public function test_decode_frame_refuses_child_nodes_that_disagree_with_the_buf ], schema(list_schema('l', type_list(type_integer()), nullable: true))); $this->expectException(FloeException::class); - $this->expectExceptionMessage('Floe BATCH frame column "l" declares nodes that disagree with its buffers'); + $this->expectExceptionMessageIsOrContains( + 'Floe BATCH frame column "l" declares nodes that disagree with its buffers', + ); new PhpBackend()->decodeFrame(FrameContext::patch(new PhpBackend()->encodeFrame($rows, new NoopCodec()), [ 5 => 3, @@ -1156,7 +1166,7 @@ public function test_decode_frame_refuses_a_not_null_column_with_a_null_node(): ], schema(int_schema('id', nullable: true))), new NoopCodec()); $this->expectException(FloeException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Floe BATCH frame is malformed: Rows do not match their schema: column "id" (row 1): could not convert null to integer, column is not nullable', ); @@ -1350,7 +1360,7 @@ public function test_compare_orders_greater_than_as_the_swapped_less_than(): voi public function test_compare_refuses_the_different_operator(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Comparison was built with an unsupported operator'); + $this->expectExceptionMessageIsOrContains('Comparison was built with an unsupported operator'); new PhpBackend()->compare( ColumnMother::of(int_schema('a'), [1]), @@ -1364,7 +1374,7 @@ public function test_compare_refuses_the_different_operator(): void public function test_compare_refuses_an_operator_a_comparison_does_not_support(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Comparison was built with an unsupported operator'); + $this->expectExceptionMessageIsOrContains('Comparison was built with an unsupported operator'); new PhpBackend()->compare( ColumnMother::of(int_schema('a'), [1]), @@ -1400,7 +1410,7 @@ public function test_subtract_with_a_float_side_is_a_float_column(): void public function test_multiply_refuses_an_integer_overflow_at_its_row(): void { $this->expectException(EvaluationException::class); - $this->expectExceptionMessage('Multiply function integer overflow (row 1)'); + $this->expectExceptionMessageIsOrContains('Multiply function integer overflow (row 1)'); new PhpBackend()->multiply( ColumnMother::of(int_schema('a'), [2, PHP_INT_MAX]), @@ -1672,7 +1682,7 @@ public function test_partition_refuses_a_bucket_count_below_one_even_for_an_empt $rows = Rows::empty(schema(int_schema('k')), new PhpBackend()); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Buckets count must be greater than 0, given: 0'); + $this->expectExceptionMessageIsOrContains('Buckets count must be greater than 0, given: 0'); // @mago-ignore analysis:invalid-argument new PhpBackend()->partition($rows, [$rows->column('k')], 0, 0); @@ -1683,7 +1693,7 @@ public function test_partition_refuses_a_hash_offset_outside_zero_to_twenty_four $rows = Rows::empty(schema(int_schema('k')), new PhpBackend()); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Hash offset must be between 0 and 24, given: 25'); + $this->expectExceptionMessageIsOrContains('Hash offset must be between 0 and 24, given: 25'); // @mago-ignore analysis:invalid-argument new PhpBackend()->partition($rows, [$rows->column('k')], 4, 25); diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Physical/DatePhysicalTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Physical/DatePhysicalTest.php index 31dddb4556..ff4c2d1660 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Physical/DatePhysicalTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Physical/DatePhysicalTest.php @@ -39,7 +39,7 @@ public function test_reads_back_midnight_utc(): void public function test_refuses_a_day_outside_the_i32_range(): void { $this->expectException(CastingException::class); - $this->expectExceptionMessage('outside the day range of a date column'); + $this->expectExceptionMessageIsOrContains('outside the day range of a date column'); new DatePhysical()->toPhysical(new DateTimeImmutable('@' . ((2 ** 31) * 86_400))); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Physical/DateTimePhysicalTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Physical/DateTimePhysicalTest.php index 734a1cfc13..894eb2beae 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Physical/DateTimePhysicalTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Physical/DateTimePhysicalTest.php @@ -51,7 +51,7 @@ public function test_reads_back_in_the_zone(): void public function test_refuses_a_value_outside_the_microsecond_range(): void { $this->expectException(CastingException::class); - $this->expectExceptionMessage('outside the microsecond range of a datetime column'); + $this->expectExceptionMessageIsOrContains('outside the microsecond range of a datetime column'); new DateTimePhysical(new DateTimeZone('UTC'))->toPhysical(new DateTimeImmutable('@9223372036855')); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Physical/HtmlElementPhysicalTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Physical/HtmlElementPhysicalTest.php index bb9073d32e..bdd57ddc86 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Physical/HtmlElementPhysicalTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Physical/HtmlElementPhysicalTest.php @@ -70,7 +70,7 @@ public function test_a_detached_element_is_stored_as_its_markup(): void public function test_a_path_outside_the_document_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Floe failed to restore HTMLElement'); + $this->expectExceptionMessageIsOrContains('Floe failed to restore HTMLElement'); new HtmlElementPhysical()->fromPhysical("\x015\x000\x00"); } @@ -78,7 +78,7 @@ public function test_a_path_outside_the_document_is_refused(): void public function test_markup_without_an_element_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Floe failed to restore HTMLElement from "text"'); + $this->expectExceptionMessageIsOrContains('Floe failed to restore HTMLElement from "text"'); new HtmlElementPhysical()->fromPhysical('text'); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Physical/PhysicalForTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Physical/PhysicalForTest.php index eac2321e65..981b4d5a0a 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Physical/PhysicalForTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Physical/PhysicalForTest.php @@ -211,7 +211,7 @@ public function test_maps_the_type_to_its_physical(Type $type, string $class): v public function test_refuses(Type $type, string $message): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage($message); + $this->expectExceptionMessageIsOrContains($message); new PhysicalFor()->physical($type); } @@ -264,7 +264,7 @@ public function test_maps_the_type_to_its_layout(Type $type, string $class): voi public function test_a_container_has_no_scalar_layout(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('type list has no scalar layout'); + $this->expectExceptionMessageIsOrContains('type list has no scalar layout'); new PhysicalFor()->layout(type_list(type_integer())); } @@ -297,7 +297,7 @@ public function test_an_optional_container_keeps_its_optional_type(): void public function test_refuses_a_mixed_element(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('a mixed element has no column kind'); + $this->expectExceptionMessageIsOrContains('a mixed element has no column kind'); new PhysicalFor()->builder(type_list(type_mixed())); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Physical/TimePhysicalTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Physical/TimePhysicalTest.php index 65ddc4a107..15a329750b 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Physical/TimePhysicalTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Physical/TimePhysicalTest.php @@ -90,7 +90,9 @@ public function test_reads_back_each_unit_at_its_boundary(): void public function test_refuses_months(): void { $this->expectException(CastingException::class); - $this->expectExceptionMessage("Relative DateInterval (with months/years) can't be stored in a time column"); + $this->expectExceptionMessageIsOrContains( + "Relative DateInterval (with months/years) can't be stored in a time column", + ); new TimePhysical()->toPhysical(new DateInterval('P1Y')); } @@ -98,7 +100,7 @@ public function test_refuses_months(): void public function test_refuses_a_duration_outside_the_microsecond_range(): void { $this->expectException(CastingException::class); - $this->expectExceptionMessage('outside the microsecond range of a time column'); + $this->expectExceptionMessageIsOrContains('outside the microsecond range of a time column'); $interval = new DateInterval('PT0S'); $interval->s = 9_223_372_036_855; diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Physical/XmlDocumentPhysicalTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Physical/XmlDocumentPhysicalTest.php index 946127b9cb..32dc4aff7a 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Physical/XmlDocumentPhysicalTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Physical/XmlDocumentPhysicalTest.php @@ -45,7 +45,7 @@ public function test_a_declared_encoding_is_kept(): void public function test_malformed_markup_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Floe failed to restore DOMDocument from ""'); + $this->expectExceptionMessageIsOrContains('Floe failed to restore DOMDocument from ""'); new XmlDocumentPhysical()->fromPhysical(''); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Physical/XmlElementPhysicalTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Physical/XmlElementPhysicalTest.php index 362c35c565..ad029781d7 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Physical/XmlElementPhysicalTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/Physical/XmlElementPhysicalTest.php @@ -71,7 +71,7 @@ public function test_bare_markup_is_its_own_markup(): void public function test_a_path_outside_the_document_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Floe failed to restore DOMElement'); + $this->expectExceptionMessageIsOrContains('Floe failed to restore DOMElement'); new XmlElementPhysical()->fromPhysical("\x015\x000\x00"); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/RetypeTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/RetypeTest.php index 14153a1e72..de73d981a5 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/RetypeTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/RetypeTest.php @@ -99,7 +99,7 @@ public function test_accepts(Type $from, Type $to, int $nullCount): void public function test_refuses(Type $from, Type $to, int $nullCount, string $message): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage($message); + $this->expectExceptionMessageIsOrContains($message); new Retype()->assert($from, $to, $nullCount); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/TextValuesTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/TextValuesTest.php index 0e2c3e9e2d..f70f0d9ce4 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/TextValuesTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/TextValuesTest.php @@ -332,7 +332,7 @@ public function test_texts_use_the_configured_formats_at_every_depth(): void public function test_texts_refuse_a_float_that_is_not_finite_inside_a_nested_value(): void { $this->expectException(JsonException::class); - $this->expectExceptionMessage('Inf and NaN cannot be JSON encoded'); + $this->expectExceptionMessageIsOrContains('Inf and NaN cannot be JSON encoded'); new TextValues()->texts(type_list(type_float()), [[1.5, NAN]]); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/ValueColumnTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/ValueColumnTest.php index 07ae1d09ca..4357dea3ff 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/ValueColumnTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/ValueColumnTest.php @@ -18,7 +18,7 @@ final class ValueColumnTest extends TestCase public function test_concat_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'An untyped function result (mixed) cannot be concatenated; it exists only inside function evaluation', ); @@ -28,7 +28,7 @@ public function test_concat_is_refused(): void public function test_encode_is_refused(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'An untyped function result (mixed) cannot be encoded; it exists only inside function evaluation', ); @@ -63,7 +63,7 @@ public function test_slice_and_take(): void public function test_with_type_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'An untyped function result (mixed) cannot be retyped to integer; it exists only inside function evaluation', ); diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/ValueEqualityTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/ValueEqualityTest.php index da157f3320..a38e49371f 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/ValueEqualityTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Column/ValueEqualityTest.php @@ -67,7 +67,9 @@ public function test_cast_names_the_row_of_a_string_that_is_not_a_datetime(): vo $rows = array_to_rows([['a' => 'not a date']], schema(str_schema('a'))); $this->expectException(EvaluationException::class); - $this->expectExceptionMessage('Column "a" value \'not a date\' cannot be cast to datetime to compare'); + $this->expectExceptionMessageIsOrContains( + 'Column "a" value \'not a date\' cannot be cast to datetime to compare', + ); new ValueEquality()->cast($rows->column('a'), type_datetime(), 'a'); } @@ -160,7 +162,7 @@ public function test_in_is_unknown_for_a_null_needle_a_null_haystack_and_no_matc public function test_in_names_the_row_of_a_candidate_that_does_not_cast(): void { $this->expectException(EvaluationException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( "Column \"h\" value 'x' cannot be cast to integer to compare: \"x\" is not a number (row 1)", ); @@ -175,7 +177,7 @@ public function test_in_names_the_row_of_a_candidate_that_does_not_cast(): void public function test_in_names_the_row_of_a_needle_that_does_not_cast(): void { $this->expectException(EvaluationException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( "Column \"n\" value 'a' cannot be cast to integer to compare: \"a\" is not a number (row 1)", ); @@ -190,7 +192,7 @@ public function test_in_names_the_row_of_a_needle_that_does_not_cast(): void public function test_in_names_the_row_of_a_needle_that_does_not_cast_after_a_row_of_two_candidates(): void { $this->expectException(EvaluationException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( "Column \"n\" value 'a' cannot be cast to integer to compare: \"a\" is not a number (row 1)", ); diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Grouping/GroupTableTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Grouping/GroupTableTest.php index 38d30c6827..42c51bc43a 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Grouping/GroupTableTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Grouping/GroupTableTest.php @@ -272,7 +272,7 @@ public function test_a_column_the_batch_lacks_under_a_required_declaration_is_re { $table = $backend->groupTable(['k'], schema(int_schema('id'), str_schema('k'))); - $this->expectExceptionMessage('"k"'); + $this->expectExceptionMessageIsOrContains('"k"'); $table->assign(array_to_rows([['id' => 1]], schema(int_schema('id')))); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Grouping/KeyEncoderTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Grouping/KeyEncoderTest.php index 3c86cd803b..78db5a72ae 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Grouping/KeyEncoderTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Grouping/KeyEncoderTest.php @@ -167,7 +167,7 @@ public function test_a_column_the_batch_lacks_is_a_null_where_the_bound_schema_d public function test_a_column_the_batch_lacks_without_a_nullable_declaration_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Column "missing" does not exist.'); + $this->expectExceptionMessageIsOrContains('Column "missing" does not exist.'); new KeyEncoder(['k', 'missing'], declared: schema(int_schema('k'), int_schema('missing')))->of(array_to_rows([[ 'k' => 1, diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Memory/UnitTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Memory/UnitTest.php index f81d5f9e31..cea5c5e51d 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Memory/UnitTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Memory/UnitTest.php @@ -55,7 +55,7 @@ public function test_php_memory_limit_reads_as_php_enforces_it(): void public function test_rejecting_unreadable_memory_string(string $memoryString): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage("Can't extract memory limit in bytes from php ini value: "); + $this->expectExceptionMessageIsOrContains("Can't extract memory limit in bytes from php ini value: "); Unit::fromString($memoryString); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Rows/RecordBatchTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Rows/RecordBatchTest.php index 7daac82151..bf28268459 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Rows/RecordBatchTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Rows/RecordBatchTest.php @@ -158,7 +158,7 @@ public function test_under_an_inferred_schema_a_refused_record_past_the_sample_i $batch->add(['id' => 3], 3); $this->expectException(InferredSchemaException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Record at offset 4 of file:///orders.csv does not fit the schema inferred from a sample of 2 rows', ); @@ -173,7 +173,7 @@ public function test_under_an_inferred_schema_without_a_uri_the_refusal_is_left_ $batch->add(['id' => 3], 3); $this->expectException(SchemaMismatchException::class); - $this->expectExceptionMessage('column "id" (row 3)'); + $this->expectExceptionMessageIsOrContains('column "id" (row 3)'); $batch->add(['id' => 'x'], 4); } @@ -183,7 +183,7 @@ public function test_under_an_inferred_schema_a_keyed_record_refuses_a_key_the_s $batch = RecordBatch::inferred(schema(int_schema('a')), new PhpBackend(), 1, null, 1, schema(int_schema('a'))); $this->expectException(SchemaMismatchException::class); - $this->expectExceptionMessage('column "c" (row 0) is not declared by the schema'); + $this->expectExceptionMessageIsOrContains('column "c" (row 0) is not declared by the schema'); $batch->add(['a' => 1, 'c' => 2], 1); } @@ -217,7 +217,7 @@ public function test_under_an_inferred_schema_a_keyed_record_key_past_the_sample ); $this->expectException(InferredSchemaException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Record at offset 23, line 2, of file:///b.jsonl does not fit the schema inferred from a sample of 1000 rows: ' . 'column "c"', ); diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Rows/RowsBuilderTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Rows/RowsBuilderTest.php index 5a1940d86b..b6d1f63507 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Rows/RowsBuilderTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Rows/RowsBuilderTest.php @@ -305,7 +305,9 @@ public static function refused_rows(): Generator public function test_a_refused_value_wins_over_an_earlier_absence(): void { $this->expectException(SchemaMismatchException::class); - $this->expectExceptionMessage('column "b" (row 1): could not convert null to integer, column is not nullable'); + $this->expectExceptionMessageIsOrContains( + 'column "b" (row 1): could not convert null to integer, column is not nullable', + ); new RowsBuilder(schema(int_schema('a'), int_schema('b')), new PhpBackend())->appendRows([ ['a' => 1], @@ -316,7 +318,7 @@ public function test_a_refused_value_wins_over_an_earlier_absence(): void public function test_an_absence_names_the_first_row_that_lacks_the_column(): void { $this->expectException(SchemaMismatchException::class); - $this->expectExceptionMessage('column "b" (row 0) declared by the schema is missing from the row'); + $this->expectExceptionMessageIsOrContains('column "b" (row 0) declared by the schema is missing from the row'); new RowsBuilder(schema(int_schema('a'), int_schema('b')), new PhpBackend())->appendRows([ ['a' => 0], @@ -328,7 +330,7 @@ public function test_an_absence_names_the_first_row_that_lacks_the_column(): voi public function test_the_lowest_absence_across_columns_wins(): void { $this->expectException(SchemaMismatchException::class); - $this->expectExceptionMessage('column "d" (row 1) declared by the schema is missing from the row'); + $this->expectExceptionMessageIsOrContains('column "d" (row 1) declared by the schema is missing from the row'); new RowsBuilder(schema(int_schema('c'), int_schema('d')), new PhpBackend())->appendRows([[ 'c' => 0, @@ -339,7 +341,7 @@ public function test_the_lowest_absence_across_columns_wins(): void public function test_an_earlier_absence_stays_over_a_later_one_in_another_column(): void { $this->expectException(SchemaMismatchException::class); - $this->expectExceptionMessage('column "c" (row 1) declared by the schema is missing from the row'); + $this->expectExceptionMessageIsOrContains('column "c" (row 1) declared by the schema is missing from the row'); new RowsBuilder(schema(int_schema('c'), int_schema('d')), new PhpBackend())->appendRows([[ 'c' => 0, @@ -350,7 +352,7 @@ public function test_an_earlier_absence_stays_over_a_later_one_in_another_column public function test_an_absence_at_the_same_row_names_the_first_column(): void { $this->expectException(SchemaMismatchException::class); - $this->expectExceptionMessage('column "c" (row 0) declared by the schema is missing from the row'); + $this->expectExceptionMessageIsOrContains('column "c" (row 0) declared by the schema is missing from the row'); new RowsBuilder(schema(int_schema('a'), int_schema('c'), int_schema('d')), new PhpBackend())->appendRows([ ['a' => 0], @@ -361,7 +363,7 @@ public function test_an_absence_at_the_same_row_names_the_first_column(): void public function test_a_refusal_at_the_same_row_names_the_first_column(): void { $this->expectException(SchemaMismatchException::class); - $this->expectExceptionMessage('column "a" (row 0)'); + $this->expectExceptionMessageIsOrContains('column "a" (row 0)'); new RowsBuilder(schema(int_schema('a'), int_schema('b')), new PhpBackend())->appendRows([ ['a' => 'x', 'b' => 'y'], @@ -371,7 +373,7 @@ public function test_a_refusal_at_the_same_row_names_the_first_column(): void public function test_an_absence_is_placed_after_the_rows_already_appended(): void { $this->expectException(SchemaMismatchException::class); - $this->expectExceptionMessage('column "c" (row 2) declared by the schema is missing from the row'); + $this->expectExceptionMessageIsOrContains('column "c" (row 2) declared by the schema is missing from the row'); new RowsBuilder( schema(int_schema('a'), int_schema('b', nullable: true), int_schema('c')), @@ -396,7 +398,7 @@ public function test_an_int_keyed_record_fills_the_columns_named_by_position(): public function test_the_first_refused_value_in_row_order_across_columns(): void { $this->expectException(SchemaMismatchException::class); - $this->expectExceptionMessage('column "b" (row 1): could not convert \'x\' (string) to integer'); + $this->expectExceptionMessageIsOrContains('column "b" (row 1): could not convert \'x\' (string) to integer'); new RowsBuilder(schema(int_schema('a'), int_schema('b')), new PhpBackend())->appendRows([[ 'a' => 0, @@ -479,7 +481,7 @@ public function test_appending_viewed_rows_counts_each_row(): void public function test_a_refused_view_is_placed_at_its_output_row(): void { $this->expectException(SchemaMismatchException::class); - $this->expectExceptionMessage('column "id" (row 1): could not convert \'x\' (string) to integer'); + $this->expectExceptionMessageIsOrContains('column "id" (row 1): could not convert \'x\' (string) to integer'); new RowsBuilder(schema(int_schema('id')), new PhpBackend()) ->appendFrom(array_to_rows([['id' => 1]], schema(int_schema('id'))), 0) @@ -493,7 +495,7 @@ public function test_refuses_a_view_that_does_not_fit_the_target( string $message, ): void { $this->expectException(SchemaMismatchException::class); - $this->expectExceptionMessage($message); + $this->expectExceptionMessageIsOrContains($message); new RowsBuilder($target, new PhpBackend())->appendFrom($source, 0); } @@ -512,7 +514,7 @@ public function test_a_missing_nullable_column_is_padded_with_null(): void public function test_a_missing_not_null_column_is_refused_with_its_row(): void { $this->expectException(SchemaMismatchException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Rows do not match their schema: column "name" (row 1) declared by the schema is missing from the row', ); @@ -525,7 +527,7 @@ public function test_a_missing_not_null_column_is_refused_with_its_row(): void public function test_a_refused_value_in_the_first_row_reports_row_zero(): void { $this->expectException(SchemaMismatchException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Rows do not match their schema: column "i" (row 0): could not convert \'abc\' (string) to integer', ); @@ -535,7 +537,7 @@ public function test_a_refused_value_in_the_first_row_reports_row_zero(): void public function test_a_refused_value_is_reported_with_its_column_and_row(): void { $this->expectException(SchemaMismatchException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Rows do not match their schema: column "i" (row 1): could not convert \'n/a\' (string) to integer', ); @@ -552,7 +554,7 @@ public function test_a_refusal_in_a_later_append_reports_its_row_in_the_whole_ba $builder->appendRows([['i' => 1], ['i' => 2]]); $this->expectException(SchemaMismatchException::class); - $this->expectExceptionMessage('column "i" (row 3): could not convert \'x\' (string) to integer'); + $this->expectExceptionMessageIsOrContains('column "i" (row 3): could not convert \'x\' (string) to integer'); $builder->appendRows([['i' => 3], ['i' => 'x']]); } @@ -560,7 +562,7 @@ public function test_a_refusal_in_a_later_append_reports_its_row_in_the_whole_ba public function test_a_null_on_a_not_null_column_is_reported_as_a_value_that_does_not_match(): void { $this->expectException(SchemaMismatchException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Rows do not match their schema: column "i" (row 0): could not convert null to integer, column is not nullable', ); @@ -638,7 +640,7 @@ public function test_append_from_keeps_a_shared_column_beside_a_retyped_one(): v public function test_append_from_names_the_first_column_the_schema_does_not_declare(): void { $this->expectException(SchemaMismatchException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Rows do not match their schema: column "c" (row 0) is not declared by the schema', ); @@ -688,7 +690,7 @@ public function test_feeds_one_column(): void public function test_an_unknown_column_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('RowsBuilder has no column "nope"'); + $this->expectExceptionMessageIsOrContains('RowsBuilder has no column "nope"'); new RowsBuilder(schema(int_schema('id')), new PhpBackend())->column('nope'); } @@ -700,7 +702,7 @@ public function test_ragged_columns_are_refused_at_finish(): void $builder->column('b')->append(1); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Ragged columns: 2 rows in [a], 1 rows in [b]'); + $this->expectExceptionMessageIsOrContains('Ragged columns: 2 rows in [a], 1 rows in [b]'); $builder->finish(); } @@ -713,7 +715,7 @@ public function test_ragged_columns_are_refused_at_finish(): void public function test_append_rows_refuses(Schema $schema, array $rows, string $exception, string $message): void { $this->expectException($exception); - $this->expectExceptionMessage($message); + $this->expectExceptionMessageIsOrContains($message); new RowsBuilder($schema, new PhpBackend()) ->appendRows($rows) @@ -723,7 +725,7 @@ public function test_append_rows_refuses(Schema $schema, array $rows, string $ex public function test_append_rows_refuses_a_definition_outside_the_nineteen(): void { $this->expectException(ColumnMismatchException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Row does not match its schema: column "a": throwing cannot be a batch column, only the 19 Flow definitions have a column kind', ); @@ -738,7 +740,7 @@ public function test_append_rows_refuses_a_definition_outside_the_nineteen(): vo public function test_append_rows_refuses_a_structure_missing_a_required_element(): void { $this->expectException(SchemaMismatchException::class); - $this->expectExceptionMessage('Rows do not match their schema: column "data" (row 0)'); + $this->expectExceptionMessageIsOrContains('Rows do not match their schema: column "data" (row 0)'); new RowsBuilder( schema(structure_schema('data', type_structure(['id' => type_integer(), 'name' => type_string()]))), @@ -891,7 +893,7 @@ public function test_a_present_null_and_an_absent_key_are_both_null(): void public function test_a_refused_value_in_a_column_every_row_carries_is_placed_at_its_row(): void { $this->expectException(SchemaMismatchException::class); - $this->expectExceptionMessage('column "id" (row 3): could not convert \'x\' (string) to integer'); + $this->expectExceptionMessageIsOrContains('column "id" (row 3): could not convert \'x\' (string) to integer'); new RowsBuilder(schema(int_schema('id')), new PhpBackend())->appendRows([['id' => 1]])->appendRows([ ['id' => 2], @@ -937,7 +939,7 @@ public function test_append_records_matches_a_numeric_string_key_to_its_declared public function test_append_records_of_keyed_records_refuses_an_undeclared_key(): void { $this->expectException(SchemaMismatchException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Rows do not match their schema: column "bad" (row 0) is not declared by the schema', ); diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/RowsTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/RowsTest.php index f4a5363cf3..a0cf8091e8 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/RowsTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/RowsTest.php @@ -70,7 +70,7 @@ public static function negative_sizes(): Generator public function test_a_negative_size_is_refused(Closure $call): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Size must be greater than or equal to 0'); + $this->expectExceptionMessageIsOrContains('Size must be greater than or equal to 0'); $call(array_to_rows([['id' => 1]], schema(int_schema('id')))); } @@ -88,7 +88,7 @@ public function test_match_to_adopts_a_wider_schema_and_pads_the_new_nullable_co public function test_match_to_reports_the_violating_row_at_its_position_in_the_batch(): void { $this->expectException(SchemaMismatchException::class); - $this->expectExceptionMessage('column "id" (row 0): could not convert 1 (integer) to string'); + $this->expectExceptionMessageIsOrContains('column "id" (row 0): could not convert 1 (integer) to string'); array_to_rows([['id' => 1], ['id' => 2]], schema(int_schema('id')))->matchTo( schema(str_schema('id')), @@ -119,7 +119,9 @@ public function test_project_rejects_a_schema_that_widens_the_batch(): void { // project() drops, it never invents - the padded column would leave the batch off its schema $this->expectException(SchemaMismatchException::class); - $this->expectExceptionMessage('column "name" (row 0) declared by the schema is missing from the row'); + $this->expectExceptionMessageIsOrContains( + 'column "name" (row 0) declared by the schema is missing from the row', + ); array_to_rows([['id' => 1]], schema(int_schema('id')))->project( schema(int_schema('id'), str_schema('name')), @@ -130,7 +132,7 @@ public function test_project_rejects_a_schema_that_widens_the_batch(): void public function test_project_rejects_a_schema_that_retypes_a_column(): void { $this->expectException(SchemaMismatchException::class); - $this->expectExceptionMessage('column "id" (row 0): could not convert 1 (integer) to string'); + $this->expectExceptionMessageIsOrContains('column "id" (row 0): could not convert 1 (integer) to string'); array_to_rows([['id' => 1, 'name' => 'a']], schema(int_schema('id'), str_schema('name')))->project( schema(str_schema('id')), @@ -152,7 +154,9 @@ public function test_construct_reorders_row_storage_into_schema_order(): void public function test_construct_rejects_a_row_that_contradicts_the_schema(): void { $this->expectException(SchemaMismatchException::class); - $this->expectExceptionMessage('column "number" (row 0): could not convert \'x\' (string) to integer'); + $this->expectExceptionMessageIsOrContains( + 'column "number" (row 0): could not convert \'x\' (string) to integer', + ); array_to_rows([['number' => 'x']], schema(int_schema('number'))); } @@ -269,7 +273,7 @@ public function test_empty_rows(): void public function test_concat_throws_when_schemas_disagree(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Cannot concat Rows with different schemas: [{"ref":"id",'); + $this->expectExceptionMessageIsOrContains('Cannot concat Rows with different schemas: [{"ref":"id",'); Rows::concat( schema(int_schema('id')), @@ -327,7 +331,7 @@ public function test_remove_the_first_row(): void public function test_remove_refuses_the_offset_past_the_last_row(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Rows does not have 3 offset'); + $this->expectExceptionMessageIsOrContains('Rows does not have 3 offset'); array_to_rows([['id' => 1], ['id' => 2], ['id' => 3]], schema(int_schema('id')))->remove(3); } @@ -335,7 +339,7 @@ public function test_remove_refuses_the_offset_past_the_last_row(): void public function test_gather_names_the_index_outside_the_batch_after_index_zero(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Rows::gather() index 5 is outside a batch of 3 rows'); + $this->expectExceptionMessageIsOrContains('Rows::gather() index 5 is outside a batch of 3 rows'); array_to_rows([['id' => 1], ['id' => 2], ['id' => 3]], schema(int_schema('id')))->gather([0, 5]); } @@ -407,7 +411,7 @@ public function test_rows_schema(): void public function test_rows_reject_a_row_whose_list_contradicts_the_declared_element_type(): void { $this->expectException(SchemaMismatchException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Rows do not match their schema: column "list" (row 1): could not convert array (list) to list', ); @@ -543,7 +547,7 @@ public function test_values_of_a_row_are_keyed_in_schema_order(): void public function test_values_outside_the_batch_are_refused(int $index): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage("Row {$index} does not exist in a batch of 1 rows"); + $this->expectExceptionMessageIsOrContains("Row {$index} does not exist in a batch of 1 rows"); array_to_rows([['id' => 1]], schema(int_schema('id')))->values($index); } @@ -551,7 +555,7 @@ public function test_values_outside_the_batch_are_refused(int $index): void public function test_an_absent_column_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Column "missing" does not exist'); + $this->expectExceptionMessageIsOrContains('Column "missing" does not exist'); array_to_rows([['id' => 1]], schema(int_schema('id')))->column('missing'); } @@ -576,7 +580,7 @@ public function test_structure_field_order_is_a_schema_difference_not_a_value_di // the field-order difference lives in the Schema, which 04c made positional, so R6 // refuses the merge rather than emitting a batch whose declared order no row agrees with. $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Cannot concat Rows with different schemas'); + $this->expectExceptionMessageIsOrContains('Cannot concat Rows with different schemas'); Rows::concat($left->schema(), new PhpBackend(), $left, $right); } @@ -688,7 +692,7 @@ public static function match_to_refusals(): Generator public function test_match_to_refuses(Schema $schema, Rows $rows, string $message): void { $this->expectException(SchemaMismatchException::class); - $this->expectExceptionMessage($message); + $this->expectExceptionMessageIsOrContains($message); $rows->matchTo($schema, new AdaptiveBackend()); } @@ -696,7 +700,7 @@ public function test_match_to_refuses(Schema $schema, Rows $rows, string $messag public function test_from_rows_refuses_null_under_not_null_in_row_1(): void { $this->expectException(SchemaMismatchException::class); - $this->expectExceptionMessage('column "id" (row 1)'); + $this->expectExceptionMessageIsOrContains('column "id" (row 1)'); array_to_rows([['id' => 1], ['id' => null]], schema(int_schema('id'))); } @@ -743,7 +747,7 @@ public function test_of_checks_names_and_counts_only(): void public function test_of_refuses_other_column_names(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Rows::fromColumns() expects columns [id], got [other]'); + $this->expectExceptionMessageIsOrContains('Rows::fromColumns() expects columns [id], got [other]'); Rows::fromColumns( schema(int_schema('id')), @@ -755,7 +759,7 @@ public function test_of_refuses_other_column_names(): void public function test_of_refuses_a_column_of_another_count(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Column "id" holds 2 rows, the batch 1'); + $this->expectExceptionMessageIsOrContains('Column "id" holds 2 rows, the batch 1'); Rows::fromColumns(schema(int_schema('id')), ['id' => new PhpBackend()->constant(int_schema('id'), 1, 2)], 1); } @@ -763,7 +767,7 @@ public function test_of_refuses_a_column_of_another_count(): void public function test_of_refuses_a_null_in_a_not_null_column(): void { $this->expectException(SchemaMismatchException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Rows do not match their schema: column "id" (row 1): could not convert null to integer, column is not nullable', ); @@ -939,7 +943,7 @@ public function test_match_to_builds_a_new_column_in_the_given_backend(): void public function test_match_to_reports_the_first_null_under_not_null(): void { $this->expectException(SchemaMismatchException::class); - $this->expectExceptionMessage('(row 2)'); + $this->expectExceptionMessageIsOrContains('(row 2)'); array_to_rows([['id' => 1], ['id' => 2], ['id' => null]], schema(int_schema('id', nullable: true)))->matchTo( schema(int_schema('id')), @@ -965,7 +969,7 @@ public function test_match_to_restamps_a_provable_change_without_reading_values( public function test_match_to_refuses_an_unprovable_change_at_the_bad_row(): void { $this->expectException(SchemaMismatchException::class); - $this->expectExceptionMessage('column "id" (row 1)'); + $this->expectExceptionMessageIsOrContains('column "id" (row 1)'); array_to_rows([['id' => null], ['id' => 5]], schema(int_schema('id', nullable: true)))->matchTo( schema(str_schema('id', nullable: true)), @@ -976,7 +980,7 @@ public function test_match_to_refuses_an_unprovable_change_at_the_bad_row(): voi public function test_concat_refuses_a_zero_row_input_with_another_schema(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Cannot concat Rows with different schemas'); + $this->expectExceptionMessageIsOrContains('Cannot concat Rows with different schemas'); Rows::concat( schema(int_schema('id')), @@ -1033,7 +1037,7 @@ public function test_empty_of_an_empty_schema(): void public function test_from_columns_refuses_an_untyped_column(): void { $this->expectException(ColumnMismatchException::class); - $this->expectExceptionMessage('column "id": mixed cannot be a batch column'); + $this->expectExceptionMessageIsOrContains('column "id": mixed cannot be a batch column'); Rows::fromColumns(schema(int_schema('id')), ['id' => new ValueColumn([1])], 1); } @@ -1041,7 +1045,7 @@ public function test_from_columns_refuses_an_untyped_column(): void public function test_with_columns_refuses_an_untyped_column(): void { $this->expectException(ColumnMismatchException::class); - $this->expectExceptionMessage('column "n": mixed cannot be a batch column'); + $this->expectExceptionMessageIsOrContains('column "n": mixed cannot be a batch column'); array_to_rows([['id' => 1]], schema(int_schema('id')))->withColumns( schema(int_schema('id'), int_schema('n')), @@ -1052,7 +1056,7 @@ public function test_with_columns_refuses_an_untyped_column(): void public function test_with_columns_refuses_a_column_of_another_count(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Column "n" holds 1 rows, the batch 2'); + $this->expectExceptionMessageIsOrContains('Column "n" holds 1 rows, the batch 2'); array_to_rows([['id' => 1], ['id' => 2]], schema(int_schema('id')))->withColumns( schema(int_schema('id'), int_schema('n')), @@ -1073,7 +1077,7 @@ public function test_with_schema_renames_and_retypes_positionally(): void public function test_with_schema_refuses_another_definition_count(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Rows::withSchema() expects 1 definitions, got 2'); + $this->expectExceptionMessageIsOrContains('Rows::withSchema() expects 1 definitions, got 2'); array_to_rows([['id' => 1]], schema(int_schema('id')))->withSchema(schema(int_schema('a'), int_schema('b'))); } @@ -1095,7 +1099,7 @@ public function test_with_schema_refuses_a_null_under_not_null_at_its_row(): voi public function test_with_schema_refuses_another_column_kind(): void { $this->expectException(ColumnMismatchException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'column "id": cannot retype the column to string, integer and string are different column kinds', ); @@ -1119,7 +1123,7 @@ public static function slices_out_of_range(): Generator public function test_slice_refuses_out_of_range(Rows $rows, int $offset, int $length): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage(sprintf( + $this->expectExceptionMessageIsOrContains(sprintf( 'Rows::slice(%d, %d) is outside a batch of %d rows', $offset, $length, @@ -1145,7 +1149,7 @@ public static function gathers_out_of_range(): Generator public function test_gather_refuses_out_of_range(Rows $rows, int $index): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage(sprintf( + $this->expectExceptionMessageIsOrContains(sprintf( 'Rows::gather() index %d is outside a batch of %d rows', $index, $rows->count(), @@ -1209,7 +1213,7 @@ public function test_match_to_adopts_a_not_null_column_an_empty_batch_lacks(): v public function test_match_to_refuses_a_midnight_outside_utc_in_a_date_column(): void { $this->expectException(SchemaMismatchException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'column "at" (row 0): could not convert 2026-01-01T00:00:00.000000+01:00 (datetime) to date', ); diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/Definition/BooleanDefinitionTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/Definition/BooleanDefinitionTest.php index 6f15ce62f4..286f14d164 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/Definition/BooleanDefinitionTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/Definition/BooleanDefinitionTest.php @@ -177,7 +177,7 @@ public function test_merge_with_different_entry_name_throws_exception(): void $def = bool_schema('flag'); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Cannot merge different definitions, flag and other'); + $this->expectExceptionMessageIsOrContains('Cannot merge different definitions, flag and other'); $def->merge(bool_schema('other')); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/Definition/DateDefinitionTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/Definition/DateDefinitionTest.php index f194439670..d9fc119792 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/Definition/DateDefinitionTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/Definition/DateDefinitionTest.php @@ -216,7 +216,7 @@ public function test_merge_with_different_entry_name_throws_exception(): void $def = date_schema('created_at'); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Cannot merge different definitions, created_at and other'); + $this->expectExceptionMessageIsOrContains('Cannot merge different definitions, created_at and other'); $def->merge(date_schema('other')); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/Definition/DateTimeDefinitionTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/Definition/DateTimeDefinitionTest.php index d24d2efbf6..e95c37d628 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/Definition/DateTimeDefinitionTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/Definition/DateTimeDefinitionTest.php @@ -233,7 +233,7 @@ public function test_merge_with_different_entry_name_throws_exception(): void $def = datetime_schema('created_at'); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Cannot merge different definitions, created_at and other'); + $this->expectExceptionMessageIsOrContains('Cannot merge different definitions, created_at and other'); $def->merge(datetime_schema('other')); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/Definition/EnumDefinitionTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/Definition/EnumDefinitionTest.php index 6794b6dcdd..1c18bb847b 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/Definition/EnumDefinitionTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/Definition/EnumDefinitionTest.php @@ -242,7 +242,7 @@ public function test_merge_with_different_entry_name_throws_exception(): void $def = enum_schema('status', BackedStringEnum::class); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Cannot merge different definitions, status and other'); + $this->expectExceptionMessageIsOrContains('Cannot merge different definitions, status and other'); $def->merge(enum_schema('other', BackedStringEnum::class)); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/Definition/FloatDefinitionTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/Definition/FloatDefinitionTest.php index 3d9ee33600..913c382d04 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/Definition/FloatDefinitionTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/Definition/FloatDefinitionTest.php @@ -201,7 +201,7 @@ public function test_merge_with_different_entry_name_throws_exception(): void $def = float_schema('amount'); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Cannot merge different definitions, amount and other'); + $this->expectExceptionMessageIsOrContains('Cannot merge different definitions, amount and other'); $def->merge(float_schema('other')); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/Definition/HTMLDefinitionTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/Definition/HTMLDefinitionTest.php index 642ac43e8b..d0797cfdad 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/Definition/HTMLDefinitionTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/Definition/HTMLDefinitionTest.php @@ -180,7 +180,7 @@ public function test_merge_with_different_entry_name_throws_exception(): void $def = html_schema('content'); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Cannot merge different definitions, content and other'); + $this->expectExceptionMessageIsOrContains('Cannot merge different definitions, content and other'); $def->merge(html_schema('other')); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/Definition/HTMLElementDefinitionTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/Definition/HTMLElementDefinitionTest.php index c3a621e872..ec3409f2ac 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/Definition/HTMLElementDefinitionTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/Definition/HTMLElementDefinitionTest.php @@ -178,7 +178,7 @@ public function test_merge_with_different_entry_name_throws_exception(): void $def = html_element_schema('element'); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Cannot merge different definitions, element and other'); + $this->expectExceptionMessageIsOrContains('Cannot merge different definitions, element and other'); $def->merge(html_element_schema('other')); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/Definition/IntegerDefinitionTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/Definition/IntegerDefinitionTest.php index 84f81c7993..4bd742b336 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/Definition/IntegerDefinitionTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/Definition/IntegerDefinitionTest.php @@ -197,7 +197,7 @@ public function test_merge_with_different_entry_name_throws_exception(): void $def = int_schema('id'); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Cannot merge different definitions, id and other'); + $this->expectExceptionMessageIsOrContains('Cannot merge different definitions, id and other'); $def->merge(int_schema('other')); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/Definition/JsonDefinitionTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/Definition/JsonDefinitionTest.php index dfb0414609..4b0090a8c3 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/Definition/JsonDefinitionTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/Definition/JsonDefinitionTest.php @@ -100,7 +100,7 @@ public function test_does_not_match_entry_with_different_type(): void public function test_empty_array_type_is_refused_rather_than_typed_as_json(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Column "data" cannot be typed as array{}'); + $this->expectExceptionMessageIsOrContains('Column "data" cannot be typed as array{}'); definition_from_type('data', type_empty_array()); } @@ -188,7 +188,7 @@ public function test_merge_with_different_entry_name_throws_exception(): void $def = json_schema('data'); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Cannot merge different definitions, data and other'); + $this->expectExceptionMessageIsOrContains('Cannot merge different definitions, data and other'); $def->merge(json_schema('other')); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/Definition/ListDefinitionTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/Definition/ListDefinitionTest.php index 8fda81d3bb..787ec66d04 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/Definition/ListDefinitionTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/Definition/ListDefinitionTest.php @@ -267,7 +267,7 @@ public function test_merge_with_different_entry_name_throws_exception(): void $def = list_schema('items', type_list(type_integer())); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Cannot merge different definitions, items and other'); + $this->expectExceptionMessageIsOrContains('Cannot merge different definitions, items and other'); $def->merge(list_schema('other', type_list(type_integer()))); } @@ -351,7 +351,7 @@ public function test_a_null_or_t_element_is_the_optional_element(): void public function test_a_union_element_is_refused_naming_the_column(): void { $this->expectException(UnsupportedUnionTypeException::class); - $this->expectExceptionMessage('Column "tags" cannot hold elements of type "integer|string"'); + $this->expectExceptionMessageIsOrContains('Column "tags" cannot hold elements of type "integer|string"'); list_schema('tags', type_list(type_union(type_integer(), type_string()))); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/Definition/MapDefinitionTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/Definition/MapDefinitionTest.php index 72726ff23e..91ab023108 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/Definition/MapDefinitionTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/Definition/MapDefinitionTest.php @@ -282,7 +282,7 @@ public function test_merge_with_different_entry_name_throws_exception(): void $def = map_schema('data', type_map(type_string(), type_integer())); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Cannot merge different definitions, data and other'); + $this->expectExceptionMessageIsOrContains('Cannot merge different definitions, data and other'); $def->merge(map_schema('other', type_map(type_string(), type_integer()))); } @@ -364,7 +364,7 @@ public function test_merge_with_an_unrelated_type_falls_back_to_common_type(): v public function test_a_union_value_is_refused_naming_the_column(): void { $this->expectException(UnsupportedUnionTypeException::class); - $this->expectExceptionMessage('Column "tags" cannot hold elements of type "integer|string"'); + $this->expectExceptionMessageIsOrContains('Column "tags" cannot hold elements of type "integer|string"'); map_schema('tags', type_map(type_string(), type_union(type_integer(), type_string()))); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/Definition/NullDefinitionTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/Definition/NullDefinitionTest.php index 7eddbba28d..a9fd1a2edf 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/Definition/NullDefinitionTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/Definition/NullDefinitionTest.php @@ -175,7 +175,7 @@ public function test_typed_definition_merged_with_null_definition_becomes_nullab public function test_merge_with_a_different_name_throws(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Cannot merge different definitions, id and other'); + $this->expectExceptionMessageIsOrContains('Cannot merge different definitions, id and other'); null_schema('id')->merge(null_schema('other')); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/Definition/StringDefinitionTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/Definition/StringDefinitionTest.php index 80a96aabf6..64348114db 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/Definition/StringDefinitionTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/Definition/StringDefinitionTest.php @@ -196,7 +196,7 @@ public function test_merge_with_different_entry_name_throws_exception(): void $def = string_schema('name'); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Cannot merge different definitions, name and other'); + $this->expectExceptionMessageIsOrContains('Cannot merge different definitions, name and other'); $def->merge(string_schema('other')); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/Definition/StructureDefinitionTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/Definition/StructureDefinitionTest.php index 9cb0f8b86f..418baf2f31 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/Definition/StructureDefinitionTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/Definition/StructureDefinitionTest.php @@ -468,7 +468,7 @@ public function test_merge_with_different_entry_name_throws_exception(): void $def = structure_schema('data', type_structure(['name' => type_string()])); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Cannot merge different definitions, data and other'); + $this->expectExceptionMessageIsOrContains('Cannot merge different definitions, data and other'); $def->merge(structure_schema('other', type_structure(['name' => type_string()]))); } @@ -555,7 +555,7 @@ public function test_merge_with_an_unrelated_type_falls_back_to_common_type(): v public function test_a_union_element_is_refused_naming_the_column(): void { $this->expectException(UnsupportedUnionTypeException::class); - $this->expectExceptionMessage('Column "tags" cannot hold elements of type "integer|string"'); + $this->expectExceptionMessageIsOrContains('Column "tags" cannot hold elements of type "integer|string"'); structure_schema('tags', type_structure(['x' => type_union(type_integer(), type_string())])); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/Definition/TimeDefinitionTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/Definition/TimeDefinitionTest.php index e2ade20161..7ab630ccc6 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/Definition/TimeDefinitionTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/Definition/TimeDefinitionTest.php @@ -210,7 +210,7 @@ public function test_merge_with_different_entry_name_throws_exception(): void $def = time_schema('duration'); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Cannot merge different definitions, duration and other'); + $this->expectExceptionMessageIsOrContains('Cannot merge different definitions, duration and other'); $def->merge(time_schema('other')); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/Definition/TimeZoneDefinitionTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/Definition/TimeZoneDefinitionTest.php index 632f32111a..96fcd63d0d 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/Definition/TimeZoneDefinitionTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/Definition/TimeZoneDefinitionTest.php @@ -118,7 +118,7 @@ public function test_merge_with_an_unrelated_type_falls_back_to_common_type(): v public function test_merge_with_a_different_name_throws(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Cannot merge different definitions, tz and other'); + $this->expectExceptionMessageIsOrContains('Cannot merge different definitions, tz and other'); time_zone_schema('tz')->merge(time_zone_schema('other')); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/Definition/TypeProjectionTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/Definition/TypeProjectionTest.php index 53fc852dd6..447d419615 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/Definition/TypeProjectionTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/Definition/TypeProjectionTest.php @@ -293,7 +293,7 @@ public function test_an_optional_union_member_is_projected(): void public function test_a_multi_member_union_element_is_refused(): void { $this->expectException(UnsupportedUnionTypeException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Column "col" cannot hold elements of type "integer|string": a column holds exactly one type, and so ' . 'does every element inside it.' . "\n" @@ -312,7 +312,7 @@ public function test_a_multi_member_union_element_is_refused(): void public function test_a_union_nested_deeper_is_refused(): void { $this->expectException(UnsupportedUnionTypeException::class); - $this->expectExceptionMessage('Column "col" cannot hold elements of type "integer|string"'); + $this->expectExceptionMessageIsOrContains('Column "col" cannot hold elements of type "integer|string"'); new TypeProjection(ref('col')->name())->structure(type_structure([ 'x' => type_list(type_union(type_integer(), type_string())), diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/Definition/UuidDefinitionTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/Definition/UuidDefinitionTest.php index 449b57280e..796ed43025 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/Definition/UuidDefinitionTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/Definition/UuidDefinitionTest.php @@ -178,7 +178,7 @@ public function test_merge_with_different_entry_name_throws_exception(): void $def = uuid_schema('id'); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Cannot merge different definitions, id and other'); + $this->expectExceptionMessageIsOrContains('Cannot merge different definitions, id and other'); $def->merge(uuid_schema('other')); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/Definition/XMLDefinitionTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/Definition/XMLDefinitionTest.php index 7fe50f39af..1cdecb0897 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/Definition/XMLDefinitionTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/Definition/XMLDefinitionTest.php @@ -178,7 +178,7 @@ public function test_merge_with_different_entry_name_throws_exception(): void $def = xml_schema('document'); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Cannot merge different definitions, document and other'); + $this->expectExceptionMessageIsOrContains('Cannot merge different definitions, document and other'); $def->merge(xml_schema('other')); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/Definition/XMLElementDefinitionTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/Definition/XMLElementDefinitionTest.php index f349e703af..a937cbe6f3 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/Definition/XMLElementDefinitionTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/Definition/XMLElementDefinitionTest.php @@ -178,7 +178,7 @@ public function test_merge_with_different_entry_name_throws_exception(): void $def = xml_element_schema('element'); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Cannot merge different definitions, element and other'); + $this->expectExceptionMessageIsOrContains('Cannot merge different definitions, element and other'); $def->merge(xml_element_schema('other')); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/DefinitionTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/DefinitionTest.php index ce5a140e35..484bc220f4 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/DefinitionTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/DefinitionTest.php @@ -106,7 +106,7 @@ public function test_merging_date_with_datetime(): void public function test_merging_different_entries(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Cannot merge different definitions, int and string'); + $this->expectExceptionMessageIsOrContains('Cannot merge different definitions, int and string'); integer_schema('int')->merge(string_schema('string')); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/DefinitionsTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/DefinitionsTest.php index 5628d1c10a..e2c026679a 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/DefinitionsTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/DefinitionsTest.php @@ -15,7 +15,7 @@ final class DefinitionsTest extends FlowTestCase public function test_from_array_refuses_a_ref_that_is_not_a_string(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Definition array must have a string "ref" key'); + $this->expectExceptionMessageIsOrContains('Definition array must have a string "ref" key'); Definitions::fromArray(['ref' => 1, 'type' => type_integer()->normalize()]); } @@ -23,7 +23,7 @@ public function test_from_array_refuses_a_ref_that_is_not_a_string(): void public function test_from_array_refuses_a_nullable_that_is_not_a_bool(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Definition array must have a bool "nullable" key'); + $this->expectExceptionMessageIsOrContains('Definition array must have a bool "nullable" key'); Definitions::fromArray(['ref' => 'a', 'type' => type_integer()->normalize(), 'nullable' => 'yes']); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/MetadataTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/MetadataTest.php index e78c4c3213..8f0f07935e 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/MetadataTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Schema/MetadataTest.php @@ -80,7 +80,7 @@ public function test_get_as_default_value(): void public function test_get_non_existing_key(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('There no is key: test'); + $this->expectExceptionMessageIsOrContains('There no is key: test'); Metadata::empty()->get('test'); } @@ -117,7 +117,7 @@ public function test_remove_metadata_with_the_same_keys(): void public function test_use_object_in_metadata_array(): void { - $this->expectExceptionMessage('Metadata value must be a scalar or an array of scalars'); + $this->expectExceptionMessageIsOrContains('Metadata value must be a scalar or an array of scalars'); Metadata::empty()->add('object', [new DateTimeImmutable()]); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/SchemaTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/SchemaTest.php index 4dbf0b07d2..ce3334a1e6 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/SchemaTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/SchemaTest.php @@ -313,7 +313,7 @@ public function test_add_metadata(): void public function test_adding_duplicated_definitions(): void { $this->expectException(SchemaDefinitionNotUniqueException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Column definitions must be unique, duplicated columns: [str], all: [id, str, str]', ); schema(int_schema('id'), str_schema('str', true))->add(int_schema('str')); @@ -342,7 +342,7 @@ public function test_allowing_only_unique_definitions_case_insensitive(): void public function test_creating_schema_from_corrupted_json(): void { $this->expectException(JsonException::class); - $this->expectExceptionMessage('Syntax error'); + $this->expectExceptionMessageIsOrContains('Syntax error'); schema_from_json('{"ref": "id", "type": {"type": "integer", "nullable": false}, "metadata": []'); } @@ -350,7 +350,7 @@ public function test_creating_schema_from_corrupted_json(): void public function test_creating_schema_from_invalid_json_format(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Schema definition must be an array'); + $this->expectExceptionMessageIsOrContains('Schema definition must be an array'); schema_from_json('{"ref": "id", "type": {"type": "integer", "nullable": false}, "metadata": []}'); } @@ -358,7 +358,7 @@ public function test_creating_schema_from_invalid_json_format(): void public function test_creating_schema_from_invalid_json_format_at_definition_level(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Definition array must have an array "type" key'); + $this->expectExceptionMessageIsOrContains('Definition array must have an array "type" key'); schema_from_json('[{"ref": "id", "type": "test", "metadata": []}]'); } @@ -422,7 +422,7 @@ public function test_insert_at_duplicate_definition(): void public function test_insert_at_negative_index(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Cannot insert definitions at index -1, schema has 2 definitions'); + $this->expectExceptionMessageIsOrContains('Cannot insert definitions at index -1, schema has 2 definitions'); schema(int_schema('id'), str_schema('name'))->insertAt(-1, bool_schema('active')); } @@ -430,7 +430,7 @@ public function test_insert_at_negative_index(): void public function test_insert_at_out_of_range(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Cannot insert definitions at index 3, schema has 2 definitions'); + $this->expectExceptionMessageIsOrContains('Cannot insert definitions at index 3, schema has 2 definitions'); schema(int_schema('id'), str_schema('name'))->insertAt(3, bool_schema('active')); } @@ -606,7 +606,7 @@ public function test_move_preserves_definition_metadata(): void public function test_move_relative_to_itself(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Cannot move column "id" relative to itself'); + $this->expectExceptionMessageIsOrContains('Cannot move column "id" relative to itself'); schema(int_schema('id'), str_schema('name'))->moveBefore('id', 'id'); } @@ -641,7 +641,7 @@ public function test_move_to_non_existing(): void public function test_move_to_out_of_range(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Cannot move column "id" to index 2, schema has 2 definitions'); + $this->expectExceptionMessageIsOrContains('Cannot move column "id" to index 2, schema has 2 definitions'); schema(int_schema('id'), str_schema('name'))->moveTo('id', 2); } @@ -748,7 +748,7 @@ public function test_reorder(): void public function test_reorder_duplicate_name(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Cannot reorder column "id" more than once'); + $this->expectExceptionMessageIsOrContains('Cannot reorder column "id" more than once'); schema(int_schema('id'), str_schema('name'))->reorder('id', 'id'); } diff --git a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Sort/RowOrderTest.php b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Sort/RowOrderTest.php index 32fc1f00c7..973344a971 100644 --- a/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Sort/RowOrderTest.php +++ b/src/core/etl/tests/Flow/ETL/Tests/Unit/Values/Sort/RowOrderTest.php @@ -332,7 +332,7 @@ public function test_a_reference_moves_nulls_to_the_other_end(): void public function test_a_key_the_batch_lacks_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Column "c" does not exist'); + $this->expectExceptionMessageIsOrContains('Column "c" does not exist'); new RowOrder([ref('c')->asc()])->keys(array_to_rows([['a' => 1]], schema(int_schema('a')))); } diff --git a/src/lib/array-dot/tests/Flow/ArrayDot/Tests/Unit/ArrayDotGetTest.php b/src/lib/array-dot/tests/Flow/ArrayDot/Tests/Unit/ArrayDotGetTest.php index bc507ec64b..44717335d6 100644 --- a/src/lib/array-dot/tests/Flow/ArrayDot/Tests/Unit/ArrayDotGetTest.php +++ b/src/lib/array-dot/tests/Flow/ArrayDot/Tests/Unit/ArrayDotGetTest.php @@ -172,7 +172,7 @@ public function test_accessing_array_scalar_value_by_path_with_asterix(): void public function test_accessing_array_scalar_value_by_path_with_asterix_and_different_elements(): void { $this->expectException(InvalidPathException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( "Path \"user.name\" does not exists in array \"array('user'=>array('id'=>2,),)\"", ); @@ -264,7 +264,7 @@ public function test_accessing_array_scalar_value_by_path_with_nullable_asterix_ public function test_accessing_array_value_by_invalid_path(): void { $this->expectException(InvalidPathException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( "Path \"invalid_path\" does not exists in array \"array('user'=>array('id'=>1,),)\"", ); @@ -344,7 +344,7 @@ public function test_accessing_array_value_by_path_with_asterix(): void public function test_accessing_empty_array_value_by_invalid_path(): void { $this->expectException(InvalidPathException::class); - $this->expectExceptionMessage('Path "invalid_path" does not exists in array "array()"'); + $this->expectExceptionMessageIsOrContains('Path "invalid_path" does not exists in array "array()"'); static::assertSame(array_dot_get([], 'invalid_path'), 1); } @@ -565,7 +565,7 @@ public function test_escape_multi_key_syntax(): void public function test_get_nullsafe_wildcard_from_not_array(): void { $this->expectException(InvalidPathException::class); - $this->expectExceptionMessage('Expected array under path, "?*", but got: integer'); + $this->expectExceptionMessageIsOrContains('Expected array under path, "?*", but got: integer'); array_dot_get([ 'id' => 1, @@ -576,7 +576,7 @@ public function test_get_nullsafe_wildcard_from_not_array(): void public function test_get_wildcard_from_not_array(): void { $this->expectException(InvalidPathException::class); - $this->expectExceptionMessage('Expected array under path, "*", but got: integer'); + $this->expectExceptionMessageIsOrContains('Expected array under path, "*", but got: integer'); array_dot_get([ 'id' => 1, @@ -587,7 +587,7 @@ public function test_get_wildcard_from_not_array(): void public function test_get_traversing_past_scalar_leaf(): void { $this->expectException(InvalidPathException::class); - $this->expectExceptionMessage('Expected array under path, "user", but got: integer'); + $this->expectExceptionMessageIsOrContains('Expected array under path, "user", but got: integer'); array_dot_get(['user' => 1], 'user.name'); } @@ -595,7 +595,7 @@ public function test_get_traversing_past_scalar_leaf(): void public function test_get_traversing_past_scalar_leaf_with_nullsafe_next_step(): void { $this->expectException(InvalidPathException::class); - $this->expectExceptionMessage('Expected array under path, "user", but got: string'); + $this->expectExceptionMessageIsOrContains('Expected array under path, "user", but got: string'); array_dot_get(['user' => 'admin'], 'user.?role'); } @@ -603,7 +603,7 @@ public function test_get_traversing_past_scalar_leaf_with_nullsafe_next_step(): public function test_get_traversing_past_null_leaf(): void { $this->expectException(InvalidPathException::class); - $this->expectExceptionMessage('Expected array under path, "user", but got: NULL'); + $this->expectExceptionMessageIsOrContains('Expected array under path, "user", but got: NULL'); array_dot_get(['user' => null], 'user.name'); } @@ -667,7 +667,7 @@ public function test_escaped_dot_after_a_wildcard_reads_the_dotted_key(): void public function test_escaped_dot_after_a_wildcard_does_not_read_a_nested_key(): void { $this->expectException(InvalidPathException::class); - $this->expectExceptionMessage('Path "a\\.b" does not exists in array'); + $this->expectExceptionMessageIsOrContains('Path "a\\.b" does not exists in array'); array_dot_get(['x' => [['a' => ['b' => 9]]]], 'x.*.a\\.b'); } @@ -708,7 +708,7 @@ public function test_expected_array_message_keeps_the_nullsafe_marker( string $message, ): void { $this->expectException(InvalidPathException::class); - $this->expectExceptionMessage($message); + $this->expectExceptionMessageIsOrContains($message); array_dot_get($array, $path); } @@ -726,7 +726,7 @@ public function test_nullsafe_multimatch_under_a_wildcard_reads_nulls_for_an_emp public function test_multimatch_on_an_empty_array_names_the_missing_path(): void { $this->expectException(InvalidPathException::class); - $this->expectExceptionMessage('Path "a" does not exists in array "array()".'); + $this->expectExceptionMessageIsOrContains('Path "a" does not exists in array "array()".'); array_dot_get([], '{a}'); } diff --git a/src/lib/array-dot/tests/Flow/ArrayDot/Tests/Unit/ArrayDotRenameTest.php b/src/lib/array-dot/tests/Flow/ArrayDot/Tests/Unit/ArrayDotRenameTest.php index 7141d42f1a..09600dede5 100644 --- a/src/lib/array-dot/tests/Flow/ArrayDot/Tests/Unit/ArrayDotRenameTest.php +++ b/src/lib/array-dot/tests/Flow/ArrayDot/Tests/Unit/ArrayDotRenameTest.php @@ -190,7 +190,7 @@ public function test_rename_skips_elements_without_the_key_under_a_nullsafe_wild public function test_rename_refuses_a_path_not_ending_with_a_key(string $path): void { $this->expectException(InvalidPathException::class); - $this->expectExceptionMessage('does not end with a key'); + $this->expectExceptionMessageIsOrContains('does not end with a key'); array_dot_rename(['x' => ['a' => 1, 'b' => 2]], $path, 'c'); } @@ -203,7 +203,7 @@ public function test_rename_through_a_path_object(): void public function test_rename_of_a_missing_path_fails(): void { $this->expectException(InvalidPathException::class); - $this->expectExceptionMessage('Path "b" does not exists in array'); + $this->expectExceptionMessageIsOrContains('Path "b" does not exists in array'); array_dot_rename(['a' => 1], 'b', 'c'); } diff --git a/src/lib/array-dot/tests/Flow/ArrayDot/Tests/Unit/ArrayDotSetTest.php b/src/lib/array-dot/tests/Flow/ArrayDot/Tests/Unit/ArrayDotSetTest.php index 2d4e1ec563..f9ecdb92b9 100644 --- a/src/lib/array-dot/tests/Flow/ArrayDot/Tests/Unit/ArrayDotSetTest.php +++ b/src/lib/array-dot/tests/Flow/ArrayDot/Tests/Unit/ArrayDotSetTest.php @@ -131,7 +131,7 @@ public function test_set_trailing_wildcard_sets_every_element(): void public function test_set_refuses_a_multimatch(): void { $this->expectException(InvalidPathException::class); - $this->expectExceptionMessage('Path "x.{a,b}" ends with a multimatch'); + $this->expectExceptionMessageIsOrContains('Path "x.{a,b}" ends with a multimatch'); array_dot_set([], 'x.{a,b}', 1); } diff --git a/src/lib/array-dot/tests/Flow/ArrayDot/Tests/Unit/ArrayDotStepsTest.php b/src/lib/array-dot/tests/Flow/ArrayDot/Tests/Unit/ArrayDotStepsTest.php index 66f5cb7b7f..9a3bc21b0f 100644 --- a/src/lib/array-dot/tests/Flow/ArrayDot/Tests/Unit/ArrayDotStepsTest.php +++ b/src/lib/array-dot/tests/Flow/ArrayDot/Tests/Unit/ArrayDotStepsTest.php @@ -15,7 +15,7 @@ final class ArrayDotStepsTest extends TestCase public function test_empty_path(): void { $this->expectException(InvalidPathException::class); - $this->expectExceptionMessage("Path can't be empty"); + $this->expectExceptionMessageIsOrContains("Path can't be empty"); // @mago-ignore analysis:deprecated-function array_dot_steps(''); @@ -42,7 +42,7 @@ public function test_multimatch(): void public function test_multimatch_not_closed(): void { $this->expectException(InvalidPathException::class); - $this->expectExceptionMessage('Multimatch must be used at the end of path'); + $this->expectExceptionMessageIsOrContains('Multimatch must be used at the end of path'); // @mago-ignore analysis:deprecated-function static::assertSame(['foo', 'bar', '{bas, bai}'], array_dot_steps('foo.bar.{bas, bai.id')); @@ -51,7 +51,7 @@ public function test_multimatch_not_closed(): void public function test_multimatch_not_closed_at_the_end_of_path(): void { $this->expectException(InvalidPathException::class); - $this->expectExceptionMessage('Multimatch must be used at the end of path'); + $this->expectExceptionMessageIsOrContains('Multimatch must be used at the end of path'); // @mago-ignore analysis:deprecated-function static::assertSame(['foo', 'bar', '{bas, bai}'], array_dot_steps('foo.bar.{bas, bai}.id')); diff --git a/src/lib/array-dot/tests/Flow/ArrayDot/Tests/Unit/PathTest.php b/src/lib/array-dot/tests/Flow/ArrayDot/Tests/Unit/PathTest.php index 8340070a6d..ab9bbc40e9 100644 --- a/src/lib/array-dot/tests/Flow/ArrayDot/Tests/Unit/PathTest.php +++ b/src/lib/array-dot/tests/Flow/ArrayDot/Tests/Unit/PathTest.php @@ -110,7 +110,7 @@ public function test_selects_a_single_value_only_through_keys(string $path, bool public function test_rejects_an_invalid_string(string $path, string $message): void { $this->expectException(InvalidPathException::class); - $this->expectExceptionMessage($message); + $this->expectExceptionMessageIsOrContains($message); Path::fromString($path); } @@ -118,7 +118,7 @@ public function test_rejects_an_invalid_string(string $path, string $message): v public function test_rejects_no_steps(): void { $this->expectException(InvalidPathException::class); - $this->expectExceptionMessage("Path can't be empty."); + $this->expectExceptionMessageIsOrContains("Path can't be empty."); new Path([]); } @@ -131,7 +131,7 @@ public function test_reindexes_the_steps(): void public function test_rejects_a_multimatch_before_the_last_step(): void { $this->expectException(InvalidPathException::class); - $this->expectExceptionMessage('Multimatch must be used at the end of path'); + $this->expectExceptionMessageIsOrContains('Multimatch must be used at the end of path'); new Path([new Multimatch([new Path([new Key('a')])]), new Key('b')]); } diff --git a/src/lib/array-dot/tests/Flow/ArrayDot/Tests/Unit/Step/MultimatchTest.php b/src/lib/array-dot/tests/Flow/ArrayDot/Tests/Unit/Step/MultimatchTest.php index 46a77d7a19..f9f5976776 100644 --- a/src/lib/array-dot/tests/Flow/ArrayDot/Tests/Unit/Step/MultimatchTest.php +++ b/src/lib/array-dot/tests/Flow/ArrayDot/Tests/Unit/Step/MultimatchTest.php @@ -41,7 +41,7 @@ public function test_to_string_joins_its_paths(): void public function test_rejects_no_paths(): void { $this->expectException(InvalidPathException::class); - $this->expectExceptionMessage('Multimatch needs at least one path.'); + $this->expectExceptionMessageIsOrContains('Multimatch needs at least one path.'); new Multimatch([]); } @@ -49,7 +49,7 @@ public function test_rejects_no_paths(): void public function test_rejects_a_nested_multimatch(): void { $this->expectException(InvalidPathException::class); - $this->expectExceptionMessage('Multimatch cannot contain another multimatch.'); + $this->expectExceptionMessageIsOrContains('Multimatch cannot contain another multimatch.'); new Multimatch([new Path([new Key('a'), new Multimatch([new Path([new Key('b')])])])]); } diff --git a/src/lib/azure-sdk/tests/Flow/Azure/SDK/Tests/Unit/BlobService/ListBlobs/BlobTest.php b/src/lib/azure-sdk/tests/Flow/Azure/SDK/Tests/Unit/BlobService/ListBlobs/BlobTest.php index b034007025..84197f67ae 100644 --- a/src/lib/azure-sdk/tests/Flow/Azure/SDK/Tests/Unit/BlobService/ListBlobs/BlobTest.php +++ b/src/lib/azure-sdk/tests/Flow/Azure/SDK/Tests/Unit/BlobService/ListBlobs/BlobTest.php @@ -18,7 +18,7 @@ public function test_name_returns_blob_name_from_data(): void public function test_name_throws_when_blob_name_missing(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Blob name must be a string'); + $this->expectExceptionMessageIsOrContains('Blob name must be a string'); new Blob([])->name(); } @@ -26,7 +26,7 @@ public function test_name_throws_when_blob_name_missing(): void public function test_name_throws_when_blob_name_is_not_string(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Blob name must be a string'); + $this->expectExceptionMessageIsOrContains('Blob name must be a string'); new Blob(['Name' => 123])->name(); } @@ -44,7 +44,7 @@ public function test_size_returns_integer_from_int_content_length(): void public function test_size_throws_when_properties_missing(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Blob properties must be an array'); + $this->expectExceptionMessageIsOrContains('Blob properties must be an array'); new Blob([])->size(); } @@ -52,7 +52,7 @@ public function test_size_throws_when_properties_missing(): void public function test_size_throws_when_content_length_missing(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Content-Length must be a string or integer'); + $this->expectExceptionMessageIsOrContains('Content-Length must be a string or integer'); new Blob(['Properties' => []])->size(); } @@ -60,7 +60,7 @@ public function test_size_throws_when_content_length_missing(): void public function test_size_throws_when_content_length_wrong_type(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Content-Length must be a string or integer'); + $this->expectExceptionMessageIsOrContains('Content-Length must be a string or integer'); new Blob(['Properties' => ['Content-Length' => 1.5]])->size(); } diff --git a/src/lib/azure-sdk/tests/Flow/Azure/SDK/Tests/Unit/BlobServiceTest.php b/src/lib/azure-sdk/tests/Flow/Azure/SDK/Tests/Unit/BlobServiceTest.php index 35595da920..5fa0110193 100644 --- a/src/lib/azure-sdk/tests/Flow/Azure/SDK/Tests/Unit/BlobServiceTest.php +++ b/src/lib/azure-sdk/tests/Flow/Azure/SDK/Tests/Unit/BlobServiceTest.php @@ -40,7 +40,7 @@ public function test_delete_blobs_reads_parts_out_of_order(): void public function test_delete_blobs_refuses_more_than_256_blobs(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Blob Batch accepts at most 256 blobs, got 257'); + $this->expectExceptionMessageIsOrContains('Blob Batch accepts at most 256 blobs, got 257'); BlobServiceContext::service()->deleteBlobs(array_map( static fn(int $index): string => "{$index}.txt", diff --git a/src/lib/doctrine-dbal-bulk/tests/Flow/Doctrine/Bulk/Tests/Integration/MySqlBulkInsertTest.php b/src/lib/doctrine-dbal-bulk/tests/Flow/Doctrine/Bulk/Tests/Integration/MySqlBulkInsertTest.php index 348aed2e5e..e9678cab06 100644 --- a/src/lib/doctrine-dbal-bulk/tests/Flow/Doctrine/Bulk/Tests/Integration/MySqlBulkInsertTest.php +++ b/src/lib/doctrine-dbal-bulk/tests/Flow/Doctrine/Bulk/Tests/Integration/MySqlBulkInsertTest.php @@ -59,7 +59,7 @@ public function test_insert_with_a_schema_qualified_table_name_is_refused(): voi ])); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Table "flow.flow_bulk_orders" has the schema qualifier "flow", but this database platform does not support schemas.', ); diff --git a/src/lib/doctrine-dbal-bulk/tests/Flow/Doctrine/Bulk/Tests/Integration/PostgreSqlBulkInsertTest.php b/src/lib/doctrine-dbal-bulk/tests/Flow/Doctrine/Bulk/Tests/Integration/PostgreSqlBulkInsertTest.php index b96bba45f4..5273c3bd92 100644 --- a/src/lib/doctrine-dbal-bulk/tests/Flow/Doctrine/Bulk/Tests/Integration/PostgreSqlBulkInsertTest.php +++ b/src/lib/doctrine-dbal-bulk/tests/Flow/Doctrine/Bulk/Tests/Integration/PostgreSqlBulkInsertTest.php @@ -66,7 +66,7 @@ public function test_insert_into_a_table_created_with_an_unquoted_mixed_case_nam ])); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Table "FlowBulkMixedCase" not found, no table has the exact name "FlowBulkMixedCase".', ); diff --git a/src/lib/doctrine-dbal-bulk/tests/Flow/Doctrine/Bulk/Tests/Integration/PostgreSqlBulkUpdateTest.php b/src/lib/doctrine-dbal-bulk/tests/Flow/Doctrine/Bulk/Tests/Integration/PostgreSqlBulkUpdateTest.php index d7ead3dd5f..c6c04c2a1e 100644 --- a/src/lib/doctrine-dbal-bulk/tests/Flow/Doctrine/Bulk/Tests/Integration/PostgreSqlBulkUpdateTest.php +++ b/src/lib/doctrine-dbal-bulk/tests/Flow/Doctrine/Bulk/Tests/Integration/PostgreSqlBulkUpdateTest.php @@ -260,7 +260,7 @@ public function test_update_when_bulk_data_has_not_all_columns_from_primary_key_ ])); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('All columns from primary_key_columns must be in bulk data columns.'); + $this->expectExceptionMessageIsOrContains('All columns from primary_key_columns must be in bulk data columns.'); Bulk::create()->update( $this->databaseContext->connection(), @@ -362,7 +362,7 @@ public function test_update_with_empty_primary_key_columns(): void ])); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('primary_key_columns option is required for update'); + $this->expectExceptionMessageIsOrContains('primary_key_columns option is required for update'); Bulk::create()->update($this->databaseContext->connection(), $table, new BulkData([ ['id' => 2, 'name' => 'Changed name Two', 'description' => 'Changed description Two', 'active' => true], diff --git a/src/lib/doctrine-dbal-bulk/tests/Flow/Doctrine/Bulk/Tests/Integration/SqliteBulkInsertTest.php b/src/lib/doctrine-dbal-bulk/tests/Flow/Doctrine/Bulk/Tests/Integration/SqliteBulkInsertTest.php index 882622c3c4..dc3099432a 100644 --- a/src/lib/doctrine-dbal-bulk/tests/Flow/Doctrine/Bulk/Tests/Integration/SqliteBulkInsertTest.php +++ b/src/lib/doctrine-dbal-bulk/tests/Flow/Doctrine/Bulk/Tests/Integration/SqliteBulkInsertTest.php @@ -60,7 +60,7 @@ public function test_insert_with_a_schema_qualified_table_name_is_refused(): voi ])); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Table "main.flow_bulk_orders" has the schema qualifier "main", but this database platform does not support schemas.', ); diff --git a/src/lib/doctrine-dbal-bulk/tests/Flow/Doctrine/Bulk/Tests/Unit/BulkDataTest.php b/src/lib/doctrine-dbal-bulk/tests/Flow/Doctrine/Bulk/Tests/Unit/BulkDataTest.php index 73379874b7..d762629098 100644 --- a/src/lib/doctrine-dbal-bulk/tests/Flow/Doctrine/Bulk/Tests/Unit/BulkDataTest.php +++ b/src/lib/doctrine-dbal-bulk/tests/Flow/Doctrine/Bulk/Tests/Unit/BulkDataTest.php @@ -76,7 +76,7 @@ public function test_parameter_style_affects_all_sql_generation_methods(): void public function test_prevents_creating_bulk_data_for_different_rows(): void { - $this->expectExceptionMessage('Each row must be have the same keys in the same order'); + $this->expectExceptionMessageIsOrContains('Each row must be have the same keys in the same order'); new BulkData([ [ @@ -96,14 +96,14 @@ public function test_prevents_creating_bulk_data_for_different_rows(): void public function test_prevents_creating_bulk_data_from_invalid_rows(): void { - $this->expectExceptionMessage('Each row must be an array'); + $this->expectExceptionMessageIsOrContains('Each row must be an array'); new BulkData([1, 2, 3]); } public function test_prevents_creating_bulk_data_from_invalid_rows_when_first_row_is_an_array(): void { - $this->expectExceptionMessage('Each row must be an array'); + $this->expectExceptionMessageIsOrContains('Each row must be an array'); new BulkData([ [ @@ -118,21 +118,21 @@ public function test_prevents_creating_bulk_data_from_invalid_rows_when_first_ro public function test_prevents_creating_bulk_data_whose_rows_share_an_integer_key(): void { - $this->expectExceptionMessage('Each row must be an array'); + $this->expectExceptionMessageIsOrContains('Each row must be an array'); new BulkData([[0 => 'a', 'title' => 'One'], [0 => 'b', 'title' => 'Two']]); } public function test_an_invalid_row_is_reported_before_an_earlier_key_mismatch(): void { - $this->expectExceptionMessage('Each row must be an array'); + $this->expectExceptionMessageIsOrContains('Each row must be an array'); new BulkData([['title' => 'One'], ['date' => 'today'], [0 => 'three']]); } public function test_prevents_creating_empty_bulk_data(): void { - $this->expectExceptionMessage('Bulk data cannot be empty'); + $this->expectExceptionMessageIsOrContains('Bulk data cannot be empty'); new BulkData([]); } @@ -307,7 +307,7 @@ public function test_to_sql_casted_placeholders_throws_exception_for_invalid_col ]); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Column with name invalid_column, not found in table: test_table'); + $this->expectExceptionMessageIsOrContains('Column with name invalid_column, not found in table: test_table'); $bulkData->toSqlCastedPlaceholders($tableDefinition); } @@ -475,7 +475,7 @@ public function test_to_sql_named_casted_placeholders_throws_exception_for_inval ]); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Column with name unknown_field, not found in table: test_table'); + $this->expectExceptionMessageIsOrContains('Column with name unknown_field, not found in table: test_table'); $bulkData->toSqlNamedCastedPlaceholders($tableDefinition); } @@ -644,7 +644,7 @@ public function test_to_sql_positional_casted_placeholders_throws_exception_for_ ]); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Column with name missing_column, not found in table: test_table'); + $this->expectExceptionMessageIsOrContains('Column with name missing_column, not found in table: test_table'); $bulkData->toSqlPositionalCastedPlaceholders($tableDefinition); } diff --git a/src/lib/doctrine-dbal-bulk/tests/Flow/Doctrine/Bulk/Tests/Unit/ColumnsTest.php b/src/lib/doctrine-dbal-bulk/tests/Flow/Doctrine/Bulk/Tests/Unit/ColumnsTest.php index 89bdf4e260..c855eac6c6 100644 --- a/src/lib/doctrine-dbal-bulk/tests/Flow/Doctrine/Bulk/Tests/Unit/ColumnsTest.php +++ b/src/lib/doctrine-dbal-bulk/tests/Flow/Doctrine/Bulk/Tests/Unit/ColumnsTest.php @@ -18,14 +18,14 @@ public function test_adds_index_on_the_end_of_all_columns(): void public function test_prevents_creating_duplicated_columns(): void { - $this->expectExceptionMessage('All columns must be unique'); + $this->expectExceptionMessageIsOrContains('All columns must be unique'); new Columns('date', 'title', 'date'); } public function test_prevents_creating_empty_columns(): void { - $this->expectExceptionMessage('Columns cannot be empty'); + $this->expectExceptionMessageIsOrContains('Columns cannot be empty'); new Columns(); } diff --git a/src/lib/doctrine-dbal-bulk/tests/Flow/Doctrine/Bulk/Tests/Unit/DbalPlatformTest.php b/src/lib/doctrine-dbal-bulk/tests/Flow/Doctrine/Bulk/Tests/Unit/DbalPlatformTest.php index e96ed0956a..ba70c6b555 100644 --- a/src/lib/doctrine-dbal-bulk/tests/Flow/Doctrine/Bulk/Tests/Unit/DbalPlatformTest.php +++ b/src/lib/doctrine-dbal-bulk/tests/Flow/Doctrine/Bulk/Tests/Unit/DbalPlatformTest.php @@ -49,7 +49,7 @@ public function test_is_sqlite(): void public function test_no_supported_platform(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Database platform "Doctrine\DBAL\Platforms\OraclePlatform" is not yet supported', ); diff --git a/src/lib/doctrine-dbal-bulk/tests/Flow/Doctrine/Bulk/Tests/Unit/Dialect/MySQLDialectTest.php b/src/lib/doctrine-dbal-bulk/tests/Flow/Doctrine/Bulk/Tests/Unit/Dialect/MySQLDialectTest.php index 2eb3293e6c..265c09c832 100644 --- a/src/lib/doctrine-dbal-bulk/tests/Flow/Doctrine/Bulk/Tests/Unit/Dialect/MySQLDialectTest.php +++ b/src/lib/doctrine-dbal-bulk/tests/Flow/Doctrine/Bulk/Tests/Unit/Dialect/MySQLDialectTest.php @@ -172,7 +172,7 @@ public function test_quoted_table_name_is_the_exact_name(string $table, string $ public function test_schema_qualified_table_name_is_refused(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Table "flow.orders" has the schema qualifier "flow", but this database platform does not support schemas. Pass the table name without "flow.".', ); diff --git a/src/lib/doctrine-dbal-bulk/tests/Flow/Doctrine/Bulk/Tests/Unit/Dialect/SqliteDialectTest.php b/src/lib/doctrine-dbal-bulk/tests/Flow/Doctrine/Bulk/Tests/Unit/Dialect/SqliteDialectTest.php index 80e13ba988..d03b525481 100644 --- a/src/lib/doctrine-dbal-bulk/tests/Flow/Doctrine/Bulk/Tests/Unit/Dialect/SqliteDialectTest.php +++ b/src/lib/doctrine-dbal-bulk/tests/Flow/Doctrine/Bulk/Tests/Unit/Dialect/SqliteDialectTest.php @@ -164,7 +164,7 @@ public function test_quoted_table_name_is_the_exact_name(string $table, string $ public function test_schema_qualified_table_name_is_refused(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Table "main.orders" has the schema qualifier "main", but this database platform does not support schemas. Pass the table name without "main.".', ); diff --git a/src/lib/doctrine-dbal-bulk/tests/Flow/Doctrine/Bulk/Tests/Unit/TableDefinitionTest.php b/src/lib/doctrine-dbal-bulk/tests/Flow/Doctrine/Bulk/Tests/Unit/TableDefinitionTest.php index dc9e17ceab..a744e135e7 100644 --- a/src/lib/doctrine-dbal-bulk/tests/Flow/Doctrine/Bulk/Tests/Unit/TableDefinitionTest.php +++ b/src/lib/doctrine-dbal-bulk/tests/Flow/Doctrine/Bulk/Tests/Unit/TableDefinitionTest.php @@ -84,7 +84,7 @@ public function test_dbal_column_is_case_sensitive(): void $tableDefinition = new TableDefinition('test_table', $connection); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Column with name ID, not found in table: test_table'); + $this->expectExceptionMessageIsOrContains('Column with name ID, not found in table: test_table'); $tableDefinition->dbalColumn('ID'); } @@ -153,7 +153,7 @@ public function test_dbal_type_throws_doctrine_exception_for_unknown_type_name() $tableDefinition = new TableDefinition('test_table', $this->createConnectionWithTable('test_table')); $this->expectException(UnknownColumnType::class); - $this->expectExceptionMessage('Unknown column type "unknown_type" requested.'); + $this->expectExceptionMessageIsOrContains('Unknown column type "unknown_type" requested.'); $tableDefinition->dbalType('unknown_type'); } @@ -186,7 +186,7 @@ public function test_dbal_column_throws_exception_for_empty_column_name(): void $tableDefinition = new TableDefinition('test_table', $connection); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Column with name , not found in table: test_table'); + $this->expectExceptionMessageIsOrContains('Column with name , not found in table: test_table'); $tableDefinition->dbalColumn(''); } @@ -197,7 +197,9 @@ public function test_dbal_column_throws_exception_for_nonexistent_column(): void $tableDefinition = new TableDefinition('test_table', $connection); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Column with name nonexistent_column, not found in table: test_table'); + $this->expectExceptionMessageIsOrContains( + 'Column with name nonexistent_column, not found in table: test_table', + ); $tableDefinition->dbalColumn('nonexistent_column'); } @@ -255,7 +257,7 @@ public function test_dbal_types_throws_exception_for_invalid_column(): void ]); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Column with name invalid_column, not found in table: test_table'); + $this->expectExceptionMessageIsOrContains('Column with name invalid_column, not found in table: test_table'); $tableDefinition->dbalTypes($bulkData); } @@ -290,7 +292,7 @@ public function test_dbal_types_with_empty_bulk_data_throws_exception(): void new TableDefinition('test_table', $connection); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Bulk data cannot be empty'); + $this->expectExceptionMessageIsOrContains('Bulk data cannot be empty'); new BulkData([]); } @@ -399,7 +401,7 @@ public function test_to_sql_casted_placeholders_throws_exception_for_invalid_col ); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Column with name invalid_column, not found in table: test_table'); + $this->expectExceptionMessageIsOrContains('Column with name invalid_column, not found in table: test_table'); $bulkData->toSqlCastedPlaceholders($tableDefinition); } @@ -430,7 +432,7 @@ public function test_to_sql_casted_placeholders_with_empty_rows(): void $tableDefinition->platform(); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Bulk data cannot be empty'); + $this->expectExceptionMessageIsOrContains('Bulk data cannot be empty'); new BulkData([]); } diff --git a/src/lib/filesystem/tests/Flow/Filesystem/Tests/Integration/Local/MemoryFilesystemTest.php b/src/lib/filesystem/tests/Flow/Filesystem/Tests/Integration/Local/MemoryFilesystemTest.php index c39dffe6c9..88011c3926 100644 --- a/src/lib/filesystem/tests/Flow/Filesystem/Tests/Integration/Local/MemoryFilesystemTest.php +++ b/src/lib/filesystem/tests/Flow/Filesystem/Tests/Integration/Local/MemoryFilesystemTest.php @@ -25,7 +25,7 @@ final class MemoryFilesystemTest extends NativeLocalFilesystemTestCase public function test_append_to_rejects_mismatched_scheme(): void { $this->expectException(InvalidSchemeException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Scheme "file://" is not supported by this protocol. Expected scheme is "memory://"', ); @@ -389,7 +389,7 @@ public function test_tmp_dir(): void { $fs = memory_filesystem(); - $this->expectExceptionMessage('Memory does not have a system tmp directory'); + $this->expectExceptionMessageIsOrContains('Memory does not have a system tmp directory'); $fs->getSystemTmpDir(); } @@ -409,7 +409,7 @@ public function test_a_memory_filesystem_has_no_configuration(): void public function test_a_memory_filesystem_cannot_be_rebuilt_from_a_configuration(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'MemoryFilesystem holds in-process state and cannot be rebuilt from a configuration', ); diff --git a/src/lib/filesystem/tests/Flow/Filesystem/Tests/Integration/Local/StdOutFilesystemTest.php b/src/lib/filesystem/tests/Flow/Filesystem/Tests/Integration/Local/StdOutFilesystemTest.php index e41e9d554b..19b1f69a74 100644 --- a/src/lib/filesystem/tests/Flow/Filesystem/Tests/Integration/Local/StdOutFilesystemTest.php +++ b/src/lib/filesystem/tests/Flow/Filesystem/Tests/Integration/Local/StdOutFilesystemTest.php @@ -27,7 +27,7 @@ public function test_append_to_same_target_as_open_write_throws(): void $filesystem = new StdOutFilesystem(); $filesystem->writeTo(path('stdout://a', ['stream' => 'stderr'])); - $this->expectExceptionMessage('Only one stream can be open at the same time for php://stderr'); + $this->expectExceptionMessageIsOrContains('Only one stream can be open at the same time for php://stderr'); $filesystem->appendTo(path('stdout://b', ['stream' => 'stderr'])); } @@ -46,7 +46,7 @@ public function test_close_releases_target_slot(): void public function test_create(): void { - $this->expectExceptionMessage('Cannot create files exclusively in stdout'); + $this->expectExceptionMessageIsOrContains('Cannot create files exclusively in stdout'); new StdOutFilesystem()->create(path('stdout://a.stdout')); } @@ -55,7 +55,7 @@ public function test_get_system_tmp_dir(): void { $filesystem = new StdOutFilesystem(); - $this->expectExceptionMessage('StdOut does not have a system tmp directory'); + $this->expectExceptionMessageIsOrContains('StdOut does not have a system tmp directory'); $filesystem->getSystemTmpDir(); } @@ -110,7 +110,7 @@ public function test_it_cant_write_to_memory(): void { $filesystem = new StdOutFilesystem(); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Invalid output stream, allowed values are "stdout", "stderr" and "output", given: memory', ); @@ -137,7 +137,7 @@ public function test_mv(): void { $filesystem = new StdOutFilesystem(); - $this->expectExceptionMessage('Cannot move files around in stdout'); + $this->expectExceptionMessageIsOrContains('Cannot move files around in stdout'); $filesystem->mv(path('stdout://a.stdout'), path('stdout://b.stdout')); } @@ -146,7 +146,7 @@ public function test_read_from(): void { $filesystem = new StdOutFilesystem(); - $this->expectExceptionMessage('Cannot read from stdout'); + $this->expectExceptionMessageIsOrContains('Cannot read from stdout'); $filesystem->readFrom(path('stdout://x.stdout')); } @@ -155,7 +155,7 @@ public function test_rm(): void { $filesystem = new StdOutFilesystem(); - $this->expectExceptionMessage('Cannot remove files from stdout'); + $this->expectExceptionMessageIsOrContains('Cannot remove files from stdout'); $filesystem->rm(path('stdout://x.stdout')); } @@ -190,7 +190,7 @@ public function test_write_to_different_targets_concurrently_succeeds(): void public function test_write_to_rejects_mismatched_scheme(): void { $this->expectException(InvalidSchemeException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Scheme "file://" is not supported by this protocol. Expected scheme is "stdout://"', ); @@ -202,7 +202,7 @@ public function test_write_to_same_target_twice_throws(): void $filesystem = new StdOutFilesystem(); $filesystem->writeTo(path('stdout://a', ['stream' => 'output'])); - $this->expectExceptionMessage('Only one stream can be open at the same time for php://output'); + $this->expectExceptionMessageIsOrContains('Only one stream can be open at the same time for php://output'); $filesystem->writeTo(path('stdout://b', ['stream' => 'output'])); } @@ -215,7 +215,7 @@ public function test_a_stdout_filesystem_has_no_configuration(): void public function test_a_stdout_filesystem_cannot_be_rebuilt_from_a_configuration(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'StdOutFilesystem holds in-process state and cannot be rebuilt from a configuration', ); diff --git a/src/lib/filesystem/tests/Flow/Filesystem/Tests/Integration/NativeLocalFilesystemTest.php b/src/lib/filesystem/tests/Flow/Filesystem/Tests/Integration/NativeLocalFilesystemTest.php index 3fe15ebd66..10e0388d7e 100644 --- a/src/lib/filesystem/tests/Flow/Filesystem/Tests/Integration/NativeLocalFilesystemTest.php +++ b/src/lib/filesystem/tests/Flow/Filesystem/Tests/Integration/NativeLocalFilesystemTest.php @@ -63,7 +63,7 @@ public function test_reading_a_missing_file_creates_no_directory(): void public function test_append_to_rejects_mismatched_scheme(): void { $this->expectException(InvalidSchemeException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Scheme "memory://" is not supported by this protocol. Expected scheme is "file://"', ); @@ -857,7 +857,7 @@ public function test_write_to_tmp_dir_as_to_a_file(): void { $fs = native_local_filesystem(); - $this->expectExceptionMessage('Cannot write to system tmp directory'); + $this->expectExceptionMessageIsOrContains('Cannot write to system tmp directory'); $fs->writeTo($fs->getSystemTmpDir()); } @@ -934,7 +934,7 @@ public function test_a_configuration_with_invalid_permissions_is_refused(array $ public function test_a_configuration_without_a_protocol_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('NativeLocalFilesystem configuration must hold a "protocol" string'); + $this->expectExceptionMessageIsOrContains('NativeLocalFilesystem configuration must hold a "protocol" string'); NativeLocalFilesystem::fromArray([]); } diff --git a/src/lib/filesystem/tests/Flow/Filesystem/Tests/Integration/NativeLocalSourceStreamTest.php b/src/lib/filesystem/tests/Flow/Filesystem/Tests/Integration/NativeLocalSourceStreamTest.php index 7fc575d7e3..7a8f983417 100644 --- a/src/lib/filesystem/tests/Flow/Filesystem/Tests/Integration/NativeLocalSourceStreamTest.php +++ b/src/lib/filesystem/tests/Flow/Filesystem/Tests/Integration/NativeLocalSourceStreamTest.php @@ -64,7 +64,7 @@ public function test_closing_a_stream_while_its_lines_are_being_iterated(): void $stream->close(); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Cannot read from closed stream'); + $this->expectExceptionMessageIsOrContains('Cannot read from closed stream'); $lines->next(); } @@ -81,7 +81,7 @@ public function test_closing_a_stream_while_it_is_being_iterated(): void $stream->close(); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Cannot read from closed stream'); + $this->expectExceptionMessageIsOrContains('Cannot read from closed stream'); $chunks->next(); } @@ -162,7 +162,7 @@ public function test_read_lines_from_a_closed_stream_throws(): void $stream->close(); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Cannot read from closed stream'); + $this->expectExceptionMessageIsOrContains('Cannot read from closed stream'); $stream->readLines()->current(); } diff --git a/src/lib/filesystem/tests/Flow/Filesystem/Tests/Unit/FilesystemTableTest.php b/src/lib/filesystem/tests/Flow/Filesystem/Tests/Unit/FilesystemTableTest.php index cc3bbcf947..0a788fc540 100644 --- a/src/lib/filesystem/tests/Flow/Filesystem/Tests/Unit/FilesystemTableTest.php +++ b/src/lib/filesystem/tests/Flow/Filesystem/Tests/Unit/FilesystemTableTest.php @@ -25,7 +25,7 @@ public function test_duplicate_protocol_throws(): void $fstab = new FilesystemTable($first); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage("Mount 'warehouse' is already registered."); + $this->expectExceptionMessageIsOrContains("Mount 'warehouse' is already registered."); $fstab->mount($second); } @@ -43,7 +43,7 @@ public function test_for_throws_when_protocol_not_mounted(): void $fstab = new FilesystemTable(); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Filesystem with protocol missing is not mounted.'); + $this->expectExceptionMessageIsOrContains('Filesystem with protocol missing is not mounted.'); $fstab->for('missing'); } @@ -94,7 +94,7 @@ public function test_unmount_removes_the_mount(): void $fstab->unmount($fs); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Filesystem with protocol warehouse is not mounted.'); + $this->expectExceptionMessageIsOrContains('Filesystem with protocol warehouse is not mounted.'); $fstab->for('warehouse'); } @@ -104,7 +104,7 @@ public function test_unmount_throws_when_protocol_not_mounted(): void $fstab = new FilesystemTable(); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Filesystem with protocol missing is not mounted.'); + $this->expectExceptionMessageIsOrContains('Filesystem with protocol missing is not mounted.'); $fstab->unmount($this->filesystem('missing')); } diff --git a/src/lib/filesystem/tests/Flow/Filesystem/Tests/Unit/Local/PermissionsTest.php b/src/lib/filesystem/tests/Flow/Filesystem/Tests/Unit/Local/PermissionsTest.php index b4ca5e119f..d68136b02a 100644 --- a/src/lib/filesystem/tests/Flow/Filesystem/Tests/Unit/Local/PermissionsTest.php +++ b/src/lib/filesystem/tests/Flow/Filesystem/Tests/Unit/Local/PermissionsTest.php @@ -34,7 +34,7 @@ public function test_normalize_round_trips(): void public function test_from_array_refuses_an_invalid_shape(array $data): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Permissions must hold file (int) and directory (int)'); + $this->expectExceptionMessageIsOrContains('Permissions must hold file (int) and directory (int)'); Permissions::fromArray($data); } @@ -54,7 +54,7 @@ public function test_private_is_owner_only(): void public function test_rejects_modes_out_of_range(int $file, int $directory, string $message): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage($message); + $this->expectExceptionMessageIsOrContains($message); new Permissions($file, $directory); } diff --git a/src/lib/filesystem/tests/Flow/Filesystem/Tests/Unit/Operations/OperationOptionsTest.php b/src/lib/filesystem/tests/Flow/Filesystem/Tests/Unit/Operations/OperationOptionsTest.php index 10c03da945..682eebf4c2 100644 --- a/src/lib/filesystem/tests/Flow/Filesystem/Tests/Unit/Operations/OperationOptionsTest.php +++ b/src/lib/filesystem/tests/Flow/Filesystem/Tests/Unit/Operations/OperationOptionsTest.php @@ -30,7 +30,7 @@ public function test_dsl_returns_operation_options_instance(): void public function test_negative_chunk_size_throws(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Chunk size must be greater than zero, got -1.'); + $this->expectExceptionMessageIsOrContains('Chunk size must be greater than zero, got -1.'); operation_options(-1); } @@ -38,7 +38,7 @@ public function test_negative_chunk_size_throws(): void public function test_zero_chunk_size_throws(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Chunk size must be greater than zero, got 0.'); + $this->expectExceptionMessageIsOrContains('Chunk size must be greater than zero, got 0.'); operation_options(0); } diff --git a/src/lib/filesystem/tests/Flow/Filesystem/Tests/Unit/PartitionTest.php b/src/lib/filesystem/tests/Flow/Filesystem/Tests/Unit/PartitionTest.php index 514a385607..d00ae8c668 100644 --- a/src/lib/filesystem/tests/Flow/Filesystem/Tests/Unit/PartitionTest.php +++ b/src/lib/filesystem/tests/Flow/Filesystem/Tests/Unit/PartitionTest.php @@ -49,7 +49,7 @@ public static function unpartitionable_types(): Generator public function test_assert_partitionable_refuses_a_type_without_a_folder_name(Type $type, string $name): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Column "c" of type ' . $name . ' can\'t be used as a partition'); + $this->expectExceptionMessageIsOrContains('Column "c" of type ' . $name . ' can\'t be used as a partition'); Partition::assertPartitionable('c', $type); } @@ -183,14 +183,14 @@ public function test_creating_partition_value_from_float(float $value, string $e public function test_creating_partition_value_from_html(): void { - $this->expectExceptionMessage('Column "html" of type html can\'t be used as a partition'); + $this->expectExceptionMessageIsOrContains('Column "html" of type html can\'t be used as a partition'); Partition::fromValue('html', type_html(), ''); } public function test_creating_partition_value_from_xml(): void { - $this->expectExceptionMessage('Column "xml" of type xml can\'t be used as a partition'); + $this->expectExceptionMessageIsOrContains('Column "xml" of type xml can\'t be used as a partition'); Partition::fromValue('xml', type_xml(), ''); } @@ -242,7 +242,7 @@ public function test_a_segment_without_a_name_is_not_a_partition(): void public function test_an_empty_name_is_still_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage("Partition name can't be empty"); + $this->expectExceptionMessageIsOrContains("Partition name can't be empty"); new Partition('', 'value'); } diff --git a/src/lib/filesystem/tests/Flow/Filesystem/Tests/Unit/PartitionsTest.php b/src/lib/filesystem/tests/Flow/Filesystem/Tests/Unit/PartitionsTest.php index 703b5c3ce7..16d5831ac6 100644 --- a/src/lib/filesystem/tests/Flow/Filesystem/Tests/Unit/PartitionsTest.php +++ b/src/lib/filesystem/tests/Flow/Filesystem/Tests/Unit/PartitionsTest.php @@ -31,7 +31,7 @@ public function test_has_get_partitions(): void public function test_duplicate_partition_name_throws_naming_the_column(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Partition "country" is declared more than once'); + $this->expectExceptionMessageIsOrContains('Partition "country" is declared more than once'); new Partitions(new Partition('country', 'PL'), new Partition('country', 'US')); } diff --git a/src/lib/filesystem/tests/Flow/Filesystem/Tests/Unit/Path/UnixPathTest.php b/src/lib/filesystem/tests/Flow/Filesystem/Tests/Unit/Path/UnixPathTest.php index 90b6cd9550..b4b26839c0 100644 --- a/src/lib/filesystem/tests/Flow/Filesystem/Tests/Unit/Path/UnixPathTest.php +++ b/src/lib/filesystem/tests/Flow/Filesystem/Tests/Unit/Path/UnixPathTest.php @@ -103,7 +103,7 @@ public function test_add_partitions_with_placeholder_next_to_glob_pattern(): voi $path = new UnixPath('/output/*/{order-name}.csv'); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage("Can't add partitions to path pattern."); + $this->expectExceptionMessageIsOrContains("Can't add partitions to path pattern."); $path->addPartitions(partition('order-name', '123456-PL')); } @@ -120,7 +120,7 @@ public function test_add_partitions_with_unresolved_placeholder(): void $path = new UnixPath('/output/{order-name}.csv'); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( "Path partition placeholder {order-name} does not match any partition, available partitions: 'order-year'", ); @@ -465,7 +465,7 @@ public function test_pattern_methods_throw_exception(): void $patternPath = new UnixPath('/path/*/file.txt'); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage("Can't add partitions to path pattern."); + $this->expectExceptionMessageIsOrContains("Can't add partitions to path pattern."); $patternPath->addPartitions(partition('group', 'a')); } @@ -475,7 +475,7 @@ public function test_pattern_parent_directory_throws_exception(): void $patternPath = new UnixPath('/path/*/file.txt'); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage("Can't take directory from path pattern."); + $this->expectExceptionMessageIsOrContains("Can't take directory from path pattern."); $patternPath->parentDirectory(); } @@ -659,7 +659,7 @@ public function test_skip_directories_with_negative_count_throws_exception(): vo $path = new UnixPath('/path/to/file.txt'); $this->expectException(BaseInvalidArgumentException::class); - $this->expectExceptionMessage('The number of folders to skip must be non-negative.'); + $this->expectExceptionMessageIsOrContains('The number of folders to skip must be non-negative.'); $path->skipDirectories(-1); } diff --git a/src/lib/filesystem/tests/Flow/Filesystem/Tests/Unit/Path/WindowsPathTest.php b/src/lib/filesystem/tests/Flow/Filesystem/Tests/Unit/Path/WindowsPathTest.php index 3ca03dd748..001e4a0127 100644 --- a/src/lib/filesystem/tests/Flow/Filesystem/Tests/Unit/Path/WindowsPathTest.php +++ b/src/lib/filesystem/tests/Flow/Filesystem/Tests/Unit/Path/WindowsPathTest.php @@ -99,7 +99,7 @@ public function test_add_partitions_with_unresolved_placeholder(): void $path = new WindowsPath('C:/output/{order-name}.csv'); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( "Path partition placeholder {order-name} does not match any partition, available partitions: 'order-year'", ); @@ -459,7 +459,7 @@ public function test_pattern_methods_throw_exception(): void $patternPath = new WindowsPath('/path/*/file.txt'); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage("Can't add partitions to path pattern."); + $this->expectExceptionMessageIsOrContains("Can't add partitions to path pattern."); $patternPath->addPartitions(partition('group', 'a')); } @@ -469,7 +469,7 @@ public function test_pattern_parent_directory_throws_exception(): void $patternPath = new WindowsPath('/path/*/file.txt'); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage("Can't take directory from path pattern."); + $this->expectExceptionMessageIsOrContains("Can't take directory from path pattern."); $patternPath->parentDirectory(); } @@ -604,7 +604,7 @@ public function test_skip_directories_with_negative_count_throws_exception(): vo $path = new WindowsPath('/path/to/file.txt'); $this->expectException(BaseInvalidArgumentException::class); - $this->expectExceptionMessage('The number of folders to skip must be non-negative.'); + $this->expectExceptionMessageIsOrContains('The number of folders to skip must be non-negative.'); $path->skipDirectories(-1); } diff --git a/src/lib/filesystem/tests/Flow/Filesystem/Tests/Unit/PathTest.php b/src/lib/filesystem/tests/Flow/Filesystem/Tests/Unit/PathTest.php index f6a5fa1bb4..448510117d 100644 --- a/src/lib/filesystem/tests/Flow/Filesystem/Tests/Unit/PathTest.php +++ b/src/lib/filesystem/tests/Flow/Filesystem/Tests/Unit/PathTest.php @@ -110,7 +110,7 @@ protected function setUp(): void public function test_add_partitions_to_path_pattern(): void { - $this->expectExceptionMessage("Can't add partitions to path pattern."); + $this->expectExceptionMessageIsOrContains("Can't add partitions to path pattern."); path('/path/to/group=*/file.txt')->addPartitions(partition('group', 'a')); } @@ -420,7 +420,7 @@ public function test_a_key_value_uri_path_round_trips_with_no_explicit_partition public function test_from_array_refuses_an_option_naming_a_class_that_is_not_an_enum(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Path option "x" names a class that is not an enum'); + $this->expectExceptionMessageIsOrContains('Path option "x" names a class that is not an enum'); Path::fromArray([ 'uri' => 'file:///a.csv', @@ -432,7 +432,7 @@ public function test_from_array_refuses_an_option_naming_a_class_that_is_not_an_ public function test_from_array_refuses_a_missing_uri(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Path data must hold a "uri" string'); + $this->expectExceptionMessageIsOrContains('Path data must hold a "uri" string'); Path::fromArray(['options' => [], 'partitions' => []]); } @@ -440,7 +440,7 @@ public function test_from_array_refuses_a_missing_uri(): void public function test_from_array_refuses_a_malformed_partition(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Path partitions must be a list of {name: string, value: ?string}'); + $this->expectExceptionMessageIsOrContains('Path partitions must be a list of {name: string, value: ?string}'); Path::fromArray(['uri' => 'file:///a.csv', 'options' => [], 'partitions' => [['name' => 1]]]); } diff --git a/src/lib/filesystem/tests/Flow/Filesystem/Tests/Unit/Stream/BlockCachedSourceStreamTest.php b/src/lib/filesystem/tests/Flow/Filesystem/Tests/Unit/Stream/BlockCachedSourceStreamTest.php index 2c700345a3..e10b460eab 100644 --- a/src/lib/filesystem/tests/Flow/Filesystem/Tests/Unit/Stream/BlockCachedSourceStreamTest.php +++ b/src/lib/filesystem/tests/Flow/Filesystem/Tests/Unit/Stream/BlockCachedSourceStreamTest.php @@ -19,7 +19,7 @@ final class BlockCachedSourceStreamTest extends TestCase public function test_a_block_size_below_one_is_rejected(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Block size must be greater than 0, given: 0'); + $this->expectExceptionMessageIsOrContains('Block size must be greater than 0, given: 0'); new BlockCachedSourceStream(new StringSourceStream(path('memory://cache.bin'), 'abc'), 0); } diff --git a/src/lib/filesystem/tests/Flow/Filesystem/Tests/Unit/Stream/BlockTest.php b/src/lib/filesystem/tests/Flow/Filesystem/Tests/Unit/Stream/BlockTest.php index 5101043f66..4ce119fc48 100644 --- a/src/lib/filesystem/tests/Flow/Filesystem/Tests/Unit/Stream/BlockTest.php +++ b/src/lib/filesystem/tests/Flow/Filesystem/Tests/Unit/Stream/BlockTest.php @@ -32,7 +32,7 @@ public function test_append_throws_on_closed_handle(): void fclose($handle); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Failed to write to block'); + $this->expectExceptionMessageIsOrContains('Failed to write to block'); $block->append('more data'); } diff --git a/src/lib/filesystem/tests/Flow/Filesystem/Tests/Unit/Stream/BlocksTest.php b/src/lib/filesystem/tests/Flow/Filesystem/Tests/Unit/Stream/BlocksTest.php index 0e6ca8a7ec..91c43c6604 100644 --- a/src/lib/filesystem/tests/Flow/Filesystem/Tests/Unit/Stream/BlocksTest.php +++ b/src/lib/filesystem/tests/Flow/Filesystem/Tests/Unit/Stream/BlocksTest.php @@ -35,7 +35,7 @@ public static function nonPositiveBlockSizeProvider(): Generator public function test_constructor_rejects_non_positive_block_size(int $blockSize): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Block size must be greater than 0'); + $this->expectExceptionMessageIsOrContains('Block size must be greater than 0'); /** @mago-ignore analysis:possibly-invalid-argument */ new Blocks($blockSize); diff --git a/src/lib/filesystem/tests/Flow/Filesystem/Tests/Unit/Stream/RangeSourceStreamTest.php b/src/lib/filesystem/tests/Flow/Filesystem/Tests/Unit/Stream/RangeSourceStreamTest.php index 1ad458e3db..172fd3a2ad 100644 --- a/src/lib/filesystem/tests/Flow/Filesystem/Tests/Unit/Stream/RangeSourceStreamTest.php +++ b/src/lib/filesystem/tests/Flow/Filesystem/Tests/Unit/Stream/RangeSourceStreamTest.php @@ -21,7 +21,7 @@ final class RangeSourceStreamTest extends TestCase public function test_a_negative_start_is_rejected(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Range start must not be negative, given: -1'); + $this->expectExceptionMessageIsOrContains('Range start must not be negative, given: -1'); new RangeSourceStream(new StringSourceStream(path('memory://range.bin'), 'abc'), -1, 2); } @@ -29,7 +29,7 @@ public function test_a_negative_start_is_rejected(): void public function test_an_end_before_the_start_is_rejected(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Range end must not precede its start, given: 2..1'); + $this->expectExceptionMessageIsOrContains('Range end must not precede its start, given: 2..1'); new RangeSourceStream(new StringSourceStream(path('memory://range.bin'), 'abc'), 2, 1); } diff --git a/src/lib/filesystem/tests/Flow/Filesystem/Tests/Unit/Telemetry/TraceableDestinationStreamTest.php b/src/lib/filesystem/tests/Flow/Filesystem/Tests/Unit/Telemetry/TraceableDestinationStreamTest.php index 930b67f62c..94c7162a92 100644 --- a/src/lib/filesystem/tests/Flow/Filesystem/Tests/Unit/Telemetry/TraceableDestinationStreamTest.php +++ b/src/lib/filesystem/tests/Flow/Filesystem/Tests/Unit/Telemetry/TraceableDestinationStreamTest.php @@ -97,7 +97,7 @@ public function test_close_records_exception_and_rethrows(): void $stream->append('data'); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Close failed'); + $this->expectExceptionMessageIsOrContains('Close failed'); try { $stream->close(); diff --git a/src/lib/filesystem/tests/Flow/Filesystem/Tests/Unit/Telemetry/TraceableFilesystemTest.php b/src/lib/filesystem/tests/Flow/Filesystem/Tests/Unit/Telemetry/TraceableFilesystemTest.php index e03c7b2115..b53c52cadf 100644 --- a/src/lib/filesystem/tests/Flow/Filesystem/Tests/Unit/Telemetry/TraceableFilesystemTest.php +++ b/src/lib/filesystem/tests/Flow/Filesystem/Tests/Unit/Telemetry/TraceableFilesystemTest.php @@ -67,7 +67,7 @@ public function test_append_to_rethrows_exception(): void $fs = new TraceableFilesystem($mockFilesystem, $config); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Append failed'); + $this->expectExceptionMessageIsOrContains('Append failed'); $fs->appendTo($path); } @@ -189,7 +189,7 @@ public function test_read_from_rethrows_exception(): void $fs = new TraceableFilesystem($mockFilesystem, $config); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Read failed'); + $this->expectExceptionMessageIsOrContains('Read failed'); $fs->readFrom($path); } @@ -238,7 +238,7 @@ public function test_rm_passes_recursion_to_underlying_filesystem(): void ); $fs->writeTo(path('memory://dir/a.txt'))->append('a')->close(); - $this->expectExceptionMessage('Directory memory://dir was not removed: it is not empty'); + $this->expectExceptionMessageIsOrContains('Directory memory://dir was not removed: it is not empty'); $fs->rm(path('memory://dir'), false); } @@ -314,7 +314,7 @@ public function test_write_to_rethrows_exception(): void $fs = new TraceableFilesystem($mockFilesystem, $config); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Write failed'); + $this->expectExceptionMessageIsOrContains('Write failed'); $fs->writeTo($path); } @@ -352,7 +352,7 @@ public function test_configuration_is_the_inner_filesystems(): void public function test_a_traceable_filesystem_is_rebuilt_as_its_inner_filesystem(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('TraceableFilesystem is rebuilt as its inner filesystem'); + $this->expectExceptionMessageIsOrContains('TraceableFilesystem is rebuilt as its inner filesystem'); TraceableFilesystem::fromArray(['protocol' => 'file']); } diff --git a/src/lib/filesystem/tests/Flow/Filesystem/Tests/Unit/Telemetry/TraceableSourceStreamTest.php b/src/lib/filesystem/tests/Flow/Filesystem/Tests/Unit/Telemetry/TraceableSourceStreamTest.php index b19b35238d..c9ad02e89d 100644 --- a/src/lib/filesystem/tests/Flow/Filesystem/Tests/Unit/Telemetry/TraceableSourceStreamTest.php +++ b/src/lib/filesystem/tests/Flow/Filesystem/Tests/Unit/Telemetry/TraceableSourceStreamTest.php @@ -67,7 +67,7 @@ public function test_close_records_exception_and_rethrows(): void $stream->content(); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Close failed'); + $this->expectExceptionMessageIsOrContains('Close failed'); try { $stream->close(); @@ -246,7 +246,7 @@ public function test_read_tracks_bytes_read(): void $mockStream = $this->createMock(SourceStream::class); $mockStream->method('path')->willReturn($path); - $mockStream->method('read')->with(10, 0)->willReturn($content); + $mockStream->expects(self::once())->method('read')->with(10, 0)->willReturn($content); $stream = new TraceableSourceStream($mockStream, $config); $result = $stream->read(10, 0); diff --git a/src/lib/filesystem/tests/Flow/Filesystem/Tests/Unit/Testing/InterceptedFilesystemTest.php b/src/lib/filesystem/tests/Flow/Filesystem/Tests/Unit/Testing/InterceptedFilesystemTest.php index ea3134591f..639bd6f07b 100644 --- a/src/lib/filesystem/tests/Flow/Filesystem/Tests/Unit/Testing/InterceptedFilesystemTest.php +++ b/src/lib/filesystem/tests/Flow/Filesystem/Tests/Unit/Testing/InterceptedFilesystemTest.php @@ -73,7 +73,7 @@ public static function operations(): Generator public function test_cannot_be_rebuilt_from_array(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'InterceptedFilesystem holds a test hook and cannot be rebuilt from a configuration', ); diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Integration/Engine/RustLibParityTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Integration/Engine/RustLibParityTest.php index a19118cd4c..5c3c3c9784 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Integration/Engine/RustLibParityTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Integration/Engine/RustLibParityTest.php @@ -102,7 +102,7 @@ public function test_an_interval_column_is_refused_naming_it_and_the_php_reader( ); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Parquet column "iv" (Interval(DayTime)) is not supported by the arrow Parquet reader; read the file ' . 'with \Flow\Parquet\Reader::php()', ); @@ -152,7 +152,9 @@ public function test_a_map_key_a_php_array_cannot_hold_is_refused_by_both_engine } $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage("Map key of Parquet column \"{$column}\" must be int or string, got {$type}"); + $this->expectExceptionMessageIsOrContains( + "Map key of Parquet column \"{$column}\" must be int or string, got {$type}", + ); ParquetRows::read(new Reader(engine: new RustParquetEngine())->read($path), 10, [$column]); } diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Integration/Engine/RustLibRegressionTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Integration/Engine/RustLibRegressionTest.php index 336c92937d..e08cb2abda 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Integration/Engine/RustLibRegressionTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Integration/Engine/RustLibRegressionTest.php @@ -76,7 +76,7 @@ public function test_a_full_read_reads_the_file_about_once(): void public function test_invalid_utf8_is_refused_naming_column_and_row(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Parquet column "name" row 1 holds a string that is not valid UTF-8'); + $this->expectExceptionMessageIsOrContains('Parquet column "name" row 1 holds a string that is not valid UTF-8'); MemoryParquetFile::written( new Writer(engine: new RustParquetEngine()), diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Integration/Engine/RustLibWriteParityTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Integration/Engine/RustLibWriteParityTest.php index 8731148b26..08c3aeca2d 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Integration/Engine/RustLibWriteParityTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Integration/Engine/RustLibWriteParityTest.php @@ -118,7 +118,7 @@ public static function wrongly_written(): Generator public function test_the_php_engine_refuses_what_it_used_to_write_wrongly(string $target, string $input): void { $this->expectException(ValidationException::class); - $this->expectExceptionMessage('Column "c" row 0: '); + $this->expectExceptionMessageIsOrContains('Column "c" row 0: '); MemoryParquetFile::written(Writer::php(), Schema::with(WriteAcceptance::target($target)), [[ 'c' => WriteAcceptance::input($input), diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Integration/IO/PaginationTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Integration/IO/PaginationTest.php index 42960b49b1..6045481afd 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Integration/IO/PaginationTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Integration/IO/PaginationTest.php @@ -114,7 +114,7 @@ public function test_columns_refuses_a_batch_size_below_one(string $engineClass) { $engine = ParquetEngineMother::create($engineClass); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Batch size must be greater than 0'); + $this->expectExceptionMessageIsOrContains('Batch size must be greater than 0'); iterator_to_array( new Reader(engine: $engine) @@ -137,7 +137,7 @@ public function test_columns_refuses_an_unknown_column(string $engineClass): voi { $engine = ParquetEngineMother::create($engineClass); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Column "nope" does not exist'); + $this->expectExceptionMessageIsOrContains('Column "nope" does not exist'); iterator_to_array( new Reader(engine: $engine) diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Integration/IO/WriterTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Integration/IO/WriterTest.php index 280b5286d6..282743fed4 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Integration/IO/WriterTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Integration/IO/WriterTest.php @@ -94,7 +94,7 @@ public function test_a_close_that_throws_leaves_the_writer_closed(string $engine static::assertFalse($writer->isOpen()); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Writer is not open'); + $this->expectExceptionMessageIsOrContains('Writer is not open'); $writer->close(); } @@ -225,7 +225,7 @@ public function test_closing_not_open_writer(string $engineClass): void $writer = new Writer(engine: $engine); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Writer is not open'); + $this->expectExceptionMessageIsOrContains('Writer is not open'); $writer->close(); } @@ -295,7 +295,7 @@ public function test_opening_already_open_writer(string $engineClass): void $writer->open($path, $schema); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Writer is already open'); + $this->expectExceptionMessageIsOrContains('Writer is already open'); $writer->open($path, $schema); } @@ -413,7 +413,7 @@ public function test_writing_batch_to_not_open_stream(string $engineClass): void $writer = new Writer(engine: $engine); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Writer is not open'); + $this->expectExceptionMessageIsOrContains('Writer is not open'); $writer->writeBatch([StructWithLists::row()]); } @@ -890,7 +890,7 @@ public function test_writing_row_to_not_open_stream(string $engineClass): void $writer = new Writer(engine: $engine); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Writer is not open'); + $this->expectExceptionMessageIsOrContains('Writer is not open'); $writer->writeRow(StructWithLists::row()); } diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Integration/IO/WriterValidatorTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Integration/IO/WriterValidatorTest.php index 2d6755c152..0cf31f6afe 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Integration/IO/WriterValidatorTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Integration/IO/WriterValidatorTest.php @@ -20,7 +20,7 @@ class WriterValidatorTest extends ParquetIntegrationTestCase { public function test_writing_int_value_to_string_column(): void { - $this->expectExceptionMessage('Column "string" is not string, got "integer" instead'); + $this->expectExceptionMessageIsOrContains('Column "string" is not string, got "integer" instead'); $writer = Writer::php(); $path = TestParquetFile::path($this); @@ -32,7 +32,7 @@ public function test_writing_int_value_to_string_column(): void public function test_writing_null_to_list_that_is_required(): void { - $this->expectExceptionMessage('Column "list" is required'); + $this->expectExceptionMessageIsOrContains('Column "list" is required'); $writer = Writer::php(); $path = TestParquetFile::path($this); @@ -44,7 +44,7 @@ public function test_writing_null_to_list_that_is_required(): void public function test_writing_null_to_list_with_element_is_required(): void { - $this->expectExceptionMessage('Column "list.list.element" is required'); + $this->expectExceptionMessageIsOrContains('Column "list.list.element" is required'); $writer = Writer::php(); $path = TestParquetFile::path($this); @@ -56,7 +56,7 @@ public function test_writing_null_to_list_with_element_is_required(): void public function test_writing_null_to_map_with_value_required(): void { - $this->expectExceptionMessage('Column "map.key_value.value" is required'); + $this->expectExceptionMessageIsOrContains('Column "map.key_value.value" is required'); $writer = Writer::php(); $path = TestParquetFile::path($this); @@ -68,7 +68,7 @@ public function test_writing_null_to_map_with_value_required(): void public function test_writing_null_to_required_map(): void { - $this->expectExceptionMessage('Column "map" is required'); + $this->expectExceptionMessageIsOrContains('Column "map" is required'); $writer = Writer::php(); $path = TestParquetFile::path($this); @@ -80,7 +80,7 @@ public function test_writing_null_to_required_map(): void public function test_writing_null_value_to_required_column(): void { - $this->expectExceptionMessage('Column "string" is required'); + $this->expectExceptionMessageIsOrContains('Column "string" is required'); $writer = Writer::php(); $path = TestParquetFile::path($this); @@ -151,7 +151,7 @@ public function test_writing_row_with_missing_optional_columns_in_different_colu public function test_writing_row_without_required_column(): void { - $this->expectExceptionMessage('Column "string" is required'); + $this->expectExceptionMessageIsOrContains('Column "string" is required'); $writer = Writer::php(); $path = TestParquetFile::path($this); diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Integration/OptionsTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Integration/OptionsTest.php index 65f760f238..8894fb7500 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Integration/OptionsTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Integration/OptionsTest.php @@ -227,7 +227,7 @@ public function test_an_enum_option_is_read_as_its_enum_class(): void public function test_an_enum_option_of_another_class_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Option STATISTICS_LEVEL is not a Flow\\Parquet\\Writer\\StatisticsLevel, but: Flow\\Parquet\\ParquetFile\\Compressions', ); @@ -266,7 +266,7 @@ public function test_normalize_round_trips_enum_maps_and_bloom_filters(): void public function test_from_array_refuses_an_unknown_option(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Unknown parquet option: NOPE'); + $this->expectExceptionMessageIsOrContains('Unknown parquet option: NOPE'); Options::fromArray(['NOPE' => 1]); } @@ -274,7 +274,7 @@ public function test_from_array_refuses_an_unknown_option(): void public function test_from_array_refuses_a_value_naming_a_class_that_is_not_an_enum(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Option enum values must name an enum class and one of its cases'); + $this->expectExceptionMessageIsOrContains('Option enum values must name an enum class and one of its cases'); Options::fromArray(['STATISTICS_LEVEL' => ['enum' => Options::class, 'case' => 'PAGE']]); } @@ -282,7 +282,7 @@ public function test_from_array_refuses_a_value_naming_a_class_that_is_not_an_en public function test_from_array_refuses_a_bloom_filter_without_fpp(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('A bloom filter option must hold a numeric "fpp"'); + $this->expectExceptionMessageIsOrContains('A bloom filter option must hold a numeric "fpp"'); Options::fromArray(['COLUMNS_BLOOM_FILTERS' => ['a' => ['bloom_filter' => ['ndv' => 1]]]]); } diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Binary/ByteConverterTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Binary/ByteConverterTest.php index a6055c1cae..0a8978f53f 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Binary/ByteConverterTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Binary/ByteConverterTest.php @@ -108,7 +108,7 @@ public function test_decimal_roundtrip(float $value, int $byteLength, int $preci public function test_encode_decimal_throws_on_precision_overflow(): void { $this->expectException(OverflowException::class); - $this->expectExceptionMessage('exceeds maximum precision of 10 digits'); + $this->expectExceptionMessageIsOrContains('exceeds maximum precision of 10 digits'); encode_decimal(933162046.43, 10, 2, 5); } diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Binary/DecimalFunctionsTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Binary/DecimalFunctionsTest.php index a79ad65114..c31d7aa621 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Binary/DecimalFunctionsTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Binary/DecimalFunctionsTest.php @@ -58,7 +58,7 @@ public function test_encode_decimal_bytes(float $value, string $fixedLength, str public function test_encode_over_precision_throws(): void { $this->expectException(OverflowException::class); - $this->expectExceptionMessage('Decimal value 1234567890 exceeds maximum precision of 9 digits'); + $this->expectExceptionMessageIsOrContains('Decimal value 1234567890 exceeds maximum precision of 9 digits'); encode_decimal(12345678.9, 9, 2, 4); } @@ -78,7 +78,7 @@ public function test_encode_rounds_half_away_from_zero(float $value, string $exp public function test_unscaled_rejects_non_finite_values(float $value): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('is not a finite number'); + $this->expectExceptionMessageIsOrContains('is not a finite number'); decimal_unscaled($value, 9, 2); } diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/BloomFilter/BloomFilterOptionsTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/BloomFilter/BloomFilterOptionsTest.php index 7ed6048399..62de5b7221 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/BloomFilter/BloomFilterOptionsTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/BloomFilter/BloomFilterOptionsTest.php @@ -31,7 +31,7 @@ public function test_defaults_are_arrow_rs_defaults(): void public function test_a_false_positive_probability_outside_zero_and_one_is_refused(float $fpp): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('A bloom filter false positive probability must be between 0 and 1'); + $this->expectExceptionMessageIsOrContains('A bloom filter false positive probability must be between 0 and 1'); new BloomFilterOptions($fpp); } @@ -39,7 +39,7 @@ public function test_a_false_positive_probability_outside_zero_and_one_is_refuse public function test_an_ndv_below_one_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('A bloom filter ndv must be at least 1, got 0'); + $this->expectExceptionMessageIsOrContains('A bloom filter ndv must be at least 1, got 0'); new BloomFilterOptions(ndv: 0); } @@ -58,7 +58,7 @@ public function test_the_columns_option_is_read_by_flat_path_and_empty_when_unse public function test_a_columns_option_value_that_is_not_bloom_filter_options_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Option COLUMNS_BLOOM_FILTERS takes BloomFilterOptions, got string for column "id"', ); diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/BloomFilter/BloomFilterReaderTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/BloomFilter/BloomFilterReaderTest.php index f7488dd500..c4cfbbc1dd 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/BloomFilter/BloomFilterReaderTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/BloomFilter/BloomFilterReaderTest.php @@ -67,7 +67,7 @@ public function test_a_header_declaring_no_bitset_is_refused(): void $bytes = BloomFilterBytes::of('', 0); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('The bloom filter at offset 4 declares 0 bytes'); + $this->expectExceptionMessageIsOrContains('The bloom filter at offset 4 declares 0 bytes'); new BloomFilterReader(new MemorySourceStream('PAR1' . $bytes))->read(ColumnChunkMother::withBloomFilter( FlatColumn::int64('id'), @@ -119,7 +119,7 @@ public function test_a_bitset_shorter_than_its_header_declares_is_refused(): voi $bytes = BloomFilterBytes::of(str_repeat("\0", 32), 64); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('The bloom filter at offset 4 declares 64 bytes, 32 were read'); + $this->expectExceptionMessageIsOrContains('The bloom filter at offset 4 declares 64 bytes, 32 were read'); new BloomFilterReader(new MemorySourceStream('PAR1' . $bytes))->read(ColumnChunkMother::withBloomFilter( FlatColumn::int64('id'), diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/BloomFilter/SbbfTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/BloomFilter/SbbfTest.php index c64e652f15..7297d4f3dd 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/BloomFilter/SbbfTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/BloomFilter/SbbfTest.php @@ -98,7 +98,7 @@ public function test_a_hash_with_the_top_bit_set_lands_in_the_block_and_bits_of_ public function test_a_bitset_of_no_whole_blocks_is_refused(int $length): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'A bloom filter bitset holds whole blocks of 32 bytes, got ' . $length . ' bytes', ); diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Data/DeltaBinaryPackedDecoderTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Data/DeltaBinaryPackedDecoderTest.php index acd9c2a6b6..8524ecab7d 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Data/DeltaBinaryPackedDecoderTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Data/DeltaBinaryPackedDecoderTest.php @@ -17,7 +17,7 @@ final class DeltaBinaryPackedDecoderTest extends TestCase public function test_constructor_validates_block_miniblock_relationship(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Block size must be a multiple of miniblock size'); + $this->expectExceptionMessageIsOrContains('Block size must be a multiple of miniblock size'); new DeltaBinaryPackedDecoder(128, 96); } @@ -25,7 +25,7 @@ public function test_constructor_validates_block_miniblock_relationship(): void public function test_constructor_validates_block_size(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Block size must be a multiple of 128'); + $this->expectExceptionMessageIsOrContains('Block size must be a multiple of 128'); new DeltaBinaryPackedDecoder(100); } @@ -33,7 +33,7 @@ public function test_constructor_validates_block_size(): void public function test_constructor_validates_miniblock_size(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Miniblock size must be a multiple of 32'); + $this->expectExceptionMessageIsOrContains('Miniblock size must be a multiple of 32'); new DeltaBinaryPackedDecoder(128, 30); } @@ -62,7 +62,7 @@ public function test_decode_empty_data_with_non_zero_count_throws_error(): void $decoder = new DeltaBinaryPackedDecoder(); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Cannot decode empty data when value count is greater than 0'); + $this->expectExceptionMessageIsOrContains('Cannot decode empty data when value count is greater than 0'); $decoder->decode(new BinaryBufferReader(''), 5); } @@ -225,7 +225,7 @@ public function test_decode_value_count_mismatch_throws_error(): void $encoded = $encoder->encode($values); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Value count mismatch: expected 10, got 5'); + $this->expectExceptionMessageIsOrContains('Value count mismatch: expected 10, got 5'); $decoder->decode(new BinaryBufferReader($encoded), 10); } diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Data/DeltaBinaryPackedEncoderTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Data/DeltaBinaryPackedEncoderTest.php index 074cf045ee..cfd8a6d209 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Data/DeltaBinaryPackedEncoderTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Data/DeltaBinaryPackedEncoderTest.php @@ -13,7 +13,7 @@ final class DeltaBinaryPackedEncoderTest extends TestCase public function test_constructor_validates_block_miniblock_relationship(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Block size must be a multiple of miniblock size'); + $this->expectExceptionMessageIsOrContains('Block size must be a multiple of miniblock size'); new DeltaBinaryPackedEncoder(128, 96); } @@ -21,7 +21,7 @@ public function test_constructor_validates_block_miniblock_relationship(): void public function test_constructor_validates_block_size(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Block size must be a multiple of 128'); + $this->expectExceptionMessageIsOrContains('Block size must be a multiple of 128'); new DeltaBinaryPackedEncoder(100); } @@ -29,7 +29,7 @@ public function test_constructor_validates_block_size(): void public function test_constructor_validates_miniblock_size(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Miniblock size must be a multiple of 32'); + $this->expectExceptionMessageIsOrContains('Miniblock size must be a multiple of 32'); new DeltaBinaryPackedEncoder(128, 30); } diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Data/DeltaByteArrayDecoderTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Data/DeltaByteArrayDecoderTest.php index 849160d75e..393b3f4310 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Data/DeltaByteArrayDecoderTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Data/DeltaByteArrayDecoderTest.php @@ -52,7 +52,7 @@ public function test_decode_throws_on_a_prefix_longer_than_the_previous_value(): $encoder = new DeltaBinaryPackedEncoder(); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Invalid DELTA_BYTE_ARRAY prefix length 5 of value 1, the previous value has 2 bytes', ); @@ -67,7 +67,7 @@ public function test_decode_throws_on_a_negative_prefix_length(): void $encoder = new DeltaBinaryPackedEncoder(); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Invalid DELTA_BYTE_ARRAY prefix length -1 of value 0, the previous value has 0 bytes', ); diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Data/DeltaLengthByteArrayDecoderTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Data/DeltaLengthByteArrayDecoderTest.php index c9199c27f6..77985e8432 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Data/DeltaLengthByteArrayDecoderTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Data/DeltaLengthByteArrayDecoderTest.php @@ -27,7 +27,7 @@ public function test_decode_spec_example_leaves_the_bytes_after_the_stream(): vo public function test_decode_throws_on_a_negative_length(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Invalid DELTA_LENGTH_BYTE_ARRAY length -1 of value 0'); + $this->expectExceptionMessageIsOrContains('Invalid DELTA_LENGTH_BYTE_ARRAY length -1 of value 0'); new DeltaLengthByteArrayDecoder()->decode( new BinaryBufferReader(new DeltaBinaryPackedEncoder()->encode([-1]) . 'x'), @@ -38,7 +38,7 @@ public function test_decode_throws_on_a_negative_length(): void public function test_decode_throws_when_the_data_ends_early(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('DELTA_LENGTH_BYTE_ARRAY data ends before value 0'); + $this->expectExceptionMessageIsOrContains('DELTA_LENGTH_BYTE_ARRAY data ends before value 0'); new DeltaLengthByteArrayDecoder()->decode( new BinaryBufferReader(new DeltaBinaryPackedEncoder()->encode([5]) . 'abc'), diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Data/PhysicalCodecTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Data/PhysicalCodecTest.php index 83469344f1..db11b41d3f 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Data/PhysicalCodecTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Data/PhysicalCodecTest.php @@ -63,7 +63,7 @@ public function test_a_statistic_of_the_wrong_width_decodes_to_null(): void public function test_encoding_a_value_of_the_wrong_type_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Column "i": string is not a INT64 physical value'); + $this->expectExceptionMessageIsOrContains('Column "i": string is not a INT64 physical value'); new PhysicalCodec()->encodeStatistic(FlatColumn::int64('i'), '1'); } diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Data/PhysicalOrderTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Data/PhysicalOrderTest.php index ff5d7015f3..d05762a4c8 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Data/PhysicalOrderTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Data/PhysicalOrderTest.php @@ -163,7 +163,7 @@ public function test_compare( public function test_unordered_columns_have_no_order(FlatColumn $column): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('INT96 and INTERVAL have no physical order'); + $this->expectExceptionMessageIsOrContains('INT96 and INTERVAL have no physical order'); PhysicalOrder::forColumn($column)->compare("\x00", "\x01"); } @@ -198,7 +198,7 @@ public function test_signed_zeros(): void public function test_a_non_floating_point_order_has_no_signed_zero(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Signed has no signed zero'); + $this->expectExceptionMessageIsOrContains('Signed has no signed zero'); PhysicalOrder::Signed->zero(negative: true); } diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Dremel/ColumnData/DefinitionConverterTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Dremel/ColumnData/DefinitionConverterTest.php index e779ec6d18..484d14165f 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Dremel/ColumnData/DefinitionConverterTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Dremel/ColumnData/DefinitionConverterTest.php @@ -23,7 +23,7 @@ public function test_optional(int $level, mixed $value, mixed $result, ?string $ static::assertSame(1, $repetitions->maxDefinitionLevel()); if ($exceptionMessage) { - $this->expectExceptionMessage($exceptionMessage); + $this->expectExceptionMessageIsOrContains($exceptionMessage); new DefinitionConverter()->toValue($repetitions, definitionLevel: $level, value: $value); } else { static::assertEquals($result, new DefinitionConverter()->toValue( @@ -50,7 +50,7 @@ public function test_optional_optional( static::assertSame(2, $repetitions->maxDefinitionLevel()); if ($exceptionMessage) { - $this->expectExceptionMessage($exceptionMessage); + $this->expectExceptionMessageIsOrContains($exceptionMessage); new DefinitionConverter()->toValue($repetitions, definitionLevel: $level, value: $value); } else { static::assertEquals($result, new DefinitionConverter()->toValue( @@ -76,7 +76,7 @@ public function test_optional_repeated_optional( static::assertSame(3, $repetitions->maxDefinitionLevel()); if ($exceptionMessage) { - $this->expectExceptionMessage($exceptionMessage); + $this->expectExceptionMessageIsOrContains($exceptionMessage); new DefinitionConverter()->toValue($repetitions, definitionLevel: $level, value: $value); } else { static::assertEquals($result, new DefinitionConverter()->toValue( @@ -110,7 +110,7 @@ public function test_optional_repeated_optional_repeated_optional( static::assertSame(5, $repetitions->maxDefinitionLevel()); if ($exceptionMessage) { - $this->expectExceptionMessage($exceptionMessage); + $this->expectExceptionMessageIsOrContains($exceptionMessage); new DefinitionConverter()->toValue($repetitions, definitionLevel: $level, value: $value); } else { static::assertEquals($result, new DefinitionConverter()->toValue( @@ -148,7 +148,7 @@ public function test_optional_repeated_optional_repeated_optional_repeated_optio static::assertSame(7, $repetitions->maxDefinitionLevel()); if ($exceptionMessage) { - $this->expectExceptionMessage($exceptionMessage); + $this->expectExceptionMessageIsOrContains($exceptionMessage); new DefinitionConverter()->toValue($repetitions, definitionLevel: $level, value: $value); } else { static::assertEquals($result, new DefinitionConverter()->toValue( @@ -174,7 +174,7 @@ public function test_optional_repeated_required( static::assertSame(2, $repetitions->maxDefinitionLevel()); if ($exceptionMessage) { - $this->expectExceptionMessage($exceptionMessage); + $this->expectExceptionMessageIsOrContains($exceptionMessage); new DefinitionConverter()->toValue($repetitions, definitionLevel: $level, value: $value); } else { static::assertEquals($result, new DefinitionConverter()->toValue( @@ -199,7 +199,7 @@ public function test_optional_required( static::assertSame(1, $repetitions->maxDefinitionLevel()); if ($exceptionMessage) { - $this->expectExceptionMessage($exceptionMessage); + $this->expectExceptionMessageIsOrContains($exceptionMessage); new DefinitionConverter()->toValue($repetitions, definitionLevel: $level, value: $value); } else { static::assertEquals($result, new DefinitionConverter()->toValue( @@ -220,7 +220,7 @@ public function test_required(int $level, mixed $value, mixed $result, ?string $ static::assertSame(0, $repetitions->maxDefinitionLevel()); if ($exceptionMessage) { - $this->expectExceptionMessage($exceptionMessage); + $this->expectExceptionMessageIsOrContains($exceptionMessage); new DefinitionConverter()->toValue($repetitions, definitionLevel: $level, value: $value); } else { static::assertEquals($result, new DefinitionConverter()->toValue( @@ -244,7 +244,7 @@ public function test_required_optional( static::assertSame(1, $repetitions->maxDefinitionLevel()); if ($exceptionMessage) { - $this->expectExceptionMessage($exceptionMessage); + $this->expectExceptionMessageIsOrContains($exceptionMessage); new DefinitionConverter()->toValue($repetitions, definitionLevel: $level, value: $value); } else { static::assertEquals($result, new DefinitionConverter()->toValue( @@ -275,7 +275,7 @@ public function test_required_repeated_required_repeated_required( static::assertSame(2, $repetitions->maxDefinitionLevel()); if ($exceptionMessage) { - $this->expectExceptionMessage($exceptionMessage); + $this->expectExceptionMessageIsOrContains($exceptionMessage); new DefinitionConverter()->toValue($repetitions, definitionLevel: $level, value: $value); } else { static::assertEquals($result, new DefinitionConverter()->toValue( @@ -299,7 +299,7 @@ public function test_required_required( static::assertSame(0, $repetitions->maxDefinitionLevel()); if ($exceptionMessage) { - $this->expectExceptionMessage($exceptionMessage); + $this->expectExceptionMessageIsOrContains($exceptionMessage); new DefinitionConverter()->toValue($repetitions, definitionLevel: $level, value: $value); } else { static::assertEquals($result, new DefinitionConverter()->toValue( diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Dremel/ColumnData/ReadFlatColumnValuesTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Dremel/ColumnData/ReadFlatColumnValuesTest.php index f98d63cc15..fea921c140 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Dremel/ColumnData/ReadFlatColumnValuesTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Dremel/ColumnData/ReadFlatColumnValuesTest.php @@ -81,7 +81,7 @@ public function test_a_selection_keeps_the_levels_and_values_of_its_rows_only(): public function test_a_selection_over_another_row_count_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('A selection of 2 rows cannot select from a page of 3 rows'); + $this->expectExceptionMessageIsOrContains('A selection of 2 rows cannot select from a page of 3 rows'); new ReadFlatColumnValues( FlatColumn::int32('int32'), diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Dremel/ColumnData/StackTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Dremel/ColumnData/StackTest.php index b91c681ce5..d345f19711 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Dremel/ColumnData/StackTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Dremel/ColumnData/StackTest.php @@ -40,7 +40,7 @@ public function test_pushing_value_on_a_level_higher_than_max_level(): void { $stack = new Stack(0); - $this->expectExceptionMessage('Given level "1" is greater than max level, "0"'); + $this->expectExceptionMessageIsOrContains('Given level "1" is greater than max level, "0"'); $stack->push(1, 1); } diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Dremel/DremelFlatTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Dremel/DremelFlatTest.php index b3d508967f..5807d0078b 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Dremel/DremelFlatTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Dremel/DremelFlatTest.php @@ -117,7 +117,7 @@ public function test_required_int32(array $row, array $flatData, ?string $except static::assertEquals(0, $schema->get('int32')->repetitions()->maxRepetitionLevel()); if ($exceptionMessage) { - $this->expectExceptionMessage($exceptionMessage); + $this->expectExceptionMessageIsOrContains($exceptionMessage); $shredder->shred($schema, [$row], 0); } else { $shredResult = $shredder->shred($schema, [$row], 0); diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Dremel/DremelListsTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Dremel/DremelListsTest.php index ead94bede0..8cccf05e46 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Dremel/DremelListsTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Dremel/DremelListsTest.php @@ -924,7 +924,7 @@ public function test_optional_list_optional_map_string_optional_int32( static::assertEquals(2, $schema->get('l.list.element.key_value.value')->repetitions()->maxRepetitionLevel()); if ($exceptionMessage) { - $this->expectExceptionMessage($exceptionMessage); + $this->expectExceptionMessageIsOrContains($exceptionMessage); $shredder->shred($schema, $rows, 0); } else { @@ -1839,7 +1839,7 @@ public function test_required_list_required_map_string_required_int32( static::assertEquals(2, $schema->get('l.list.element.key_value.value')->repetitions()->maxRepetitionLevel()); if ($exceptionMessage) { - $this->expectExceptionMessage($exceptionMessage); + $this->expectExceptionMessageIsOrContains($exceptionMessage); $shredder->shred($schema, $rows, 0); } else { @@ -1977,7 +1977,7 @@ public function test_required_list_required_struct_required_int32_required_strin static::assertEquals(1, $schema->get('l.list.element.string')->repetitions()->maxRepetitionLevel()); if ($exceptMessage) { - $this->expectExceptionMessage($exceptMessage); + $this->expectExceptionMessageIsOrContains($exceptMessage); $shredder->shred($schema, $rows, 0); } else { diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Dremel/DremelMapsTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Dremel/DremelMapsTest.php index a81a356cb8..8b7b0cb6bf 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Dremel/DremelMapsTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Dremel/DremelMapsTest.php @@ -139,7 +139,7 @@ public function test_optional_map_string_optional_int32( static::assertEquals(1, $schema->get('m.key_value.value')->repetitions()->maxRepetitionLevel()); if ($exceptionMessage) { - $this->expectExceptionMessage($exceptionMessage); + $this->expectExceptionMessageIsOrContains($exceptionMessage); $shredder->shred($schema, $rows, 0); } else { @@ -348,7 +348,7 @@ public function test_optional_map_string_optional_list_optional_int32( static::assertEquals(2, $schema->get('m.key_value.value.list.element')->repetitions()->maxRepetitionLevel()); if ($exceptionMessage) { - $this->expectExceptionMessage($exceptionMessage); + $this->expectExceptionMessageIsOrContains($exceptionMessage); $shredder->shred($schema, $rows, 0); } else { @@ -610,7 +610,7 @@ public function test_optional_map_string_optional_map_string_optional_int( static::assertEquals(2, $schema->get('m.key_value.value.key_value.value')->repetitions()->maxRepetitionLevel()); if ($exceptionMessage) { - $this->expectExceptionMessage($exceptionMessage); + $this->expectExceptionMessageIsOrContains($exceptionMessage); $shredder->shred($schema, $rows, 0); } else { @@ -839,7 +839,7 @@ public function test_optional_map_string_optional_struct_optional_int32_optional static::assertEquals(1, $schema->get('m.key_value.value.string')->repetitions()->maxRepetitionLevel()); if ($exceptionMessage) { - $this->expectExceptionMessage($exceptionMessage); + $this->expectExceptionMessageIsOrContains($exceptionMessage); $shredder->shred($schema, $rows, 0); } else { @@ -956,7 +956,7 @@ public function test_optional_map_string_optional_struct_optional_list_optional_ static::assertEquals(2, $schema->get('m.key_value.value.l.list.element')->repetitions()->maxRepetitionLevel()); if ($exceptionMessage) { - $this->expectExceptionMessage($exceptionMessage); + $this->expectExceptionMessageIsOrContains($exceptionMessage); $shredder->shred($schema, $rows, 0); } else { @@ -1053,7 +1053,7 @@ public function test_optional_map_string_required_int32( static::assertEquals(1, $schema->get('m.key_value.value')->repetitions()->maxRepetitionLevel()); if ($exceptionMessage) { - $this->expectExceptionMessage($exceptionMessage); + $this->expectExceptionMessageIsOrContains($exceptionMessage); $shredder->shred($schema, $rows, 0); } else { @@ -1147,7 +1147,7 @@ public function test_required_map_string_required_int32( static::assertEquals(1, $schema->get('m.key_value.value')->repetitions()->maxRepetitionLevel()); if ($exceptionMessage) { - $this->expectExceptionMessage($exceptionMessage); + $this->expectExceptionMessageIsOrContains($exceptionMessage); $shredder->shred($schema, $rows, 0); } else { @@ -1246,7 +1246,7 @@ public function test_required_map_string_required_list_required_int32( static::assertEquals(2, $schema->get('m.key_value.value.list.element')->repetitions()->maxRepetitionLevel()); if ($exceptionMessage) { - $this->expectExceptionMessage($exceptionMessage); + $this->expectExceptionMessageIsOrContains($exceptionMessage); $shredder->shred($schema, $rows, 0); } else { @@ -1375,7 +1375,7 @@ public function test_required_map_string_required_map_string_required_int( static::assertEquals(2, $schema->get('m.key_value.value.key_value.value')->repetitions()->maxRepetitionLevel()); if ($exceptionMessage) { - $this->expectExceptionMessage($exceptionMessage); + $this->expectExceptionMessageIsOrContains($exceptionMessage); $shredder->shred($schema, $rows, 0); } else { @@ -1526,7 +1526,7 @@ public function test_required_map_string_required_struct_required_int32_required static::assertEquals(1, $schema->get('m.key_value.value.string')->repetitions()->maxRepetitionLevel()); if ($exceptionMessage) { - $this->expectExceptionMessage($exceptionMessage); + $this->expectExceptionMessageIsOrContains($exceptionMessage); $shredder->shred($schema, $rows, 0); } else { diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Dremel/DremelShredderTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Dremel/DremelShredderTest.php index 745a6bcb0d..b841c09412 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Dremel/DremelShredderTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Dremel/DremelShredderTest.php @@ -332,7 +332,7 @@ public function test_shred_columns_writes_a_column_the_array_lacks_as_nulls(): v public function test_shred_columns_names_the_writer_row_in_a_refusal(): void { $this->expectException(ValidationException::class); - $this->expectExceptionMessage('Column "id" row 12: '); + $this->expectExceptionMessageIsOrContains('Column "id" row 12: '); new DremelShredder(new ColumnDataValidator(), DataConverter::initialize(Options::default()))->shredColumns( Schema::with(FlatColumn::int32('id')), diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Dremel/DremelStructuresTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Dremel/DremelStructuresTest.php index 55a4177ef0..a706dfaad6 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Dremel/DremelStructuresTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Dremel/DremelStructuresTest.php @@ -178,7 +178,7 @@ public function test_optional_struct_optional_int_optional_string_optional_bool( static::assertEquals(0, $schema->get('s.bool')->repetitions()->maxRepetitionLevel()); if ($exceptionMessage) { - $this->expectExceptionMessage($exceptionMessage); + $this->expectExceptionMessageIsOrContains($exceptionMessage); $shredder->shred($schema, [$row], 0); } else { @@ -312,7 +312,7 @@ public function test_optional_struct_optional_list_optional_int( static::assertEquals(1, $schema->get('s.l.list.element')->repetitions()->maxRepetitionLevel()); if ($exceptionMessage) { - $this->expectExceptionMessage($exceptionMessage); + $this->expectExceptionMessageIsOrContains($exceptionMessage); $shredder->shred($schema, [$row], 0); } else { @@ -475,7 +475,7 @@ public function test_optional_struct_optional_map_string_optional_int( static::assertEquals(1, $schema->get('s.m.key_value.value')->repetitions()->maxRepetitionLevel()); if ($exceptionMessage) { - $this->expectExceptionMessage($exceptionMessage); + $this->expectExceptionMessageIsOrContains($exceptionMessage); $shredder->shred($schema, [$row], 0); } else { @@ -622,7 +622,7 @@ public function test_optional_struct_optional_struct_optional_int32_optional_str static::assertEquals(0, $schema->get('s.s1.string')->repetitions()->maxRepetitionLevel()); if ($exceptionMessage) { - $this->expectExceptionMessage($exceptionMessage); + $this->expectExceptionMessageIsOrContains($exceptionMessage); $shredder->shred($schema, [$row], 0); } else { @@ -754,7 +754,7 @@ public function test_required_struct_required_int_required_string_required_bool( static::assertEquals(0, $schema->get('s.bool')->repetitions()->maxRepetitionLevel()); if ($exceptionMessage) { - $this->expectExceptionMessage($exceptionMessage); + $this->expectExceptionMessageIsOrContains($exceptionMessage); $shredder->shred($schema, [$row], 0); } else { @@ -862,7 +862,7 @@ public function test_required_struct_required_list_required_int( static::assertEquals(1, $schema->get('s.l.list.element')->repetitions()->maxRepetitionLevel()); if ($exceptionMessage) { - $this->expectExceptionMessage($exceptionMessage); + $this->expectExceptionMessageIsOrContains($exceptionMessage); $shredder->shred($schema, [$row], 0); } else { @@ -985,7 +985,7 @@ public function test_required_struct_required_map_string_required_int( static::assertEquals(1, $schema->get('s.m.key_value.value')->repetitions()->maxRepetitionLevel()); if ($exceptionMessage) { - $this->expectExceptionMessage($exceptionMessage); + $this->expectExceptionMessageIsOrContains($exceptionMessage); $shredder->shred($schema, [$row], 0); } else { @@ -1112,7 +1112,7 @@ public function test_required_struct_required_struct_required_int32_required_str static::assertEquals(0, $schema->get('s.s1.int32')->repetitions()->maxRepetitionLevel()); if ($exceptionMessage) { - $this->expectExceptionMessage($exceptionMessage); + $this->expectExceptionMessageIsOrContains($exceptionMessage); $shredder->shred($schema, [$row], 0); } else { diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Dremel/Validator/ColumnDataValidatorTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Dremel/Validator/ColumnDataValidatorTest.php index 19240fb413..31777b5c21 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Dremel/Validator/ColumnDataValidatorTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Dremel/Validator/ColumnDataValidatorTest.php @@ -110,7 +110,7 @@ public function test_an_integer_out_of_the_column_range_is_refused_naming_its_ro string $message, ): void { $this->expectException(ValidationException::class); - $this->expectExceptionMessage('Column "c" row 3: ' . $message); + $this->expectExceptionMessageIsOrContains('Column "c" row 3: ' . $message); new ColumnDataValidator()->validate($column, $value, 3); } @@ -156,7 +156,7 @@ public function test_a_uint64_value_that_is_neither_int_nor_digit_string_is_refu string $shown, ): void { $this->expectException(ValidationException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Column "c" row 2: ' . $shown . ' is out of the UINT_64 range [0, 18446744073709551615]', ); @@ -202,7 +202,9 @@ public static function not_uuids(): Generator public function test_a_uuid_that_is_not_32_hex_digits_is_refused(mixed $value, string $type): void { $this->expectException(ValidationException::class); - $this->expectExceptionMessage('Column "c" row 1: ' . $type . ' is not a UUID of 32 hexadecimal digits'); + $this->expectExceptionMessageIsOrContains( + 'Column "c" row 1: ' . $type . ' is not a UUID of 32 hexadecimal digits', + ); new ColumnDataValidator()->validate(FlatColumn::uuid('c'), $value, 1); } @@ -217,7 +219,7 @@ public function test_a_fixed_length_value_of_its_length_is_accepted(): void public function test_a_fixed_length_value_of_another_length_is_refused(): void { $this->expectException(ValidationException::class); - $this->expectExceptionMessage('Column "c" row 2: a FIXED_LEN_BYTE_ARRAY(4) value is 5 bytes long'); + $this->expectExceptionMessageIsOrContains('Column "c" row 2: a FIXED_LEN_BYTE_ARRAY(4) value is 5 bytes long'); new ColumnDataValidator()->validate(FlatColumn::fixedSizeByteArray('c', 4), '12345', 2); } @@ -236,7 +238,7 @@ public static function utf8_columns(): Generator public function test_invalid_utf8_is_refused(FlatColumn $column): void { $this->expectException(ValidationException::class); - $this->expectExceptionMessage('Column "c" row 0: the string is not valid UTF-8'); + $this->expectExceptionMessageIsOrContains('Column "c" row 0: the string is not valid UTF-8'); new ColumnDataValidator()->validate($column, "\xFF\xFE", 0); } diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Engine/AdaptiveParquetEngineTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Engine/AdaptiveParquetEngineTest.php index 5b4dfe873d..cbfd239040 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Engine/AdaptiveParquetEngineTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Engine/AdaptiveParquetEngineTest.php @@ -105,7 +105,7 @@ public function test_big_endian_is_read_by_the_php_engine(): void public function test_an_arrow_extension_of_another_abi_is_refused(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('does not match flow-php/parquet'); + $this->expectExceptionMessageIsOrContains('does not match flow-php/parquet'); new AdaptiveParquetEngine(extension: new ArrowExtension(true, ArrowExtension::ABI + 1, '0.46.0')); } @@ -137,7 +137,7 @@ public function test_configuration_round_trips_the_byte_order_and_the_options(): public function test_a_configuration_without_a_byte_order_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Parquet engine configuration must hold a "byte_order" value'); + $this->expectExceptionMessageIsOrContains('Parquet engine configuration must hold a "byte_order" value'); AdaptiveParquetEngine::fromArray(['options' => []]); } diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Engine/Arrow/OptionsConverterTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Engine/Arrow/OptionsConverterTest.php index 66e2e4fbb1..4aa97b059b 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Engine/Arrow/OptionsConverterTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Engine/Arrow/OptionsConverterTest.php @@ -149,7 +149,7 @@ public function test_columns_bloom_filters_refuse_a_value_that_is_not_bloom_filt $options->set(Option::COLUMNS_BLOOM_FILTERS, ['id' => 0.01]); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Option COLUMNS_BLOOM_FILTERS takes BloomFilterOptions, got float for column "id"', ); diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Engine/Arrow/ReadPlanConverterTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Engine/Arrow/ReadPlanConverterTest.php index c8ff095ce0..3b6fdbd2e6 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Engine/Arrow/ReadPlanConverterTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Engine/Arrow/ReadPlanConverterTest.php @@ -205,7 +205,9 @@ public function test_the_offset_crosses_beside_the_limit(): void public function test_a_row_filter_holding_a_leaf_not_answered_exactly_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Rows are evaluated on leaves answered exactly, the leaf on "id" is not'); + $this->expectExceptionMessageIsOrContains( + 'Rows are evaluated on leaves answered exactly, the leaf on "id" is not', + ); ReadPlanConverter::toExtension( new ReadPlan( diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Engine/Arrow/RustRowGroupChunksTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Engine/Arrow/RustRowGroupChunksTest.php index e1ddfa85c4..8880eac259 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Engine/Arrow/RustRowGroupChunksTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Engine/Arrow/RustRowGroupChunksTest.php @@ -36,7 +36,7 @@ public function test_a_chunk_is_decoded_from_its_bytes_on_first_access_only(): v static::assertSame(ColumnOrder::TypeDefined, $chunks->columnOrder($id)); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Column chunk at offset 7 has no metadata (an encrypted column is not supported)', ); @@ -63,7 +63,7 @@ public function test_a_column_that_was_not_read_from_the_footer_is_refused(): vo } $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Column "name" was not read from the footer'); + $this->expectExceptionMessageIsOrContains('Column "name" was not read from the footer'); $chunks->chunk(0, FlatColumn::int64('name')); } @@ -73,7 +73,7 @@ public function test_a_row_group_the_file_lacks_is_refused(): void $chunks = RustRowGroupChunks::fromThrift([1], ['id' => ['']], ['id' => null]); $this->expectException(OutOfBoundsException::class); - $this->expectExceptionMessage('Row group 1 does not exist'); + $this->expectExceptionMessageIsOrContains('Row group 1 does not exist'); $chunks->chunk(1, FlatColumn::int64('id')); } diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Engine/ArrowExtensionTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Engine/ArrowExtensionTest.php index ad9d1a7742..763c8babf3 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Engine/ArrowExtensionTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Engine/ArrowExtensionTest.php @@ -25,7 +25,7 @@ public function test_a_loaded_extension_of_the_expected_abi_is_available(): void public function test_a_loaded_extension_of_another_abi_is_refused(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'The loaded arrow extension (0.46.0, ABI ' . (ArrowExtension::ABI + 1) . ') does not match flow-php/parquet (ABI ' @@ -40,7 +40,9 @@ public function test_a_loaded_extension_of_another_abi_is_refused(): void public function test_a_loaded_extension_without_an_abi_is_refused(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('The loaded arrow extension (0.44.1, ABI none) does not match flow-php/parquet'); + $this->expectExceptionMessageIsOrContains( + 'The loaded arrow extension (0.44.1, ABI none) does not match flow-php/parquet', + ); new ArrowExtension(true, null, '0.44.1')->available(); } diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Engine/PhpParquetEngineTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Engine/PhpParquetEngineTest.php index 20b19a277d..f31f7cd01a 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Engine/PhpParquetEngineTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Engine/PhpParquetEngineTest.php @@ -43,7 +43,7 @@ public function test_configuration_round_trips_the_byte_order_and_the_options(): public function test_a_configuration_with_an_unknown_byte_order_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Unknown byte order: MIDDLE'); + $this->expectExceptionMessageIsOrContains('Unknown byte order: MIDDLE'); PhpParquetEngine::fromArray(['byte_order' => 'MIDDLE', 'options' => []]); } @@ -51,7 +51,7 @@ public function test_a_configuration_with_an_unknown_byte_order_is_refused(): vo public function test_a_configuration_without_options_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Parquet engine configuration must hold an "options" array'); + $this->expectExceptionMessageIsOrContains('Parquet engine configuration must hold an "options" array'); PhpParquetEngine::fromArray(['byte_order' => 'V']); } diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Engine/PhpParquetFileReaderTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Engine/PhpParquetFileReaderTest.php index 178219caa2..b52760cb05 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Engine/PhpParquetFileReaderTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Engine/PhpParquetFileReaderTest.php @@ -221,7 +221,7 @@ public function test_a_plan_over_another_row_count_is_refused(): void ); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('A read plan over 5 rows cannot read a file of 6 rows'); + $this->expectExceptionMessageIsOrContains('A read plan over 5 rows cannot read a file of 6 rows'); iterator_to_array($reader->readColumns(['id'], 10, ReadPlanMother::window(5))); } @@ -254,7 +254,7 @@ public function test_close_closes_the_stream_and_every_later_call_throws_but_a_t public function test_a_file_without_the_parquet_magic_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Given file is not valid Parquet file'); + $this->expectExceptionMessageIsOrContains('Given file is not valid Parquet file'); new PhpParquetFileReader( new MemorySourceStream('not a parquet file'), diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Engine/PhpParquetFileWriterTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Engine/PhpParquetFileWriterTest.php index 20645917c4..ff08906098 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Engine/PhpParquetFileWriterTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Engine/PhpParquetFileWriterTest.php @@ -45,7 +45,7 @@ public function test_a_close_that_throws_leaves_the_writer_closed(): void } $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Writer is not open'); + $this->expectExceptionMessageIsOrContains('Writer is not open'); $file->close(); } @@ -59,7 +59,7 @@ public function test_closing_twice_throws(): void $file->close(); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Writer is not open'); + $this->expectExceptionMessageIsOrContains('Writer is not open'); $file->close(); } @@ -93,7 +93,7 @@ public function test_writing_a_batch_after_close_throws(): void $file->close(); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Writer is not open'); + $this->expectExceptionMessageIsOrContains('Writer is not open'); $file->writeBatch([['id' => 1]]); } @@ -107,7 +107,7 @@ public function test_writing_a_row_after_close_throws(): void $file->close(); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Writer is not open'); + $this->expectExceptionMessageIsOrContains('Writer is not open'); $file->writeRow(['id' => 1]); } @@ -238,7 +238,7 @@ public function test_columns_of_different_lengths_are_refused(): void $file = ColumnDoor::open(new PhpParquetEngine(), ColumnDoor::stream(), Schema::with(FlatColumn::int32('id'))); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('writeColumns() takes lists of one length, got "id": 2, "other": 1'); + $this->expectExceptionMessageIsOrContains('writeColumns() takes lists of one length, got "id": 2, "other": 1'); $file->writeColumns(['id' => [1, 2], 'other' => [1]]); } @@ -265,7 +265,7 @@ public function test_writing_columns_after_close_throws(): void $file->close(); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Writer is not open'); + $this->expectExceptionMessageIsOrContains('Writer is not open'); $file->writeColumns(['id' => [1]]); } diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Engine/RustParquetEngineTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Engine/RustParquetEngineTest.php index 5f8aff8c7a..52a3009311 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Engine/RustParquetEngineTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Engine/RustParquetEngineTest.php @@ -29,7 +29,7 @@ public function test_int96_as_datetime_false_refuses_an_int96_column(): void $engine = new RustParquetEngine(Options::default()->set(Option::INT_96_AS_DATETIME, false)); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Parquet column "ts" holds INT96'); + $this->expectExceptionMessageIsOrContains('Parquet column "ts" holds INT96'); $engine->openForRead(NativeLocalSourceStream::open(path_real(__DIR__ . '/../../Integration/IO/Fixtures/EdgeCases/int96.parquet')))->readColumns( @@ -42,7 +42,7 @@ public function test_int96_as_datetime_false_refuses_an_int96_column(): void public function test_lzo_is_refused(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('LZO compression is not supported by the Arrow engine'); + $this->expectExceptionMessageIsOrContains('LZO compression is not supported by the Arrow engine'); new RustParquetEngine()->openForWrite( new StringDestinationStream(path('memory://out.parquet')), @@ -72,7 +72,7 @@ public function test_a_default_engine_describes_the_default_options(): void public function test_a_configuration_without_options_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Parquet engine configuration must hold an "options" array'); + $this->expectExceptionMessageIsOrContains('Parquet engine configuration must hold an "options" array'); RustParquetEngine::fromArray([]); } diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Filter/Binding/BoundFilterTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Filter/Binding/BoundFilterTest.php index 090804bcc6..2f447dba9f 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Filter/Binding/BoundFilterTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Filter/Binding/BoundFilterTest.php @@ -195,7 +195,7 @@ public function test_a_leaf_of_another_tree_is_refused(): void ); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('The leaf is not part of the bound filter'); + $this->expectExceptionMessageIsOrContains('The leaf is not part of the bound filter'); $bound->leaf(parquet_column('id')->equals(1)); } @@ -280,7 +280,9 @@ public function test_a_row_leaf_is_an_answered_or_absent_leaf_and_another_is_ref static::assertSame($bound->leaf($missing), $bound->rowLeaf($missing)); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Rows are evaluated on leaves answered exactly, the leaf on "id" is not'); + $this->expectExceptionMessageIsOrContains( + 'Rows are evaluated on leaves answered exactly, the leaf on "id" is not', + ); $bound->rowLeaf($refused); } diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Filter/ColumnRefTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Filter/ColumnRefTest.php index 3ebd4b6ff7..bb39bceb4e 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Filter/ColumnRefTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Filter/ColumnRefTest.php @@ -60,7 +60,7 @@ public function test_a_date_time_literal_is_stored_immutable(): void public function test_an_empty_path_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('A column path cannot be empty'); + $this->expectExceptionMessageIsOrContains('A column path cannot be empty'); parquet_column(''); } diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Filter/Evaluation/FilterEvaluatorTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Filter/Evaluation/FilterEvaluatorTest.php index b910be306e..6a6d88107b 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Filter/Evaluation/FilterEvaluatorTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Filter/Evaluation/FilterEvaluatorTest.php @@ -459,7 +459,7 @@ public function test_a_literal_the_column_cannot_hold_is_refused( string $message, ): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage($message); + $this->expectExceptionMessageIsOrContains($message); new FilterEvaluator(BoundFilter::bind( parquet_column($column)->equals($literal), @@ -477,7 +477,7 @@ public function test_a_literal_the_column_cannot_hold_is_refused( public function test_a_prefix_on_a_column_without_strings_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Column "i" (INT64) holds no strings for a prefix'); + $this->expectExceptionMessageIsOrContains('Column "i" (INT64) holds no strings for a prefix'); new FilterEvaluator(BoundFilter::bind( parquet_column('i')->startsWith('1'), @@ -489,7 +489,7 @@ public function test_a_prefix_on_a_column_without_strings_is_refused(): void public function test_a_leaf_inside_a_list_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Filter column "tags.list.element" lies inside a list or a map, where a row holds no single value', ); @@ -503,7 +503,7 @@ public function test_a_leaf_inside_a_list_is_refused(): void public function test_a_struct_column_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Filter column "address" is not a leaf column'); + $this->expectExceptionMessageIsOrContains('Filter column "address" is not a leaf column'); new FilterEvaluator(BoundFilter::bind( parquet_column('address')->isNull(), diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Filter/Evaluation/RowEvaluatorTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Filter/Evaluation/RowEvaluatorTest.php index 663c59ae9a..459b020b37 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Filter/Evaluation/RowEvaluatorTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Filter/Evaluation/RowEvaluatorTest.php @@ -324,7 +324,9 @@ public function test_a_prefix_compares_raw_bytes(string $value, bool $kept): voi public function test_a_leaf_not_answered_exactly_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Rows are evaluated on leaves answered exactly, the leaf on "i" is not'); + $this->expectExceptionMessageIsOrContains( + 'Rows are evaluated on leaves answered exactly, the leaf on "i" is not', + ); RowEvaluator::evaluate( BoundFilter::bind(parquet_column('i')->equals('1'), Schema::with(FlatColumn::int64('i')), new Options()), @@ -358,7 +360,7 @@ public function test_is_null_is_true_on_a_null_row_and_is_not_null_on_a_value(): public function test_a_bound_column_without_values_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('No physical values of column "i"'); + $this->expectExceptionMessageIsOrContains('No physical values of column "i"'); RowEvaluator::evaluate( BoundFilter::bind(parquet_column('i')->isNull(), Schema::with(FlatColumn::int64('i')), new Options()), @@ -370,7 +372,7 @@ public function test_a_bound_column_without_values_is_refused(): void public function test_values_for_another_row_count_are_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Column "i" holds 1 physical values for 2 rows'); + $this->expectExceptionMessageIsOrContains('Column "i" holds 1 physical values for 2 rows'); RowEvaluator::evaluate( BoundFilter::bind(parquet_column('i')->isNull(), Schema::with(FlatColumn::int64('i')), new Options()), diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Filter/LiteralTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Filter/LiteralTest.php index af945d7f50..801a1fe127 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Filter/LiteralTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Filter/LiteralTest.php @@ -43,7 +43,7 @@ public function test_an_immutable_date_time_is_kept_equal(): void public function test_another_kind_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'A filter literal must be a scalar, a DateTimeInterface or a Stringable, array given', ); diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Filter/NotTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Filter/NotTest.php index a2857e16af..7717e6e07d 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Filter/NotTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Filter/NotTest.php @@ -38,7 +38,7 @@ public function test_a_not_visits_as_a_not(): void public function test_a_null_literal_is_refused_in_favour_of_is_null(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('A filter literal cannot be null, use isNull()'); + $this->expectExceptionMessageIsOrContains('A filter literal cannot be null, use isNull()'); parquet_column('id')->notEquals(null); } @@ -47,7 +47,7 @@ public function test_a_null_literal_is_refused_in_favour_of_is_null(): void public function test_a_nan_literal_is_refused(float $nan): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('A filter literal cannot be NaN'); + $this->expectExceptionMessageIsOrContains('A filter literal cannot be NaN'); parquet_column('score')->notIn([1.0, $nan]); } diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/ParquetFile/ColumnOrderTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/ParquetFile/ColumnOrderTest.php index d2872fec23..ec20b53290 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/ParquetFile/ColumnOrderTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/ParquetFile/ColumnOrderTest.php @@ -63,7 +63,7 @@ public function test_thrift_round_trip(ColumnOrder $order): void public function test_absent_cannot_be_written(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Column order Absent cannot be written'); + $this->expectExceptionMessageIsOrContains('Column order Absent cannot be written'); ColumnOrder::Absent->toThrift(); } diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/ParquetFile/Data/Converter/DecimalConverterTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/ParquetFile/Data/Converter/DecimalConverterTest.php index f7693ab93a..87a0df12c9 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/ParquetFile/Data/Converter/DecimalConverterTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/ParquetFile/Data/Converter/DecimalConverterTest.php @@ -88,7 +88,7 @@ public function test_to_parquet_type_over_precision_throws(): void public function test_to_parquet_type_refuses_a_non_number(mixed $value): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Decimal must be written as int or float, got '); + $this->expectExceptionMessageIsOrContains('Decimal must be written as int or float, got '); new DecimalConverter(PhysicalType::INT64, 10, 2)->toParquetType($value); } diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/ParquetFile/Data/Converter/Int64DateTimeConverterTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/ParquetFile/Data/Converter/Int64DateTimeConverterTest.php index 0d64d18ef8..64a0d18ff5 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/ParquetFile/Data/Converter/Int64DateTimeConverterTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/ParquetFile/Data/Converter/Int64DateTimeConverterTest.php @@ -93,7 +93,7 @@ public function test_to_parquet_type(TimeUnit $unit, string $dateTime, int $expe public function test_to_parquet_type_outside_nanos_range_throws(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'DateTime 2262-04-12T00:00:00+00:00 is outside the TIMESTAMP(NANOS) range 1677-09-21 – 2262-04-11', ); diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/ParquetFile/Data/Converter/StoredTemporalConverterTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/ParquetFile/Data/Converter/StoredTemporalConverterTest.php index 7ecf18b12d..c2c0397f3a 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/ParquetFile/Data/Converter/StoredTemporalConverterTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/ParquetFile/Data/Converter/StoredTemporalConverterTest.php @@ -123,7 +123,7 @@ public function test_days_are_stored_as_they_are(): void public function test_an_instant_outside_the_nanosecond_range_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('outside the TIMESTAMP(NANOS) range'); + $this->expectExceptionMessageIsOrContains('outside the TIMESTAMP(NANOS) range'); StoredTemporalConverter::micros(TimeUnit::NANOSECONDS)->toParquetType(9_300_000_000_000_000); } @@ -131,7 +131,7 @@ public function test_an_instant_outside_the_nanosecond_range_is_refused(): void public function test_a_value_that_is_no_integer_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Expected int, got string'); + $this->expectExceptionMessageIsOrContains('Expected int, got string'); StoredTemporalConverter::micros(TimeUnit::MICROSECONDS)->toParquetType('1'); } @@ -147,7 +147,7 @@ public function test_int96_bytes_read_as_microseconds_since_the_epoch(): void public function test_int96_bytes_of_another_length_are_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Expected 12 INT96 bytes'); + $this->expectExceptionMessageIsOrContains('Expected 12 INT96 bytes'); StoredTemporalConverter::int96()->fromParquetType('short'); } @@ -155,7 +155,7 @@ public function test_int96_bytes_of_another_length_are_refused(): void public function test_an_int96_write_is_refused(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('INT96 timestamps are read only'); + $this->expectExceptionMessageIsOrContains('INT96 timestamps are read only'); StoredTemporalConverter::int96()->toParquetType(1); } diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/ParquetFile/Data/Converter/UnsignedInt32ConverterTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/ParquetFile/Data/Converter/UnsignedInt32ConverterTest.php index 0f11744e2b..d43edf9bbf 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/ParquetFile/Data/Converter/UnsignedInt32ConverterTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/ParquetFile/Data/Converter/UnsignedInt32ConverterTest.php @@ -28,7 +28,7 @@ public function test_uint32_reads_back_as_itself(int $stored, int $value): void public function test_a_value_that_is_not_an_int_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Expected int, got string'); + $this->expectExceptionMessageIsOrContains('Expected int, got string'); new UnsignedInt32Converter()->fromParquetType('1'); } diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/ParquetFile/Data/Converter/UnsignedInt64ConverterTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/ParquetFile/Data/Converter/UnsignedInt64ConverterTest.php index 8f822d9b51..adf3e50aa9 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/ParquetFile/Data/Converter/UnsignedInt64ConverterTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/ParquetFile/Data/Converter/UnsignedInt64ConverterTest.php @@ -46,7 +46,7 @@ public function test_an_int_writes_as_itself(): void public function test_a_value_out_of_uint64_is_refused(mixed $value, string $shown): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Expected an int >= 0 or a digit string up to 18446744073709551615, got ' + $this->expectExceptionMessageIsOrContains('Expected an int >= 0 or a digit string up to 18446744073709551615, got ' . $shown); new UnsignedInt64Converter()->toParquetType($value); @@ -55,7 +55,7 @@ public function test_a_value_out_of_uint64_is_refused(mixed $value, string $show public function test_reading_anything_but_an_int_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Expected int, got string'); + $this->expectExceptionMessageIsOrContains('Expected int, got string'); new UnsignedInt64Converter()->fromParquetType('1'); } diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/ParquetFile/Data/Converter/UuidConverterTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/ParquetFile/Data/Converter/UuidConverterTest.php index 920d97231c..607df91ff0 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/ParquetFile/Data/Converter/UuidConverterTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/ParquetFile/Data/Converter/UuidConverterTest.php @@ -44,7 +44,7 @@ public function test_physical_value_is_the_16_raw_bytes_whatever_the_case(): voi public function test_malformed_uuid_is_refused(string $uuid): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Invalid UUID format: ' . $uuid); + $this->expectExceptionMessageIsOrContains('Invalid UUID format: ' . $uuid); new UuidConverter()->toParquetType($uuid); } @@ -52,7 +52,7 @@ public function test_malformed_uuid_is_refused(string $uuid): void public function test_reading_anything_but_16_bytes_is_refused(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('UUID must be read as 16 bytes from Parquet file'); + $this->expectExceptionMessageIsOrContains('UUID must be read as 16 bytes from Parquet file'); new UuidConverter()->fromParquetType('550e8400-e29b-41d4-a716-446655440000'); } @@ -60,7 +60,7 @@ public function test_reading_anything_but_16_bytes_is_refused(): void public function test_writing_a_non_uuid_value_is_refused(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('UUID must be written as a string or Stringable object'); + $this->expectExceptionMessageIsOrContains('UUID must be written as a string or Stringable object'); new UuidConverter()->toParquetType(1); } diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/ParquetFile/Data/DataConverterTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/ParquetFile/Data/DataConverterTest.php index c1fad4a288..7d1ff49712 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/ParquetFile/Data/DataConverterTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/ParquetFile/Data/DataConverterTest.php @@ -38,7 +38,7 @@ public function test_conversion_failure_is_wrapped_on_every_value(): void static::assertEquals(new DateTimeImmutable('1970-01-02 00:00:00 UTC'), $converter->fromParquetType($column, 1)); $this->expectException(DataConversionException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( "Failed to convert data from parquet type for column 'd'. Expected int, got string", ); diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/ParquetFile/Index/IndexLocationTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/ParquetFile/Index/IndexLocationTest.php index 1c06305b93..53968fc6d7 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/ParquetFile/Index/IndexLocationTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/ParquetFile/Index/IndexLocationTest.php @@ -16,7 +16,7 @@ final class IndexLocationTest extends TestCase public function test_a_location_before_the_file_or_of_no_bytes_is_refused(int $offset, int $length): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'An index location needs an offset of at least 0 and a length of at least 1, got ' . $offset . ' and ' diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/ParquetFile/MetadataRowGroupChunksTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/ParquetFile/MetadataRowGroupChunksTest.php index 830e29f5d8..f67a1c884b 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/ParquetFile/MetadataRowGroupChunksTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/ParquetFile/MetadataRowGroupChunksTest.php @@ -28,7 +28,7 @@ public function test_a_row_group_the_file_lacks_is_refused(): void $metadata = MemoryParquetFile::read(Reader::php(), MemoryParquetFile::threeRowGroups())->metadata(); $this->expectException(OutOfBoundsException::class); - $this->expectExceptionMessage('Row group 3 does not exist'); + $this->expectExceptionMessageIsOrContains('Row group 3 does not exist'); new MetadataRowGroupChunks($metadata)->chunk(3, $metadata->schema()->getFlat('id')); } diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/ParquetFile/MetadataTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/ParquetFile/MetadataTest.php index 62a6d1b033..9f8e459afe 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/ParquetFile/MetadataTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/ParquetFile/MetadataTest.php @@ -59,7 +59,7 @@ public function test_footer_with_fewer_column_orders_than_leaves_is_refused(): v $thrift->column_orders = [ColumnOrder::TypeDefined->toThrift()]; $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Footer holds 1 column orders for 2 leaf columns'); + $this->expectExceptionMessageIsOrContains('Footer holds 1 column orders for 2 leaf columns'); Metadata::fromThrift($thrift); } @@ -78,7 +78,7 @@ public function test_column_order_of_a_column_outside_the_schema_is_refused(): v ); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Column "b" is not a leaf of the schema'); + $this->expectExceptionMessageIsOrContains('Column "b" is not a leaf of the schema'); $metadata->columnOrder(FlatColumn::string('b')); } diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/ParquetFile/PageIndex/ColumnIndexTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/ParquetFile/PageIndex/ColumnIndexTest.php index 8b88026bf7..69681fdfbf 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/ParquetFile/PageIndex/ColumnIndexTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/ParquetFile/PageIndex/ColumnIndexTest.php @@ -30,7 +30,7 @@ public function test_counts_a_writer_left_out_stay_unknown(): void public function test_lists_of_another_length_than_the_pages_are_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Every list of a column index has one entry per page'); + $this->expectExceptionMessageIsOrContains('Every list of a column index has one entry per page'); new ColumnIndex([false, false], ['a', 'b'], ['c', 'd'], BoundaryOrder::UNORDERED, null, [0]); } diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/ParquetFile/RowGroup/ColumnChunkTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/ParquetFile/RowGroup/ColumnChunkTest.php index 0e5bec0e59..feb10ed835 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/ParquetFile/RowGroup/ColumnChunkTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/ParquetFile/RowGroup/ColumnChunkTest.php @@ -20,7 +20,7 @@ final class ColumnChunkTest extends TestCase public function test_a_column_chunk_without_metadata_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Column chunk at offset 4 has no metadata (an encrypted column is not supported)', ); @@ -107,7 +107,7 @@ public function test_a_location_no_index_can_be_read_from_is_no_location(): void public function test_a_bloom_filter_length_without_its_offset_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('A column chunk records a bloom filter length without its offset'); + $this->expectExceptionMessageIsOrContains('A column chunk records a bloom filter length without its offset'); new ColumnChunk( PhysicalType::INT64, diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/ParquetFile/Schema/FlatColumnTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/ParquetFile/Schema/FlatColumnTest.php index 7174ab757c..63ff839a66 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/ParquetFile/Schema/FlatColumnTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/ParquetFile/Schema/FlatColumnTest.php @@ -59,7 +59,7 @@ public function test_decimal_physical_type_follows_precision(int $precision, Phy public function test_decimal_rejects_precision_out_of_range(int $precision): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage("Precision must be between 1 and 38, {$precision} given."); + $this->expectExceptionMessageIsOrContains("Precision must be between 1 and 38, {$precision} given."); FlatColumn::decimal('x', $precision, 2); } @@ -230,7 +230,7 @@ public static function contradicting_annotations(): Generator public function test_contradicting_annotations_are_refused(ConvertedType $converted, LogicalType $logical): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Column "c": converted type ' . $converted->name . ' contradicts logical type ' . $logical->name(), ); @@ -240,7 +240,7 @@ public function test_contradicting_annotations_are_refused(ConvertedType $conver public function test_a_leaf_without_a_physical_type_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Schema element "c" is a leaf without a physical type'); + $this->expectExceptionMessageIsOrContains('Schema element "c" is a leaf without a physical type'); FlatColumn::fromThrift(new SchemaElement(['name' => 'c'])); } diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/ParquetFile/Schema/LogicalType/IntegerTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/ParquetFile/Schema/LogicalType/IntegerTest.php index 93f67023fb..c21b080eb8 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/ParquetFile/Schema/LogicalType/IntegerTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/ParquetFile/Schema/LogicalType/IntegerTest.php @@ -81,7 +81,9 @@ public function test_thrift_round_trip(int $bitWidth, bool $isSigned): void public function test_a_footer_whose_converted_and_logical_integers_disagree_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Column "i": converted type UINT_32 contradicts logical type INTEGER'); + $this->expectExceptionMessageIsOrContains( + 'Column "i": converted type UINT_32 contradicts logical type INTEGER', + ); FlatColumn::fromThrift(new SchemaElement([ 'name' => 'i', diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/ParquetFile/Schema/TimeUnitTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/ParquetFile/Schema/TimeUnitTest.php index d7ff58fc55..9be25c16be 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/ParquetFile/Schema/TimeUnitTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/ParquetFile/Schema/TimeUnitTest.php @@ -32,7 +32,7 @@ public function test_from_thrift_maps_each_unit(string $field, TimeUnit $expecte public function test_from_thrift_without_unit_throws(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Unsupported time unit, expected one of MILLIS, MICROS, NANOS'); + $this->expectExceptionMessageIsOrContains('Unsupported time unit, expected one of MILLIS, MICROS, NANOS'); TimeUnit::fromThrift(new ThriftTimeUnit()); } diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/ParquetFileTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/ParquetFileTest.php index d8d058951c..e5952681a1 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/ParquetFileTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/ParquetFileTest.php @@ -121,7 +121,7 @@ public function test_columns_refuses_a_column_the_schema_lacks(): void ); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Column "missing" does not exist'); + $this->expectExceptionMessageIsOrContains('Column "missing" does not exist'); iterator_to_array($file->columns(parquet_query()->select('missing'))); } @@ -135,7 +135,7 @@ public function test_columns_refuses_a_batch_size_below_one(): void ); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Batch size must be greater than 0'); + $this->expectExceptionMessageIsOrContains('Batch size must be greater than 0'); iterator_to_array($file->columns(batchSize: 0)); } @@ -310,7 +310,7 @@ public function test_a_filter_literal_the_column_cannot_hold_is_refused(): void ); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Column "id" (INT64) cannot hold the string literal \'1\''); + $this->expectExceptionMessageIsOrContains('Column "id" (INT64) cannot hold the string literal \'1\''); iterator_to_array($file->values(parquet_query()->where(parquet_column('id')->equals('1')))); } diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/QueryTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/QueryTest.php index 70505e5610..5086e6921f 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/QueryTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/QueryTest.php @@ -59,7 +59,7 @@ public function test_each_filter_narrows_the_ones_before(): void public function test_select_without_columns_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('A query selects at least one column'); + $this->expectExceptionMessageIsOrContains('A query selects at least one column'); parquet_query()->select(); } @@ -67,7 +67,7 @@ public function test_select_without_columns_is_refused(): void public function test_an_empty_column_name_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('A query column name cannot be empty'); + $this->expectExceptionMessageIsOrContains('A query column name cannot be empty'); parquet_query()->select('id', ''); } @@ -75,7 +75,7 @@ public function test_an_empty_column_name_is_refused(): void public function test_a_column_selected_twice_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('A query selects each column once'); + $this->expectExceptionMessageIsOrContains('A query selects each column once'); parquet_query()->select('id', 'id'); } @@ -84,7 +84,7 @@ public function test_a_column_selected_twice_is_refused(): void public function test_a_negative_offset_is_refused(int $offset, string $message): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage($message); + $this->expectExceptionMessageIsOrContains($message); parquet_query()->offset($offset); } @@ -93,7 +93,7 @@ public function test_a_negative_offset_is_refused(int $offset, string $message): public function test_a_negative_limit_is_refused(int $limit, string $message): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage($message); + $this->expectExceptionMessageIsOrContains($message); parquet_query()->limit($limit); } diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Reader/ColumnReaderTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Reader/ColumnReaderTest.php index 40b583b440..f025154b7b 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Reader/ColumnReaderTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Reader/ColumnReaderTest.php @@ -280,7 +280,7 @@ public function test_physical_values_of_a_repeated_leaf_are_refused(): void ); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Column "tags.list.element" lies inside a list or a map, where a row holds no single value', ); diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Reader/FilteredBatchesTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Reader/FilteredBatchesTest.php index b939d97481..c68ab0cfd6 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Reader/FilteredBatchesTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Reader/FilteredBatchesTest.php @@ -145,7 +145,7 @@ static function () use (&$pulled): Generator { public function test_no_returned_column_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('A filtered read returns at least one column'); + $this->expectExceptionMessageIsOrContains('A filtered read returns at least one column'); new FilteredBatches( new FilterEvaluator(BoundFilter::bind( diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Reader/PageRunTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Reader/PageRunTest.php index fdc8d9632f..848e10446b 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Reader/PageRunTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Reader/PageRunTest.php @@ -20,7 +20,7 @@ public function test_an_extended_run_keeps_its_start(): void public function test_a_run_of_no_bytes_is_refused(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('The offset index locates a page of no bytes at offset 100'); + $this->expectExceptionMessageIsOrContains('The offset index locates a page of no bytes at offset 100'); new PageRun(100, 100); } diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Reader/PageValuesDecoderTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Reader/PageValuesDecoderTest.php index c17596e29a..e064309035 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Reader/PageValuesDecoderTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Reader/PageValuesDecoderTest.php @@ -158,7 +158,7 @@ public function test_decodes_rle_booleans(): void public function test_delta_binary_packed_rejects_a_string_column(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Delta encoding only supports INT32 and INT64 physical types'); + $this->expectExceptionMessageIsOrContains('Delta encoding only supports INT32 and INT64 physical types'); iterator_to_array(new PageValuesDecoder()->decode( new BinaryBufferReader(new DeltaBinaryPackedEncoder()->encode([1])), @@ -171,7 +171,7 @@ public function test_delta_binary_packed_rejects_a_string_column(): void public function test_delta_byte_array_rejects_a_fixed_len_byte_array_value_of_the_wrong_length(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( "DELTA_BYTE_ARRAY value 1 of FIXED_LEN_BYTE_ARRAY column 'f' has 3 bytes, expected 4", ); @@ -186,7 +186,7 @@ public function test_delta_byte_array_rejects_a_fixed_len_byte_array_value_of_th public function test_delta_byte_array_rejects_an_int32_column(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'DELTA_BYTE_ARRAY encoding only supports BYTE_ARRAY and FIXED_LEN_BYTE_ARRAY physical types', ); @@ -201,7 +201,9 @@ public function test_delta_byte_array_rejects_an_int32_column(): void public function test_delta_length_byte_array_rejects_an_int32_column(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('DELTA_LENGTH_BYTE_ARRAY encoding only supports BYTE_ARRAY physical type'); + $this->expectExceptionMessageIsOrContains( + 'DELTA_LENGTH_BYTE_ARRAY encoding only supports BYTE_ARRAY physical type', + ); iterator_to_array(new PageValuesDecoder()->decode( new BinaryBufferReader(new DeltaLengthByteArrayEncoder()->encode(['a'])), @@ -214,7 +216,7 @@ public function test_delta_length_byte_array_rejects_an_int32_column(): void public function test_rle_on_a_non_boolean_column_is_not_supported(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Encoding RLE not supported'); + $this->expectExceptionMessageIsOrContains('Encoding RLE not supported'); iterator_to_array(new PageValuesDecoder()->decode( new BinaryBufferReader("\x00\x00\x00\x00"), diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Reader/ReadPlanTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Reader/ReadPlanTest.php index b5c2147239..fcb5c4a9b5 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Reader/ReadPlanTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Reader/ReadPlanTest.php @@ -31,7 +31,9 @@ final class ReadPlanTest extends TestCase public function test_matched_rows_over_another_row_count_are_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('A read plan selection and its matched rows must cover the same rows'); + $this->expectExceptionMessageIsOrContains( + 'A read plan selection and its matched rows must cover the same rows', + ); new ReadPlan(RowSelection::all(3), RowSelection::all(2), new InMemoryIndexes()); } @@ -39,7 +41,7 @@ public function test_matched_rows_over_another_row_count_are_refused(): void public function test_matched_rows_outside_the_selection_are_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('A read plan can match only rows it selects'); + $this->expectExceptionMessageIsOrContains('A read plan can match only rows it selects'); new ReadPlan(RowSelection::window(5, 2), RowSelection::all(5), new InMemoryIndexes()); } @@ -81,7 +83,7 @@ public function test_a_limit_beside_a_wholly_bound_filter_counts_the_rows_the_ro public function test_a_negative_offset_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('A read plan offset cannot be negative, got -1'); + $this->expectExceptionMessageIsOrContains('A read plan offset cannot be negative, got -1'); new ReadPlan(RowSelection::all(3), RowSelection::none(3), new InMemoryIndexes(), offset: -1); } @@ -89,7 +91,9 @@ public function test_a_negative_offset_is_refused(): void public function test_an_offset_without_a_row_filter_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('A read plan offset counts the rows its row filter keeps, and it has none'); + $this->expectExceptionMessageIsOrContains( + 'A read plan offset counts the rows its row filter keeps, and it has none', + ); new ReadPlan(RowSelection::all(3), RowSelection::none(3), new InMemoryIndexes(), offset: 1); } @@ -110,7 +114,7 @@ public function test_an_offset_beside_a_wholly_bound_filter_counts_the_rows_the_ public function test_an_offset_without_a_filter_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'An offset counts the rows returned, which a plan cannot honour unless the file answers every conjunct of ' . 'its filter exactly', ); @@ -124,7 +128,7 @@ public function test_an_offset_beside_a_filter_not_wholly_bound_is_refused(Filte $footer = new SpyFooter(Schema::with(FlatColumn::int64('id')), 10); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'An offset counts the rows returned, which a plan cannot honour unless the file answers every conjunct of ' . 'its filter exactly', ); @@ -184,7 +188,7 @@ public function test_a_limit_beside_a_filter_not_wholly_bound_is_refused(Filter $footer = new SpyFooter(Schema::with(FlatColumn::int64('id')), 10); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'A limit counts the rows returned, which a plan cannot honour unless the file answers every conjunct of ' . 'its filter exactly', ); diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Reader/RowSelectionTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Reader/RowSelectionTest.php index 6597697c12..47b097bd8c 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Reader/RowSelectionTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Reader/RowSelectionTest.php @@ -78,7 +78,7 @@ public function test_the_intersection_of_selections_of_no_row_selects_nothing(): public function test_selections_of_other_row_counts_cannot_be_intersected(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Row selections of 10 and 9 rows cannot be combined'); + $this->expectExceptionMessageIsOrContains('Row selections of 10 and 9 rows cannot be combined'); RowSelection::all(10)->intersection(RowSelection::all(9)); } @@ -158,7 +158,7 @@ public function test_the_head_selects_the_first_selected_rows(): void public function test_a_mask_of_another_row_count_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('A mask of 2 rows cannot narrow a selection of 3 rows'); + $this->expectExceptionMessageIsOrContains('A mask of 2 rows cannot narrow a selection of 3 rows'); RowSelection::window(5, 1, 3)->masked([true, false]); } @@ -166,7 +166,7 @@ public function test_a_mask_of_another_row_count_is_refused(): void public function test_selections_of_other_row_counts_cannot_be_united(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Row selections of 10 and 9 rows cannot be combined'); + $this->expectExceptionMessageIsOrContains('Row selections of 10 and 9 rows cannot be combined'); RowSelection::all(10)->union(RowSelection::all(9)); } @@ -226,7 +226,7 @@ public function test_a_split_is_one_selection_per_part(): void public function test_a_split_into_parts_of_another_row_count_is_refused(array $rowCounts): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('A selection of 9 rows cannot be split into parts of'); + $this->expectExceptionMessageIsOrContains('A selection of 9 rows cannot be split into parts of'); RowSelection::all(9)->split($rowCounts); } @@ -260,7 +260,7 @@ public function test_a_slice_is_the_rows_from_an_offset_its_first_row_being_row_ public function test_a_slice_outside_the_selection_is_refused(int $offset, int $rows): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('lie outside a selection of 10 rows'); + $this->expectExceptionMessageIsOrContains('lie outside a selection of 10 rows'); RowSelection::all(10)->slice($offset, $rows); } diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Reader/RowSelectorTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Reader/RowSelectorTest.php index 23456859a0..6aeb0fe197 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Reader/RowSelectorTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Reader/RowSelectorTest.php @@ -13,7 +13,7 @@ final class RowSelectorTest extends TestCase public function test_a_negative_row_count_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Row selector row count must be 0 or more, got -1'); + $this->expectExceptionMessageIsOrContains('Row selector row count must be 0 or more, got -1'); new RowSelector(-1, false); } diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Reader/SelectedPagesTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Reader/SelectedPagesTest.php index 1af85f3e47..64e23c5fca 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Reader/SelectedPagesTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Reader/SelectedPagesTest.php @@ -198,7 +198,7 @@ public function test_a_row_group_decoding_more_rows_than_its_selection_is_refuse $metadata = new PhpParquetFileReader($stream, ByteOrder::LITTLE_ENDIAN, new Options())->footer()->metadata(); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Row group 0 decodes more than the 1 rows its metadata declares'); + $this->expectExceptionMessageIsOrContains('Row group 0 decodes more than the 1 rows its metadata declares'); iterator_to_array(new SelectedPages( new ColumnChunkReader(new PageReader(ByteOrder::LITTLE_ENDIAN, new Options()), new Options()), diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Reader/SkippedMatchesTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Reader/SkippedMatchesTest.php index 193e17c07c..b4c9bf2e5c 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Reader/SkippedMatchesTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Reader/SkippedMatchesTest.php @@ -18,7 +18,7 @@ public function test_it_carries_the_matches_skipped(): void public function test_a_negative_count_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Skipped matches cannot be negative, given: -1'); + $this->expectExceptionMessageIsOrContains('Skipped matches cannot be negative, given: -1'); new SkippedMatches(-1); } diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Thrift/CompactProtocolTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Thrift/CompactProtocolTest.php index a120121ad2..e07475c04d 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Thrift/CompactProtocolTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Thrift/CompactProtocolTest.php @@ -305,7 +305,7 @@ public function test_read_bool_throws_exception_in_invalid_state(): void $protocol = new CompactProtocol($buffer); $this->expectException(TProtocolException::class); - $this->expectExceptionMessage('Invalid state in compact protocol'); + $this->expectExceptionMessageIsOrContains('Invalid state in compact protocol'); $protocol->readBool($_bool); } @@ -319,7 +319,7 @@ public function test_read_message_with_bad_protocol_id_throws_exception(): void $protocol = new CompactProtocol($buffer); $this->expectException(TProtocolException::class); - $this->expectExceptionMessage('Bad protocol id in TCompact message'); + $this->expectExceptionMessageIsOrContains('Bad protocol id in TCompact message'); $protocol->readMessageBegin($_name, $_type, $_seqid); } @@ -333,7 +333,7 @@ public function test_read_message_with_bad_version_throws_exception(): void $protocol = new CompactProtocol($buffer); $this->expectException(TProtocolException::class); - $this->expectExceptionMessage('Bad version in TCompact message'); + $this->expectExceptionMessageIsOrContains('Bad version in TCompact message'); $protocol->readMessageBegin($_name, $_type, $_seqid); } @@ -477,7 +477,7 @@ public function test_skip_unknown_type_throws_exception(): void $protocol = new CompactProtocol($buffer); $this->expectException(TProtocolException::class); - $this->expectExceptionMessage('Unknown field type: 99'); + $this->expectExceptionMessageIsOrContains('Unknown field type: 99'); $this->expectExceptionCode(TProtocolException::INVALID_DATA); $protocol->skip(99); @@ -579,7 +579,7 @@ public function test_write_read_bool_throws_exception_in_invalid_state(): void $protocol = new CompactProtocol($buffer); $this->expectException(TProtocolException::class); - $this->expectExceptionMessage('Invalid state in compact protocol'); + $this->expectExceptionMessageIsOrContains('Invalid state in compact protocol'); $protocol->writeBool(true); } diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Thrift/MemoryBufferTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Thrift/MemoryBufferTest.php index 63b647b3d8..27bff0fe7a 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Thrift/MemoryBufferTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Thrift/MemoryBufferTest.php @@ -192,7 +192,7 @@ public function test_read_from_empty_buffer_throws_exception(): void $buffer = new MemoryBuffer(); $this->expectException(TTransportException::class); - $this->expectExceptionMessage('TMemoryBuffer: Could not read 5 bytes from buffer.'); + $this->expectExceptionMessageIsOrContains('TMemoryBuffer: Could not read 5 bytes from buffer.'); $buffer->read(5); } @@ -203,7 +203,7 @@ public function test_read_from_exhausted_buffer_throws_exception(): void $buffer->read(4); // Exhaust the buffer $this->expectException(TTransportException::class); - $this->expectExceptionMessage('TMemoryBuffer: Could not read 3 bytes from buffer.'); + $this->expectExceptionMessageIsOrContains('TMemoryBuffer: Could not read 3 bytes from buffer.'); $buffer->read(3); } diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Writer/ColumnChunkBuilder/FlatColumnChunkBuilderTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Writer/ColumnChunkBuilder/FlatColumnChunkBuilderTest.php index a5b607f3a2..1d32db1eef 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Writer/ColumnChunkBuilder/FlatColumnChunkBuilderTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Writer/ColumnChunkBuilder/FlatColumnChunkBuilderTest.php @@ -409,7 +409,7 @@ public function test_close_page_with_unsupported_writer_version_throws_exception $builder->addColumn(new WriteFlatColumnValues($column, [0], [1], [42])); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Flow Parquet Writer does not support given version of Parquet format, supported versions are [1,2], given: 3', ); diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Writer/ColumnChunkBuilder/RLEDictionaryChunkBuilderTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Writer/ColumnChunkBuilder/RLEDictionaryChunkBuilderTest.php index 1486d0e885..39d525dcfe 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Writer/ColumnChunkBuilder/RLEDictionaryChunkBuilderTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Writer/ColumnChunkBuilder/RLEDictionaryChunkBuilderTest.php @@ -408,7 +408,7 @@ public function test_close_page_with_unsupported_writer_version_throws_exception $builder->addColumn(new WriteFlatColumnValues($column, [0], [1], ['test'])); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Flow Parquet Writer does not support given version of Parquet format, supported versions are [1,2], given: 3', ); diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Writer/ColumnChunkBuilderFactoryTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Writer/ColumnChunkBuilderFactoryTest.php index 2b6517211b..069595e2b1 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Writer/ColumnChunkBuilderFactoryTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Writer/ColumnChunkBuilderFactoryTest.php @@ -274,7 +274,7 @@ public function test_fallback_to_plain_when_no_custom_encoding_specified(): void public function test_invalid_delta_binary_packed_encoding_for_string_column_throws_exception(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( "DELTA_BINARY_PACKED encoding is only supported for INT32 and INT64 columns. Column 'description' has type: BYTE_ARRAY", ); @@ -295,7 +295,7 @@ public function test_invalid_delta_binary_packed_encoding_for_string_column_thro public function test_invalid_rle_dictionary_encoding_for_fixed_len_byte_array_throws_exception(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( "RLE_DICTIONARY encoding is not supported for FIXED_LEN_BYTE_ARRAY columns under WRITER_VERSION 1. Column 'fixed_data' has type: FIXED_LEN_BYTE_ARRAY", ); @@ -460,7 +460,7 @@ public function test_create_builder_with_custom_delta_length_byte_array_encoding public function test_invalid_delta_byte_array_encoding_for_int64_column_throws_exception(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'DELTA_BYTE_ARRAY encoding is only supported for BYTE_ARRAY and FIXED_LEN_BYTE_ARRAY columns. ' . "Column 'id' has type: INT64", ); @@ -478,7 +478,7 @@ public function test_invalid_delta_byte_array_encoding_for_int64_column_throws_e public function test_invalid_delta_length_byte_array_encoding_for_fixed_len_byte_array_throws_exception(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( "DELTA_LENGTH_BYTE_ARRAY encoding is only supported for BYTE_ARRAY columns. Column 'f' has type: FIXED_LEN_BYTE_ARRAY", ); @@ -557,7 +557,7 @@ public function test_create_builder_with_rle_dictionary_encoding_for_fixed_len_b public function test_invalid_rle_encoding_for_int32_column_throws_exception(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( "RLE encoding is only supported for BOOLEAN columns. Column 'id' has type: INT32", ); diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Writer/ColumnChunkBuildersTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Writer/ColumnChunkBuildersTest.php index a4dc6fcb58..cb6f848de6 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Writer/ColumnChunkBuildersTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Writer/ColumnChunkBuildersTest.php @@ -87,7 +87,7 @@ public function test_a_chunk_without_a_non_null_value_gets_one_empty_block(): vo public function test_a_bloom_filter_option_that_is_not_bloom_filter_options_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Option COLUMNS_BLOOM_FILTERS takes BloomFilterOptions, got float for column "id"', ); diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Writer/ColumnEncodingPolicyTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Writer/ColumnEncodingPolicyTest.php index 3c61fef0d3..bcb808cbea 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Writer/ColumnEncodingPolicyTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Writer/ColumnEncodingPolicyTest.php @@ -131,7 +131,7 @@ public function test_a_requested_encoding_the_column_cannot_take_is_refused( string $message, ): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage($message); + $this->expectExceptionMessageIsOrContains($message); new ColumnEncodingPolicy($writerVersion)->encodingFor($column, $encoding); } diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Writer/ColumnListsTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Writer/ColumnListsTest.php index 90e9482338..27aed2d094 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Writer/ColumnListsTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Writer/ColumnListsTest.php @@ -24,7 +24,9 @@ public function test_no_lists_hold_no_rows(): void public function test_lists_of_different_lengths_are_refused_with_every_length(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('writeColumns() takes lists of one length, got "id": 3, "name": 2, "tags": 3'); + $this->expectExceptionMessageIsOrContains( + 'writeColumns() takes lists of one length, got "id": 3, "name": 2, "tags": 3', + ); new ColumnLists()->length(['id' => [1, 2, 3], 'name' => ['a', 'b'], 'tags' => [[], [], []]]); } diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Writer/PageBuilder/DictionaryBuilderTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Writer/PageBuilder/DictionaryBuilderTest.php index 65aefab70d..6a21c9f568 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Writer/PageBuilder/DictionaryBuilderTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Writer/PageBuilder/DictionaryBuilderTest.php @@ -334,7 +334,7 @@ public function test_unsupported_physical_type_throws_exception(): void $data = new WriteFlatColumnValues($column, values: [1, 2, 3]); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Building dictionary for "INT96" is not supported'); + $this->expectExceptionMessageIsOrContains('Building dictionary for "INT96" is not supported'); $this->builder->build($column, $data); } diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Writer/PageContainersTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Writer/PageContainersTest.php index 1dec58ed94..9f953a7657 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Writer/PageContainersTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Writer/PageContainersTest.php @@ -79,7 +79,7 @@ public function test_add_duplicate_dictionary_page_throws_exception(): void $containers->add($pageContainer1); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Dictionary page container already set'); + $this->expectExceptionMessageIsOrContains('Dictionary page container already set'); $containers->add($pageContainer2); } diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Writer/RowGroupBuilderTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Writer/RowGroupBuilderTest.php index ad5ebeae5e..f6b76819de 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Writer/RowGroupBuilderTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Writer/RowGroupBuilderTest.php @@ -468,7 +468,9 @@ public function test_a_row_group_maximum_rows_count_below_one_is_refused(int $ro $options = new Options()->set(Option::ROW_GROUP_MAXIMUM_ROWS_COUNT, $rows); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('ROW_GROUP_MAXIMUM_ROWS_COUNT must be greater than 0, ' . $rows . ' given'); + $this->expectExceptionMessageIsOrContains( + 'ROW_GROUP_MAXIMUM_ROWS_COUNT must be greater than 0, ' . $rows . ' given', + ); new RowGroupBuilder( Schema::with(FlatColumn::int32('id')), @@ -485,7 +487,9 @@ public function test_a_page_maximum_rows_count_below_one_is_refused(int $rows): $options = new Options()->set(Option::PAGE_MAXIMUM_ROWS_COUNT, $rows); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('PAGE_MAXIMUM_ROWS_COUNT must be greater than 0, ' . $rows . ' given'); + $this->expectExceptionMessageIsOrContains( + 'PAGE_MAXIMUM_ROWS_COUNT must be greater than 0, ' . $rows . ' given', + ); new RowGroupBuilder( Schema::with(FlatColumn::int32('id')), @@ -502,7 +506,7 @@ public function test_a_row_group_size_below_one_byte_is_refused(int $bytes): voi $options = new Options()->set(Option::ROW_GROUP_SIZE_BYTES, $bytes); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('ROW_GROUP_SIZE_BYTES must be greater than 0, ' . $bytes . ' given'); + $this->expectExceptionMessageIsOrContains('ROW_GROUP_SIZE_BYTES must be greater than 0, ' . $bytes . ' given'); new RowGroupBuilder( Schema::with(FlatColumn::int32('id')), diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Writer/StatisticsCounterTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Writer/StatisticsCounterTest.php index 24a70ecc39..85711abcff 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Writer/StatisticsCounterTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Writer/StatisticsCounterTest.php @@ -78,7 +78,7 @@ public function test_counts_values_and_nulls(): void public function test_negative_null_count_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Null count cannot be negative.'); + $this->expectExceptionMessageIsOrContains('Null count cannot be negative.'); StatisticsCounterMother::counted(FlatColumn::int32('c'))->addNulls(-1); } @@ -86,7 +86,7 @@ public function test_negative_null_count_is_refused(): void public function test_an_object_is_not_a_physical_value(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Column "c" statistics take physical values, got stdClass'); + $this->expectExceptionMessageIsOrContains('Column "c" statistics take physical values, got stdClass'); StatisticsCounterMother::counted(FlatColumn::string('c'))->addBatch([new stdClass()]); } @@ -151,7 +151,7 @@ public function test_merge_with_an_empty_counter_keeps_the_bounds(): void public function test_merge_of_different_columns_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Cannot merge statistics for different columns.'); + $this->expectExceptionMessageIsOrContains('Cannot merge statistics for different columns.'); StatisticsCounterMother::counted(FlatColumn::string( 'a', diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Writer/StatisticsOptionsTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Writer/StatisticsOptionsTest.php index cf1e27371c..80581b7b2a 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Writer/StatisticsOptionsTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Writer/StatisticsOptionsTest.php @@ -68,7 +68,7 @@ public function test_each_page_index_is_new_and_truncates_to_the_column_index_le public function test_a_column_index_truncate_length_below_one_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('COLUMN_INDEX_TRUNCATE_LENGTH must be greater than 0, 0 given'); + $this->expectExceptionMessageIsOrContains('COLUMN_INDEX_TRUNCATE_LENGTH must be greater than 0, 0 given'); StatisticsOptions::fromOptions(new Options()->set(Option::COLUMN_INDEX_TRUNCATE_LENGTH, 0)); } diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Writer/StatisticsTruncationTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Writer/StatisticsTruncationTest.php index ff76e4289a..a8ec350362 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Writer/StatisticsTruncationTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Writer/StatisticsTruncationTest.php @@ -132,7 +132,9 @@ public function test_increment_utf8(string $prefix, string $expected): void public function test_a_length_below_one_is_refused(int $length): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('STATISTICS_TRUNCATE_LENGTH must be greater than 0, ' . $length . ' given'); + $this->expectExceptionMessageIsOrContains( + 'STATISTICS_TRUNCATE_LENGTH must be greater than 0, ' . $length . ' given', + ); new StatisticsTruncation($length); } @@ -140,7 +142,7 @@ public function test_a_length_below_one_is_refused(int $length): void public function test_a_refused_length_names_the_option_it_came_from(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('COLUMN_INDEX_TRUNCATE_LENGTH must be greater than 0, 0 given'); + $this->expectExceptionMessageIsOrContains('COLUMN_INDEX_TRUNCATE_LENGTH must be greater than 0, 0 given'); new StatisticsTruncation(0, Option::COLUMN_INDEX_TRUNCATE_LENGTH); } diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Writer/ValueStorage/DeltaBinaryPackedValueStorageTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Writer/ValueStorage/DeltaBinaryPackedValueStorageTest.php index 1c4adb8b5c..930e0d21d5 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Writer/ValueStorage/DeltaBinaryPackedValueStorageTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Writer/ValueStorage/DeltaBinaryPackedValueStorageTest.php @@ -34,7 +34,7 @@ public function test_get_buffer_without_values_is_an_empty_stream_header(): void public function test_rejects_a_non_integer_value(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Delta encoding requires integer values, got string'); + $this->expectExceptionMessageIsOrContains('Delta encoding requires integer values, got string'); new DeltaBinaryPackedValueStorage()->addValues(FlatColumn::int32('c'), ['1']); } @@ -42,7 +42,7 @@ public function test_rejects_a_non_integer_value(): void public function test_rejects_a_non_integer_column(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Delta encoding only supports INT32 and INT64 physical types'); + $this->expectExceptionMessageIsOrContains('Delta encoding only supports INT32 and INT64 physical types'); new DeltaBinaryPackedValueStorage()->addValues(FlatColumn::string('c'), ['a']); } diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Writer/ValueStorage/DeltaByteArrayValueStorageTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Writer/ValueStorage/DeltaByteArrayValueStorageTest.php index f75020034f..e0bc9020a9 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Writer/ValueStorage/DeltaByteArrayValueStorageTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Writer/ValueStorage/DeltaByteArrayValueStorageTest.php @@ -34,7 +34,7 @@ public function test_get_buffer_without_values_is_two_empty_length_streams(): vo public function test_rejects_a_non_byte_array_column(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'DELTA_BYTE_ARRAY encoding only supports BYTE_ARRAY and FIXED_LEN_BYTE_ARRAY physical types', ); @@ -44,7 +44,7 @@ public function test_rejects_a_non_byte_array_column(): void public function test_rejects_a_non_string_value(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('DELTA_BYTE_ARRAY encoding requires string values, got integer'); + $this->expectExceptionMessageIsOrContains('DELTA_BYTE_ARRAY encoding requires string values, got integer'); new DeltaByteArrayValueStorage()->addValues(FlatColumn::string('c'), [1]); } diff --git a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Writer/ValueStorage/DeltaLengthByteArrayValueStorageTest.php b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Writer/ValueStorage/DeltaLengthByteArrayValueStorageTest.php index 47c84a6f26..ce379d6923 100644 --- a/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Writer/ValueStorage/DeltaLengthByteArrayValueStorageTest.php +++ b/src/lib/parquet/tests/Flow/Parquet/Tests/Unit/Writer/ValueStorage/DeltaLengthByteArrayValueStorageTest.php @@ -34,7 +34,9 @@ public function test_get_buffer_without_values_is_an_empty_length_stream(): void public function test_rejects_a_fixed_len_byte_array_column(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('DELTA_LENGTH_BYTE_ARRAY encoding only supports BYTE_ARRAY physical type'); + $this->expectExceptionMessageIsOrContains( + 'DELTA_LENGTH_BYTE_ARRAY encoding only supports BYTE_ARRAY physical type', + ); new DeltaLengthByteArrayValueStorage()->addValues(FlatColumn::fixedSizeByteArray('c', 4), ['abcd']); } @@ -42,7 +44,9 @@ public function test_rejects_a_fixed_len_byte_array_column(): void public function test_rejects_a_non_string_value(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('DELTA_LENGTH_BYTE_ARRAY encoding requires string values, got integer'); + $this->expectExceptionMessageIsOrContains( + 'DELTA_LENGTH_BYTE_ARRAY encoding requires string values, got integer', + ); new DeltaLengthByteArrayValueStorage()->addValues(FlatColumn::string('c'), [1]); } diff --git a/src/lib/postgresql/tests/Flow/PostgreSql/Migrations/Tests/Unit/Generator/DiffMigrationGeneratorTest.php b/src/lib/postgresql/tests/Flow/PostgreSql/Migrations/Tests/Unit/Generator/DiffMigrationGeneratorTest.php index 2e00ef6a0f..ec22eb975b 100644 --- a/src/lib/postgresql/tests/Flow/PostgreSql/Migrations/Tests/Unit/Generator/DiffMigrationGeneratorTest.php +++ b/src/lib/postgresql/tests/Flow/PostgreSql/Migrations/Tests/Unit/Generator/DiffMigrationGeneratorTest.php @@ -204,7 +204,7 @@ public function test_throws_when_no_changes_detected_and_allow_empty_is_false(): ); $this->expectException(MigrationException::class); - $this->expectExceptionMessage('No changes detected'); + $this->expectExceptionMessageIsOrContains('No changes detected'); $diffGenerator->generate('empty_migration'); } diff --git a/src/lib/postgresql/tests/Flow/PostgreSql/Migrations/Tests/Unit/MigrationContextTest.php b/src/lib/postgresql/tests/Flow/PostgreSql/Migrations/Tests/Unit/MigrationContextTest.php index 39504c11a2..d61d23ff57 100644 --- a/src/lib/postgresql/tests/Flow/PostgreSql/Migrations/Tests/Unit/MigrationContextTest.php +++ b/src/lib/postgresql/tests/Flow/PostgreSql/Migrations/Tests/Unit/MigrationContextTest.php @@ -25,7 +25,7 @@ public function test_attribute_throws_when_missing(): void $context = new MigrationContext(new SpyClient()); $this->expectException(MigrationException::class); - $this->expectExceptionMessage('Migration context attribute "missing" not found.'); + $this->expectExceptionMessageIsOrContains('Migration context attribute "missing" not found.'); $context->attribute('missing'); } diff --git a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Integration/Client/PgSqlClientTest.php b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Integration/Client/PgSqlClientTest.php index 65d606393d..b0d70ad680 100644 --- a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Integration/Client/PgSqlClientTest.php +++ b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Integration/Client/PgSqlClientTest.php @@ -230,7 +230,7 @@ public function test_fetch_one_returns_single_row(): void public function test_fetch_one_throws_when_multiple_rows(): void { $this->expectException(TooManyRowsException::class); - $this->expectExceptionMessage('Expected at most one row, but 3 were returned'); + $this->expectExceptionMessageIsOrContains('Expected at most one row, but 3 were returned'); $this ->pgsqlContext() @@ -346,7 +346,7 @@ public function test_fetch_single_into_maps_to_object(): void public function test_fetch_single_into_throws_when_no_rows(): void { $this->expectException(NoResultException::class); - $this->expectExceptionMessage('Expected at least one row, but none were returned'); + $this->expectExceptionMessageIsOrContains('Expected at least one row, but none were returned'); $this ->pgsqlContext() @@ -373,7 +373,7 @@ public function test_fetch_single_returns_exactly_one_row(): void public function test_fetch_single_throws_when_multiple_rows(): void { $this->expectException(TooManyRowsException::class); - $this->expectExceptionMessage('Expected at most one row, but 3 were returned'); + $this->expectExceptionMessageIsOrContains('Expected at most one row, but 3 were returned'); $this ->pgsqlContext() @@ -384,7 +384,7 @@ public function test_fetch_single_throws_when_multiple_rows(): void public function test_fetch_single_throws_when_no_rows(): void { $this->expectException(NoResultException::class); - $this->expectExceptionMessage('Expected at least one row, but none were returned'); + $this->expectExceptionMessageIsOrContains('Expected at least one row, but none were returned'); $this ->pgsqlContext() @@ -431,7 +431,7 @@ public function test_last_insert_id_throws_when_sequence_not_used(): void $this->pgsqlContext()->client()->execute(create()->temporarySequence('test_unused_seq')); $this->expectException(QueryException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Query execution failed [55000]: Object not in prerequisite state. SQL: SELECT currval($1)', ); diff --git a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Integration/Client/TransactionTest.php b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Integration/Client/TransactionTest.php index 8dfd3e8cf9..1a5edac8a9 100644 --- a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Integration/Client/TransactionTest.php +++ b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Integration/Client/TransactionTest.php @@ -93,7 +93,7 @@ public function test_auto_commit_disabled_starts_transaction(): void public function test_commit_without_transaction_throws(): void { $this->expectException(TransactionException::class); - $this->expectExceptionMessage('no active transaction'); + $this->expectExceptionMessageIsOrContains('no active transaction'); $this->pgsqlContext()->client()->commit(); } @@ -299,7 +299,7 @@ public function test_nesting_level_tracking(): void public function test_rollback_without_transaction_throws(): void { $this->expectException(TransactionException::class); - $this->expectExceptionMessage('no active transaction'); + $this->expectExceptionMessageIsOrContains('no active transaction'); $this->pgsqlContext()->client()->rollBack(); } diff --git a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/AST/Nodes/FromTest.php b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/AST/Nodes/FromTest.php index 7b04bb2334..78db90a7f0 100644 --- a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/AST/Nodes/FromTest.php +++ b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/AST/Nodes/FromTest.php @@ -208,7 +208,7 @@ public function test_throws_exception_for_invalid_node(): void $invalidNode = new Node(); $this->expectException(InvalidFromNodeException::class); - $this->expectExceptionMessage('Invalid FROM clause node type'); + $this->expectExceptionMessageIsOrContains('Invalid FROM clause node type'); new From([$invalidNode]); } diff --git a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/AST/Nodes/StatementsTest.php b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/AST/Nodes/StatementsTest.php index 97b5d6cb55..678337f5fb 100644 --- a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/AST/Nodes/StatementsTest.php +++ b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/AST/Nodes/StatementsTest.php @@ -60,7 +60,7 @@ protected function setUp(): void public function test_assert_read_only_select_refuses_a_select_that_writes(string $sql): void { $this->expectException(InvalidStatementException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Expected a read-only SELECT - the query holds a data-modifying WITH or SELECT ... INTO', ); @@ -71,7 +71,7 @@ public function test_assert_read_only_select_refuses_a_select_that_writes(string public function test_assert_read_only_select_refuses_anything_but_one_select(string $sql): void { $this->expectException(InvalidStatementException::class); - $this->expectExceptionMessage('Expected exactly one SELECT or VALUES statement'); + $this->expectExceptionMessageIsOrContains('Expected exactly one SELECT or VALUES statement'); sql_parse($sql)->statements()->assertReadOnlySelect(); } diff --git a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/AST/Transformers/CountModifierEdgeCasesTest.php b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/AST/Transformers/CountModifierEdgeCasesTest.php index c5c8c348ff..6b8003a4f4 100644 --- a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/AST/Transformers/CountModifierEdgeCasesTest.php +++ b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/AST/Transformers/CountModifierEdgeCasesTest.php @@ -25,7 +25,7 @@ protected function setUp(): void public function test_a_statement_without_a_select_is_refused(): void { $this->expectException(InvalidStatementException::class); - $this->expectExceptionMessage('Expected exactly one SELECT or VALUES statement'); + $this->expectExceptionMessageIsOrContains('Expected exactly one SELECT or VALUES statement'); sql_to_count_query('UPDATE users SET active = true RETURNING id'); } diff --git a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/AST/Transformers/ExplainConfigTest.php b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/AST/Transformers/ExplainConfigTest.php index 276d109b73..2c352ab91e 100644 --- a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/AST/Transformers/ExplainConfigTest.php +++ b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/AST/Transformers/ExplainConfigTest.php @@ -32,7 +32,7 @@ public function test_chaining_fluent_methods(): void public function test_constructor_throws_when_buffers_enabled_without_analyze(): void { $this->expectException(InvalidExplainConfigException::class); - $this->expectExceptionMessage('BUFFERS option requires ANALYZE to be enabled'); + $this->expectExceptionMessageIsOrContains('BUFFERS option requires ANALYZE to be enabled'); new ExplainConfig(analyze: false, buffers: true); } @@ -40,7 +40,7 @@ public function test_constructor_throws_when_buffers_enabled_without_analyze(): public function test_constructor_throws_when_timing_enabled_without_analyze(): void { $this->expectException(InvalidExplainConfigException::class); - $this->expectExceptionMessage('TIMING option requires ANALYZE to be enabled'); + $this->expectExceptionMessageIsOrContains('TIMING option requires ANALYZE to be enabled'); new ExplainConfig(analyze: false, buffers: false, timing: true); } @@ -48,7 +48,7 @@ public function test_constructor_throws_when_timing_enabled_without_analyze(): v public function test_constructor_throws_when_wal_enabled_without_analyze(): void { $this->expectException(InvalidExplainConfigException::class); - $this->expectExceptionMessage('WAL option requires ANALYZE to be enabled'); + $this->expectExceptionMessageIsOrContains('WAL option requires ANALYZE to be enabled'); new ExplainConfig(analyze: false, buffers: false, timing: false, wal: true); } @@ -203,7 +203,7 @@ public function test_from_array_validates_config(): void ]; $this->expectException(InvalidExplainConfigException::class); - $this->expectExceptionMessage('BUFFERS option requires ANALYZE to be enabled'); + $this->expectExceptionMessageIsOrContains('BUFFERS option requires ANALYZE to be enabled'); ExplainConfig::fromArray($data); } @@ -277,7 +277,7 @@ public function test_with_buffers_requires_analyze(): void $config = ExplainConfig::forEstimate(); $this->expectException(InvalidExplainConfigException::class); - $this->expectExceptionMessage('BUFFERS option requires ANALYZE to be enabled'); + $this->expectExceptionMessageIsOrContains('BUFFERS option requires ANALYZE to be enabled'); $config->withBuffers(); } @@ -341,7 +341,7 @@ public function test_with_timing_requires_analyze(): void $config = ExplainConfig::forEstimate(); $this->expectException(InvalidExplainConfigException::class); - $this->expectExceptionMessage('TIMING option requires ANALYZE to be enabled'); + $this->expectExceptionMessageIsOrContains('TIMING option requires ANALYZE to be enabled'); $config->withTiming(); } @@ -369,7 +369,7 @@ public function test_with_wal_requires_analyze(): void $config = ExplainConfig::forEstimate(); $this->expectException(InvalidExplainConfigException::class); - $this->expectExceptionMessage('WAL option requires ANALYZE to be enabled'); + $this->expectExceptionMessageIsOrContains('WAL option requires ANALYZE to be enabled'); $config->withWal(); } diff --git a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/AST/Transformers/ExplainModifierTest.php b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/AST/Transformers/ExplainModifierTest.php index a12b516320..1d85ac38d7 100644 --- a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/AST/Transformers/ExplainModifierTest.php +++ b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/AST/Transformers/ExplainModifierTest.php @@ -108,7 +108,7 @@ public function test_custom_config(): void public function test_rejects_non_explainable_statement(string $sql, string $statement): void { $this->expectException(InvalidStatementException::class); - $this->expectExceptionMessage(sprintf('EXPLAIN cannot explain a "%s" statement', $statement)); + $this->expectExceptionMessageIsOrContains(sprintf('EXPLAIN cannot explain a "%s" statement', $statement)); sql_to_explain($sql); } diff --git a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/AST/Transformers/KeysetPaginationConfigTest.php b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/AST/Transformers/KeysetPaginationConfigTest.php index f503b11652..d2491e8165 100644 --- a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/AST/Transformers/KeysetPaginationConfigTest.php +++ b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/AST/Transformers/KeysetPaginationConfigTest.php @@ -16,7 +16,7 @@ final class KeysetPaginationConfigTest extends TestCase public function test_null_cursor_value_is_rejected(): void { $this->expectException(PaginationException::class); - $this->expectExceptionMessage('Keyset cursor value #2 is NULL; key columns must be non-null'); + $this->expectExceptionMessageIsOrContains('Keyset cursor value #2 is NULL; key columns must be non-null'); new KeysetPaginationConfig( 10, diff --git a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/AST/Transformers/KeysetPaginationEdgeCasesTest.php b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/AST/Transformers/KeysetPaginationEdgeCasesTest.php index 820ca4eb54..f467d58076 100644 --- a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/AST/Transformers/KeysetPaginationEdgeCasesTest.php +++ b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/AST/Transformers/KeysetPaginationEdgeCasesTest.php @@ -26,7 +26,7 @@ protected function setUp(): void public function test_a_statement_without_a_select_is_refused(): void { $this->expectException(InvalidStatementException::class); - $this->expectExceptionMessage('Expected exactly one SELECT or VALUES statement'); + $this->expectExceptionMessageIsOrContains('Expected exactly one SELECT or VALUES statement'); sql_to_keyset_query('UPDATE users SET active = true RETURNING id', 10, [sql_keyset_column( 'id', diff --git a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/AST/Transformers/KeysetPaginationModifierTest.php b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/AST/Transformers/KeysetPaginationModifierTest.php index 19df61f6a8..6c7c6719cc 100644 --- a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/AST/Transformers/KeysetPaginationModifierTest.php +++ b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/AST/Transformers/KeysetPaginationModifierTest.php @@ -324,7 +324,7 @@ public function test_set_operation_is_wrapped_with_cursor(): void public function test_set_operation_rejects_qualified_keyset_column(): void { $this->expectException(PaginationException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Keyset column "t.id" is qualified; a UNION/INTERSECT/EXCEPT result exposes only unqualified column names', ); @@ -349,7 +349,7 @@ public function test_set_operation_without_order_by_orders_by_keyset(): void public function test_throws_when_cursor_count_mismatch(): void { $this->expectException(PaginationException::class); - $this->expectExceptionMessage('Cursor values count (1) must match columns count (2)'); + $this->expectExceptionMessageIsOrContains('Cursor values count (1) must match columns count (2)'); $parsed = sql_parse('SELECT * FROM users ORDER BY created_at, id'); @@ -369,7 +369,7 @@ public function test_throws_when_cursor_count_mismatch(): void public function test_throws_when_no_columns(): void { $this->expectException(PaginationException::class); - $this->expectExceptionMessage('Keyset pagination requires at least one column'); + $this->expectExceptionMessageIsOrContains('Keyset pagination requires at least one column'); $parsed = sql_parse('SELECT * FROM users ORDER BY id'); @@ -390,7 +390,7 @@ public function test_all_desc_composite_key_uses_row_comparison(): void public function test_order_by_not_matching_keys_is_rejected(): void { $this->expectException(PaginationException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Keyset pagination requires ORDER BY item #1 to be the key "id ASC" with no NULLS clause, ordinal, expression or USING', ); @@ -400,7 +400,7 @@ public function test_order_by_not_matching_keys_is_rejected(): void public function test_query_limit_is_rejected(): void { $this->expectException(PaginationException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Keyset pagination sets its own LIMIT; remove LIMIT and OFFSET from the query and pass the page size as the limit', ); @@ -410,7 +410,7 @@ public function test_query_limit_is_rejected(): void public function test_query_offset_is_rejected(): void { $this->expectException(PaginationException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Keyset pagination sets its own LIMIT; remove LIMIT and OFFSET from the query and pass the page size as the limit', ); @@ -420,7 +420,7 @@ public function test_query_offset_is_rejected(): void public function test_set_operation_limit_is_rejected(): void { $this->expectException(PaginationException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Keyset pagination sets its own LIMIT; remove LIMIT and OFFSET from the query and pass the page size as the limit', ); @@ -432,7 +432,7 @@ public function test_set_operation_limit_is_rejected(): void public function test_set_operation_offset_is_rejected(): void { $this->expectException(PaginationException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Keyset pagination sets its own LIMIT; remove LIMIT and OFFSET from the query and pass the page size as the limit', ); diff --git a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/AST/Transformers/KeysetSortClauseTest.php b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/AST/Transformers/KeysetSortClauseTest.php index 0fe047885f..cf2c518e1b 100644 --- a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/AST/Transformers/KeysetSortClauseTest.php +++ b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/AST/Transformers/KeysetSortClauseTest.php @@ -121,7 +121,7 @@ public function test_order_by_different_from_the_keys_is_rejected( string $message, ): void { $this->expectException(PaginationException::class); - $this->expectExceptionMessage($message); + $this->expectExceptionMessageIsOrContains($message); new KeysetSortClause($columns)->assertMatches( sql_parse($sql)->statements()->assertReadOnlySelect()->raw()->getSortClause(), diff --git a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/AST/Transformers/LimitedQueryTest.php b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/AST/Transformers/LimitedQueryTest.php index 3f707843ee..732d01461e 100644 --- a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/AST/Transformers/LimitedQueryTest.php +++ b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/AST/Transformers/LimitedQueryTest.php @@ -24,7 +24,7 @@ protected function setUp(): void public function test_a_statement_without_a_select_is_refused(): void { $this->expectException(InvalidStatementException::class); - $this->expectExceptionMessage('Expected exactly one SELECT or VALUES statement'); + $this->expectExceptionMessageIsOrContains('Expected exactly one SELECT or VALUES statement'); sql_to_limited_query('UPDATE users SET active = true RETURNING id', 10); } diff --git a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/AST/Transformers/OffsetPaginationEdgeCasesTest.php b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/AST/Transformers/OffsetPaginationEdgeCasesTest.php index ca44ade6fd..ee96a5105b 100644 --- a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/AST/Transformers/OffsetPaginationEdgeCasesTest.php +++ b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/AST/Transformers/OffsetPaginationEdgeCasesTest.php @@ -24,7 +24,7 @@ protected function setUp(): void public function test_a_statement_without_a_select_is_refused(): void { $this->expectException(InvalidStatementException::class); - $this->expectExceptionMessage('Expected exactly one SELECT or VALUES statement'); + $this->expectExceptionMessageIsOrContains('Expected exactly one SELECT or VALUES statement'); sql_to_paginated_query('UPDATE users SET active = true RETURNING id', 10); } diff --git a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/AST/Transformers/OffsetPaginationModifierTest.php b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/AST/Transformers/OffsetPaginationModifierTest.php index be7bdd05a2..4a66d06004 100644 --- a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/AST/Transformers/OffsetPaginationModifierTest.php +++ b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/AST/Transformers/OffsetPaginationModifierTest.php @@ -227,7 +227,7 @@ public function test_a_query_that_is_not_one_read_only_select_is_refused(string public function test_offset_parameter_without_order_by_throws_exception(): void { $this->expectException(PaginationException::class); - $this->expectExceptionMessage('OFFSET without ORDER BY produces non-deterministic results'); + $this->expectExceptionMessageIsOrContains('OFFSET without ORDER BY produces non-deterministic results'); sql_parse('SELECT * FROM users')->traverse(new OffsetPaginationModifier( new OffsetPaginationConfig(param(1), param(2)), @@ -237,7 +237,7 @@ public function test_offset_parameter_without_order_by_throws_exception(): void public function test_offset_without_order_by_throws_exception(): void { $this->expectException(PaginationException::class); - $this->expectExceptionMessage('OFFSET without ORDER BY produces non-deterministic results'); + $this->expectExceptionMessageIsOrContains('OFFSET without ORDER BY produces non-deterministic results'); $parsed = sql_parse('SELECT * FROM users'); $parsed->traverse(new OffsetPaginationModifier(new OffsetPaginationConfig(10, 5))); diff --git a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/AST/TraverserTest.php b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/AST/TraverserTest.php index 500f7220f2..9f32922cd9 100644 --- a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/AST/TraverserTest.php +++ b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/AST/TraverserTest.php @@ -327,7 +327,9 @@ public function modify(object $node, ModificationContext $context): ?Node }; $this->expectException(ParserException::class); - $this->expectExceptionMessage(Node::class . ' cannot replace a node in ' . SelectStmt::class . '::Larg'); + $this->expectExceptionMessageIsOrContains( + Node::class . ' cannot replace a node in ' . SelectStmt::class . '::Larg', + ); sql_parse('SELECT 1 UNION SELECT 2')->traverse($modifier); } diff --git a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/Client/ConnectionParametersTest.php b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/Client/ConnectionParametersTest.php index 77390dec24..510cf43887 100644 --- a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/Client/ConnectionParametersTest.php +++ b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/Client/ConnectionParametersTest.php @@ -198,7 +198,7 @@ public function test_from_string_removes_backslash_escapes_from_unquoted_value() public function test_from_string_throws_exception_when_dbname_missing(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Missing dbname in connection string'); + $this->expectExceptionMessageIsOrContains('Missing dbname in connection string'); ConnectionParameters::fromString('host=localhost port=5432'); } @@ -206,7 +206,7 @@ public function test_from_string_throws_exception_when_dbname_missing(): void public function test_from_string_throws_when_equal_sign_is_missing(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Missing "=" after "port" in connection string'); + $this->expectExceptionMessageIsOrContains('Missing "=" after "port" in connection string'); pgsql_connection('dbname=app port'); } @@ -214,7 +214,7 @@ public function test_from_string_throws_when_equal_sign_is_missing(): void public function test_from_string_throws_when_quoted_value_ends_with_backslash(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Unterminated quoted value in connection string'); + $this->expectExceptionMessageIsOrContains('Unterminated quoted value in connection string'); pgsql_connection("dbname='app\\"); } @@ -222,7 +222,7 @@ public function test_from_string_throws_when_quoted_value_ends_with_backslash(): public function test_from_string_throws_when_quoted_value_is_not_terminated(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Unterminated quoted value in connection string'); + $this->expectExceptionMessageIsOrContains('Unterminated quoted value in connection string'); pgsql_connection("dbname='app"); } @@ -472,7 +472,7 @@ public function test_with_session_settings_keeps_other_options(): void public function test_with_session_settings_rejects_invalid_name(string $name): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage(sprintf('Session setting name "%s" is invalid.', $name)); + $this->expectExceptionMessageIsOrContains(sprintf('Session setting name "%s" is invalid.', $name)); pgsql_connection_params(database: 'app')->withSessionSettings([$name => '1']); } diff --git a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/Client/ContextTest.php b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/Client/ContextTest.php index 24b687a752..1a100d939f 100644 --- a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/Client/ContextTest.php +++ b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/Client/ContextTest.php @@ -49,7 +49,7 @@ public function test_get_returns_asserted_value(): void public function test_get_throws_for_missing_key(): void { $this->expectException(ContextException::class); - $this->expectExceptionMessage('Context has no value for key "missing".'); + $this->expectExceptionMessageIsOrContains('Context has no value for key "missing".'); new Context()->get('missing', type_string()); } diff --git a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/Client/DsnParserTest.php b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/Client/DsnParserTest.php index ed14840462..2b9307ceed 100644 --- a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/Client/DsnParserTest.php +++ b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/Client/DsnParserTest.php @@ -156,7 +156,7 @@ public function test_parse_postgresql_scheme(): void public function test_throws_on_missing_database(): void { $this->expectException(DsnParserException::class); - $this->expectExceptionMessage('must specify a database name'); + $this->expectExceptionMessageIsOrContains('must specify a database name'); $this->parser->parse('postgres://localhost/'); } @@ -164,7 +164,7 @@ public function test_throws_on_missing_database(): void public function test_throws_on_missing_database_without_slash(): void { $this->expectException(DsnParserException::class); - $this->expectExceptionMessage('must specify a database name'); + $this->expectExceptionMessageIsOrContains('must specify a database name'); $this->parser->parse('postgres://localhost'); } @@ -172,7 +172,7 @@ public function test_throws_on_missing_database_without_slash(): void public function test_throws_on_unsupported_scheme(): void { $this->expectException(DsnParserException::class); - $this->expectExceptionMessage('Unsupported DSN scheme'); + $this->expectExceptionMessageIsOrContains('Unsupported DSN scheme'); $this->parser->parse('mysql://localhost/testdb'); } diff --git a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/Client/RowMapper/ConstructorMapperTest.php b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/Client/RowMapper/ConstructorMapperTest.php index c6b84d4579..444f6833ea 100644 --- a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/Client/RowMapper/ConstructorMapperTest.php +++ b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/Client/RowMapper/ConstructorMapperTest.php @@ -256,7 +256,7 @@ public function test_maps_uuid_type(): void public function test_throws_for_class_without_constructor(): void { $this->expectException(MappingException::class); - $this->expectExceptionMessage('Class has no constructor'); + $this->expectExceptionMessageIsOrContains('Class has no constructor'); new ConstructorMapper(NoConstructorDto::class); } @@ -268,7 +268,7 @@ public function test_throws_for_missing_required_parameter(): void ]; $this->expectException(MappingException::class); - $this->expectExceptionMessage('Property "name" not found'); + $this->expectExceptionMessageIsOrContains('Property "name" not found'); new ConstructorMapper(SimpleDto::class)->map($row, MapperContextMother::any()); } diff --git a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/Client/RowMapper/StaticFactoryMapperTest.php b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/Client/RowMapper/StaticFactoryMapperTest.php index 2626fad325..f06be16a04 100644 --- a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/Client/RowMapper/StaticFactoryMapperTest.php +++ b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/Client/RowMapper/StaticFactoryMapperTest.php @@ -100,7 +100,7 @@ public function test_throws_when_class_does_not_exist(): void $nonExistent = 'Flow\\PostgreSql\\Tests\\Unit\\Client\\RowMapper\\Fake\\NonExistentDto'; $this->expectException(MappingException::class); - $this->expectExceptionMessage('Class does not exist'); + $this->expectExceptionMessageIsOrContains('Class does not exist'); new StaticFactoryMapper($nonExistent, 'fromRow'); } @@ -108,7 +108,7 @@ public function test_throws_when_class_does_not_exist(): void public function test_throws_when_factory_method_does_not_exist(): void { $this->expectException(MappingException::class); - $this->expectExceptionMessage(sprintf( + $this->expectExceptionMessageIsOrContains(sprintf( 'Static factory method "%s::missing()" does not exist', SimpleFactoryDto::class, )); @@ -119,7 +119,7 @@ public function test_throws_when_factory_method_does_not_exist(): void public function test_throws_when_factory_method_is_not_public(): void { $this->expectException(MappingException::class); - $this->expectExceptionMessage(sprintf( + $this->expectExceptionMessageIsOrContains(sprintf( 'Factory method "%s::_fromRow()" must be declared public', PrivateFactoryDto::class, )); @@ -130,7 +130,7 @@ public function test_throws_when_factory_method_is_not_public(): void public function test_throws_when_factory_method_is_not_static(): void { $this->expectException(MappingException::class); - $this->expectExceptionMessage(sprintf( + $this->expectExceptionMessageIsOrContains(sprintf( 'Factory method "%s::fromRow()" must be declared static', NonStaticFactoryDto::class, )); diff --git a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/Client/RowMapper/TypeMapperTest.php b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/Client/RowMapper/TypeMapperTest.php index 35940c4a83..04674099a2 100644 --- a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/Client/RowMapper/TypeMapperTest.php +++ b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/Client/RowMapper/TypeMapperTest.php @@ -262,7 +262,7 @@ public function test_chaining_is_skipped_when_cast_fails(): void public function test_invalid_mapping(array $data, Type $type): void { $this->expectException(MappingException::class); - $this->expectExceptionMessage('Failed to map database row to type:'); + $this->expectExceptionMessageIsOrContains('Failed to map database row to type:'); type_mapper($type)->map($data, MapperContextMother::any()); } diff --git a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/Client/Telemetry/TraceableClientTest.php b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/Client/Telemetry/TraceableClientTest.php index 3b97839eec..a1666d1373 100644 --- a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/Client/Telemetry/TraceableClientTest.php +++ b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/Client/Telemetry/TraceableClientTest.php @@ -188,7 +188,7 @@ public function test_execute_rethrows_exception_and_records_error(): void $client = traceable_postgresql_client($mockClient, $config); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Query failed'); + $this->expectExceptionMessageIsOrContains('Query failed'); try { $client->execute('UPDATE users SET active = $1', [true]); @@ -209,7 +209,7 @@ public function test_commit_rethrows_exception_and_records_error(): void $mockClient->method('commit')->willThrowException(new RuntimeException('Commit failed')); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Commit failed'); + $this->expectExceptionMessageIsOrContains('Commit failed'); traceable_postgresql_client($mockClient, $config)->commit(); } @@ -222,7 +222,7 @@ public function test_roll_back_rethrows_exception_and_records_error(): void $mockClient->method('rollBack')->willThrowException(new RuntimeException('Rollback failed')); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Rollback failed'); + $this->expectExceptionMessageIsOrContains('Rollback failed'); traceable_postgresql_client($mockClient, $config)->rollBack(); } diff --git a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/Client/Telemetry/TraceableCursorTest.php b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/Client/Telemetry/TraceableCursorTest.php index 9d02a6a861..7adfd10c3e 100644 --- a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/Client/Telemetry/TraceableCursorTest.php +++ b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/Client/Telemetry/TraceableCursorTest.php @@ -83,7 +83,7 @@ public function test_free_rethrows_exception_and_records_error(): void $cursor = new TraceableCursor($mockCursor, $config, $this->connectionParams(), 'SELECT * FROM users'); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Free failed'); + $this->expectExceptionMessageIsOrContains('Free failed'); try { $cursor->free(); diff --git a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/Client/Types/ArrayLiteralParserTest.php b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/Client/Types/ArrayLiteralParserTest.php index 9ddf82af5c..bf2bb48ea9 100644 --- a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/Client/Types/ArrayLiteralParserTest.php +++ b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/Client/Types/ArrayLiteralParserTest.php @@ -53,7 +53,7 @@ public static function provide_well_formed_literals(): Generator public function test_a_malformed_literal_is_refused(string $literal, string $reason): void { $this->expectException(ValueConversionException::class); - $this->expectExceptionMessage($reason); + $this->expectExceptionMessageIsOrContains($reason); new ArrayLiteralParser()->parse($literal); } diff --git a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/ParserTest.php b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/ParserTest.php index 7e4384fb18..1c6f2600b5 100644 --- a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/ParserTest.php +++ b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/ParserTest.php @@ -350,7 +350,7 @@ public function test_parse_invalid_sql_throws_exception(): void $parser = sql_parser(); $this->expectException(ParserException::class); - $this->expectExceptionMessage('syntax error'); + $this->expectExceptionMessageIsOrContains('syntax error'); $parser->parse('SELECT FROM WHERE'); } diff --git a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Clause/CTETest.php b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Clause/CTETest.php index e96a646e58..623778ff6a 100644 --- a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Clause/CTETest.php +++ b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Clause/CTETest.php @@ -150,7 +150,7 @@ public function test_cte_with_update_body(): void public function test_cycle_requires_at_least_one_column(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('CYCLE needs at least one column'); + $this->expectExceptionMessageIsOrContains('CYCLE needs at least one column'); cte('t', select(star())->from(table('users')))->cycle([], 'is_cycle', 'path'); } @@ -160,7 +160,7 @@ public function test_cycle_requires_at_least_one_column(): void public function test_cycle_requires_both_mark_value_and_mark_default_or_neither(bool $withMarkValue): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('CYCLE needs both a mark value and a mark default, or neither'); + $this->expectExceptionMessageIsOrContains('CYCLE needs both a mark value and a mark default, or neither'); cte('t', select(star())->from(table('users')))->cycle( ['id'], @@ -264,7 +264,7 @@ public function test_search_depth_first_sets_search_clause(): void public function test_search_requires_at_least_one_column(bool $breadthFirst): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('SEARCH needs at least one column'); + $this->expectExceptionMessageIsOrContains('SEARCH needs at least one column'); $cte = cte('t', select(star())->from(table('users'))); diff --git a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Clause/ReturningClauseTest.php b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Clause/ReturningClauseTest.php index 38270fadd5..67d9b200d3 100644 --- a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Clause/ReturningClauseTest.php +++ b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Clause/ReturningClauseTest.php @@ -19,7 +19,7 @@ final class ReturningClauseTest extends TestCase public function test_aliases_without_alias_throws(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('returningAliases() needs an old or a new alias'); + $this->expectExceptionMessageIsOrContains('returningAliases() needs an old or a new alias'); new ReturningClause()->aliases(null, null); } @@ -27,7 +27,7 @@ public function test_aliases_without_alias_throws(): void public function test_aliases_without_expressions_throw_at_to_ast(): void { $this->expectException(InvalidBuilderStateException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'RETURNING WITH (OLD AS o, NEW AS n) needs a RETURNING list. Call returning() or returningAll() after returningAliases().', ); @@ -55,7 +55,7 @@ public function test_from_ast_reads_expressions_and_aliases(): void public function test_returning_without_expressions_throws(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'returning() needs at least one expression. Call returningAll() for RETURNING *.', ); diff --git a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Condition/AndConditionTest.php b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Condition/AndConditionTest.php index 1f12ebd578..82a15eb5f7 100644 --- a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Condition/AndConditionTest.php +++ b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Condition/AndConditionTest.php @@ -175,7 +175,7 @@ public function test_from_ast_reconstructs_and_condition(): void public function test_from_ast_throws_on_non_bool_expr(): void { $this->expectException(InvalidAstException::class); - $this->expectExceptionMessage('Expected BoolExpr node, got unknown'); + $this->expectExceptionMessageIsOrContains('Expected BoolExpr node, got unknown'); $node = new Node(); AndCondition::fromAst($node); @@ -184,7 +184,7 @@ public function test_from_ast_throws_on_non_bool_expr(): void public function test_from_ast_throws_on_wrong_bool_type(): void { $this->expectException(InvalidAstException::class); - $this->expectExceptionMessage('Expected BoolExpr with AND_EXPR'); + $this->expectExceptionMessageIsOrContains('Expected BoolExpr with AND_EXPR'); $boolExpr = new BoolExpr(); $boolExpr->setBoolop(BoolExprType::OR_EXPR); diff --git a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Condition/BetweenTest.php b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Condition/BetweenTest.php index 006a2a3bda..fe67113292 100644 --- a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Condition/BetweenTest.php +++ b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Condition/BetweenTest.php @@ -155,7 +155,7 @@ public function test_from_ast_reconstructs_symmetric_between(): void public function test_from_ast_throws_on_non_a_expr(): void { $this->expectException(InvalidAstException::class); - $this->expectExceptionMessage('Expected A_Expr node, got unknown'); + $this->expectExceptionMessageIsOrContains('Expected A_Expr node, got unknown'); $node = new Node(); Between::fromAst($node); @@ -164,7 +164,7 @@ public function test_from_ast_throws_on_non_a_expr(): void public function test_from_ast_throws_on_wrong_kind(): void { $this->expectException(InvalidAstException::class); - $this->expectExceptionMessage('Expected BETWEEN variant for Between condition'); + $this->expectExceptionMessageIsOrContains('Expected BETWEEN variant for Between condition'); $aExpr = new A_Expr(); $aExpr->setKind(A_Expr_Kind::AEXPR_OP); diff --git a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Condition/ComparisonTest.php b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Condition/ComparisonTest.php index 87dbf48bf0..84de0291cd 100644 --- a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Condition/ComparisonTest.php +++ b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Condition/ComparisonTest.php @@ -173,7 +173,7 @@ public function test_from_ast_reconstructs_comparison(): void public function test_from_ast_throws_on_non_a_expr(): void { $this->expectException(InvalidAstException::class); - $this->expectExceptionMessage('Expected A_Expr node, got unknown'); + $this->expectExceptionMessageIsOrContains('Expected A_Expr node, got unknown'); $node = new Node(); Comparison::fromAst($node); @@ -182,7 +182,7 @@ public function test_from_ast_throws_on_non_a_expr(): void public function test_from_ast_throws_on_wrong_kind(): void { $this->expectException(InvalidAstException::class); - $this->expectExceptionMessage('Expected AEXPR_OP for Comparison'); + $this->expectExceptionMessageIsOrContains('Expected AEXPR_OP for Comparison'); $aExpr = new A_Expr(); $aExpr->setKind(A_Expr_Kind::AEXPR_IN); diff --git a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Condition/ConditionFactoryTest.php b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Condition/ConditionFactoryTest.php index dd9a948f4d..98ee1f567e 100644 --- a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Condition/ConditionFactoryTest.php +++ b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Condition/ConditionFactoryTest.php @@ -55,7 +55,7 @@ public static function top_level_nodes(): Generator public function test_from_ast_names_unsupported_a_expr_kind(): void { $this->expectException(UnsupportedNodeException::class); - $this->expectExceptionMessage('Unsupported node type: A_Expr kind: AEXPR_NULLIF'); + $this->expectExceptionMessageIsOrContains('Unsupported node type: A_Expr kind: AEXPR_NULLIF'); ConditionFactory::fromAst(new ExpressionParser()->parse('NULLIF(a, b)')); } @@ -63,7 +63,7 @@ public function test_from_ast_names_unsupported_a_expr_kind(): void public function test_from_ast_names_unsupported_bool_expr_type(): void { $this->expectException(UnsupportedNodeException::class); - $this->expectExceptionMessage('Unsupported node type: BoolExpr type: BOOL_EXPR_TYPE_UNDEFINED'); + $this->expectExceptionMessageIsOrContains('Unsupported node type: BoolExpr type: BOOL_EXPR_TYPE_UNDEFINED'); ConditionFactory::fromAst(new Node(['bool_expr' => new BoolExpr([ 'boolop' => BoolExprType::BOOL_EXPR_TYPE_UNDEFINED, @@ -73,7 +73,7 @@ public function test_from_ast_names_unsupported_bool_expr_type(): void public function test_from_ast_names_unsupported_sub_link_type(): void { $this->expectException(UnsupportedNodeException::class); - $this->expectExceptionMessage('Unsupported node type: SubLink type: ARRAY_SUBLINK'); + $this->expectExceptionMessageIsOrContains('Unsupported node type: SubLink type: ARRAY_SUBLINK'); ConditionFactory::fromAst(new ExpressionParser()->parse('ARRAY(SELECT 1)')); } diff --git a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Condition/InTest.php b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Condition/InTest.php index 727eb2906a..84bbf6978d 100644 --- a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Condition/InTest.php +++ b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Condition/InTest.php @@ -71,7 +71,7 @@ public function test_from_ast_reconstructs_in(): void public function test_from_ast_throws_on_non_a_expr(): void { $this->expectException(InvalidAstException::class); - $this->expectExceptionMessage('Expected A_Expr node, got unknown'); + $this->expectExceptionMessageIsOrContains('Expected A_Expr node, got unknown'); $node = new Node(); In::fromAst($node); @@ -80,7 +80,7 @@ public function test_from_ast_throws_on_non_a_expr(): void public function test_from_ast_throws_on_wrong_kind(): void { $this->expectException(InvalidAstException::class); - $this->expectExceptionMessage('Expected AEXPR_IN for In condition'); + $this->expectExceptionMessageIsOrContains('Expected AEXPR_IN for In condition'); $aExpr = new A_Expr(); $aExpr->setKind(A_Expr_Kind::AEXPR_OP); @@ -94,7 +94,7 @@ public function test_from_ast_throws_on_wrong_kind(): void public function test_in_empty_values_throws(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('IN condition requires at least 1 value'); + $this->expectExceptionMessageIsOrContains('IN condition requires at least 1 value'); new In(Column::name('id'), []); } @@ -170,7 +170,7 @@ public function test_or_returns_or_condition(): void public function test_in_with_single_subquery_throws(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'in_() does not support subqueries; use in_subquery($expr, $subquery) for "IN (subquery)".', ); diff --git a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Condition/IsNullTest.php b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Condition/IsNullTest.php index cf6c100b86..dd50504207 100644 --- a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Condition/IsNullTest.php +++ b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Condition/IsNullTest.php @@ -76,7 +76,7 @@ public function test_from_ast_reconstructs_is_null(): void public function test_from_ast_throws_on_non_null_test(): void { $this->expectException(InvalidAstException::class); - $this->expectExceptionMessage('Expected NullTest node, got unknown'); + $this->expectExceptionMessageIsOrContains('Expected NullTest node, got unknown'); $node = new Node(); IsNull::fromAst($node); diff --git a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Condition/NotConditionTest.php b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Condition/NotConditionTest.php index 82aca2eb30..8b1454753e 100644 --- a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Condition/NotConditionTest.php +++ b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Condition/NotConditionTest.php @@ -119,7 +119,7 @@ public function test_from_ast_reconstructs_not_condition(): void public function test_from_ast_throws_on_empty_args(): void { $this->expectException(InvalidAstException::class); - $this->expectExceptionMessage('NOT_EXPR must have exactly one argument, got 0'); + $this->expectExceptionMessageIsOrContains('NOT_EXPR must have exactly one argument, got 0'); $boolExpr = new BoolExpr(); $boolExpr->setBoolop(BoolExprType::NOT_EXPR); @@ -134,7 +134,7 @@ public function test_from_ast_throws_on_empty_args(): void public function test_from_ast_throws_on_multiple_args(): void { $this->expectException(InvalidAstException::class); - $this->expectExceptionMessage('NOT_EXPR must have exactly one argument, got 2'); + $this->expectExceptionMessageIsOrContains('NOT_EXPR must have exactly one argument, got 2'); $cond1 = eq(col('x'), literal(1)); $cond2 = eq(col('y'), literal(2)); @@ -152,7 +152,7 @@ public function test_from_ast_throws_on_multiple_args(): void public function test_from_ast_throws_on_non_bool_expr(): void { $this->expectException(InvalidAstException::class); - $this->expectExceptionMessage('Expected BoolExpr node, got unknown'); + $this->expectExceptionMessageIsOrContains('Expected BoolExpr node, got unknown'); $node = new Node(); NotCondition::fromAst($node); @@ -161,7 +161,7 @@ public function test_from_ast_throws_on_non_bool_expr(): void public function test_from_ast_throws_on_wrong_bool_type(): void { $this->expectException(InvalidAstException::class); - $this->expectExceptionMessage('Expected BoolExpr with NOT_EXPR'); + $this->expectExceptionMessageIsOrContains('Expected BoolExpr with NOT_EXPR'); $boolExpr = new BoolExpr(); $boolExpr->setBoolop(BoolExprType::AND_EXPR); diff --git a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Condition/OrConditionTest.php b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Condition/OrConditionTest.php index c17de1f00c..6da7ebe1e0 100644 --- a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Condition/OrConditionTest.php +++ b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Condition/OrConditionTest.php @@ -119,7 +119,7 @@ public function test_from_ast_reconstructs_or_condition(): void public function test_from_ast_throws_on_non_bool_expr(): void { $this->expectException(InvalidAstException::class); - $this->expectExceptionMessage('Expected BoolExpr node, got unknown'); + $this->expectExceptionMessageIsOrContains('Expected BoolExpr node, got unknown'); $node = new Node(); OrCondition::fromAst($node); @@ -128,7 +128,7 @@ public function test_from_ast_throws_on_non_bool_expr(): void public function test_from_ast_throws_on_wrong_bool_type(): void { $this->expectException(InvalidAstException::class); - $this->expectExceptionMessage('Expected BoolExpr with OR_EXPR'); + $this->expectExceptionMessageIsOrContains('Expected BoolExpr with OR_EXPR'); $boolExpr = new BoolExpr(); $boolExpr->setBoolop(BoolExprType::AND_EXPR); diff --git a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Cursor/DeclareCursorBuilderTest.php b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Cursor/DeclareCursorBuilderTest.php index 0c28aec42c..99ba8ef2b9 100644 --- a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Cursor/DeclareCursorBuilderTest.php +++ b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Cursor/DeclareCursorBuilderTest.php @@ -15,7 +15,7 @@ final class DeclareCursorBuilderTest extends TestCase public function test_a_non_select_statement_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('DECLARE CURSOR takes exactly one SELECT or VALUES statement'); + $this->expectExceptionMessageIsOrContains('DECLARE CURSOR takes exactly one SELECT or VALUES statement'); declare_cursor('c', 'INSERT INTO t VALUES (1) RETURNING id'); } @@ -23,7 +23,7 @@ public function test_a_non_select_statement_is_refused(): void public function test_a_parsed_non_select_statement_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('DECLARE CURSOR takes exactly one SELECT or VALUES statement'); + $this->expectExceptionMessageIsOrContains('DECLARE CURSOR takes exactly one SELECT or VALUES statement'); declare_cursor('c', sql_parse('INSERT INTO t VALUES (1) RETURNING id')); } @@ -49,7 +49,7 @@ public function test_a_values_statement_declares(): void public function test_more_than_one_statement_is_refused(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('DECLARE CURSOR takes exactly one SELECT or VALUES statement'); + $this->expectExceptionMessageIsOrContains('DECLARE CURSOR takes exactly one SELECT or VALUES statement'); declare_cursor('c', 'SELECT 1; SELECT 2'); } diff --git a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Delete/DeleteBuilderTest.php b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Delete/DeleteBuilderTest.php index 6204970fb9..c1073a0ae0 100644 --- a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Delete/DeleteBuilderTest.php +++ b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Delete/DeleteBuilderTest.php @@ -574,7 +574,7 @@ public function test_delete_without_where_returning_all(): void public function test_from_ast_empty_relname_throws_exception(): void { $this->expectException(InvalidAstException::class); - $this->expectExceptionMessage('Missing required field "relname" in RangeVar node'); + $this->expectExceptionMessageIsOrContains('Missing required field "relname" in RangeVar node'); $deleteStmt = new DeleteStmt(); $deleteStmt->setRelation(new RangeVar([ @@ -587,7 +587,7 @@ public function test_from_ast_empty_relname_throws_exception(): void public function test_from_ast_missing_relation_throws_exception(): void { $this->expectException(InvalidAstException::class); - $this->expectExceptionMessage('Missing required field "relation" in DeleteStmt node'); + $this->expectExceptionMessageIsOrContains('Missing required field "relation" in DeleteStmt node'); $deleteStmt = new DeleteStmt(); DeleteBuilder::fromAst($deleteStmt); @@ -812,7 +812,7 @@ public function test_simple_delete_deparsed_output(): void public function test_to_ast_without_table_throws_exception(): void { $this->expectException(LogicException::class); - $this->expectExceptionMessage('Cannot create DeleteStmt without table name. Call from() first.'); + $this->expectExceptionMessageIsOrContains('Cannot create DeleteStmt without table name. Call from() first.'); $builder = DeleteBuilder::create(); assert($builder instanceof DeleteFinalStep); @@ -873,7 +873,7 @@ public function test_returning_aliases_to_sql(): void public function test_returning_aliases_without_alias_throws(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('returningAliases() needs an old or a new alias'); + $this->expectExceptionMessageIsOrContains('returningAliases() needs an old or a new alias'); delete()->from('children')->returningAliases(); } @@ -881,7 +881,7 @@ public function test_returning_aliases_without_alias_throws(): void public function test_returning_aliases_without_returning_list_throws(): void { $this->expectException(InvalidBuilderStateException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'RETURNING WITH (OLD AS o) needs a RETURNING list. Call returning() or returningAll() after returningAliases().', ); @@ -891,7 +891,7 @@ public function test_returning_aliases_without_returning_list_throws(): void public function test_returning_without_expressions_throws(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'returning() needs at least one expression. Call returningAll() for RETURNING *.', ); diff --git a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Expression/ArrayExpressionTest.php b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Expression/ArrayExpressionTest.php index fd5693dac3..27e2d1e54c 100644 --- a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Expression/ArrayExpressionTest.php +++ b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Expression/ArrayExpressionTest.php @@ -66,7 +66,7 @@ public function test_empty_array_expression(): void public function test_from_ast_throws_on_non_array_expr(): void { $this->expectException(InvalidAstException::class); - $this->expectExceptionMessage('Expected A_ArrayExpr node, got unknown'); + $this->expectExceptionMessageIsOrContains('Expected A_ArrayExpr node, got unknown'); $node = new Node(); ArrayExpression::fromAst($node); diff --git a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Expression/BinaryExpressionTest.php b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Expression/BinaryExpressionTest.php index bbc9649a55..208071818f 100644 --- a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Expression/BinaryExpressionTest.php +++ b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Expression/BinaryExpressionTest.php @@ -69,7 +69,7 @@ public function test_binary_expression_deparsed_output(): void public function test_from_ast_throws_on_non_a_expr(): void { $this->expectException(InvalidAstException::class); - $this->expectExceptionMessage('Expected A_Expr node, got unknown'); + $this->expectExceptionMessageIsOrContains('Expected A_Expr node, got unknown'); $node = new Node(); BinaryExpression::fromAst($node); @@ -78,7 +78,7 @@ public function test_from_ast_throws_on_non_a_expr(): void public function test_from_ast_throws_on_wrong_kind(): void { $this->expectException(InvalidAstException::class); - $this->expectExceptionMessage('must be AEXPR_OP for binary expression'); + $this->expectExceptionMessageIsOrContains('must be AEXPR_OP for binary expression'); $aExpr = new A_Expr(); $aExpr->setKind(A_Expr_Kind::AEXPR_DISTINCT); @@ -92,7 +92,7 @@ public function test_from_ast_throws_on_wrong_kind(): void public function test_from_ast_throws_when_lexpr_missing(): void { $this->expectException(InvalidAstException::class); - $this->expectExceptionMessage('Missing required field "lexpr"'); + $this->expectExceptionMessageIsOrContains('Missing required field "lexpr"'); $operatorNode = new Node(); $operatorString = new PBString(); @@ -113,7 +113,7 @@ public function test_from_ast_throws_when_lexpr_missing(): void public function test_from_ast_throws_when_name_missing(): void { $this->expectException(InvalidAstException::class); - $this->expectExceptionMessage('Missing required field "name"'); + $this->expectExceptionMessageIsOrContains('Missing required field "name"'); $aExpr = new A_Expr(); $aExpr->setKind(A_Expr_Kind::AEXPR_OP); @@ -129,7 +129,7 @@ public function test_from_ast_throws_when_name_missing(): void public function test_from_ast_throws_when_rexpr_missing(): void { $this->expectException(InvalidAstException::class); - $this->expectExceptionMessage('Missing required field "rexpr"'); + $this->expectExceptionMessageIsOrContains('Missing required field "rexpr"'); $operatorNode = new Node(); $operatorString = new PBString(); diff --git a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Expression/CoalesceTest.php b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Expression/CoalesceTest.php index 1b40ec2f7b..d217514fa2 100644 --- a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Expression/CoalesceTest.php +++ b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Expression/CoalesceTest.php @@ -68,7 +68,7 @@ public function test_coalesce_deparsed_output(): void public function test_constructor_throws_on_less_than_two_expressions(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('COALESCE requires at least 2 expressions'); + $this->expectExceptionMessageIsOrContains('COALESCE requires at least 2 expressions'); new Coalesce([new MockExpression()]); } @@ -92,7 +92,7 @@ public function test_expressions_getter(): void public function test_from_ast_throws_on_insufficient_args(): void { $this->expectException(InvalidAstException::class); - $this->expectExceptionMessage('must have at least 2 arguments'); + $this->expectExceptionMessageIsOrContains('must have at least 2 arguments'); $coalesceExpr = new CoalesceExpr(); $coalesceExpr->setArgs([new Node()]); @@ -106,7 +106,7 @@ public function test_from_ast_throws_on_insufficient_args(): void public function test_from_ast_throws_on_non_coalesce_expr(): void { $this->expectException(InvalidAstException::class); - $this->expectExceptionMessage('Expected CoalesceExpr node, got unknown'); + $this->expectExceptionMessageIsOrContains('Expected CoalesceExpr node, got unknown'); $node = new Node(); Coalesce::fromAst($node); diff --git a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Expression/CollateTest.php b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Expression/CollateTest.php index f70ff34f45..0181c0c829 100644 --- a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Expression/CollateTest.php +++ b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Expression/CollateTest.php @@ -57,7 +57,7 @@ public function test_from_ast_round_trips(string $sql): void public function test_from_ast_throws_on_non_collate_node(): void { $this->expectException(InvalidAstException::class); - $this->expectExceptionMessage('Expected CollateClause node, got unknown'); + $this->expectExceptionMessageIsOrContains('Expected CollateClause node, got unknown'); Collate::fromAst(new Node()); } @@ -65,7 +65,9 @@ public function test_from_ast_throws_on_non_collate_node(): void public function test_from_ast_throws_on_non_string_collname(): void { $this->expectException(InvalidAstException::class); - $this->expectExceptionMessage('Invalid value for field "collname" in CollateClause node: expected String node'); + $this->expectExceptionMessageIsOrContains( + 'Invalid value for field "collname" in CollateClause node: expected String node', + ); Collate::fromAst(new Node()->setCollateClause(new CollateClause() ->setArg(col('name')->toAst()) @@ -77,7 +79,7 @@ public function test_from_ast_throws_on_non_string_collname(): void public function test_from_ast_throws_without_arg(): void { $this->expectException(InvalidAstException::class); - $this->expectExceptionMessage('Missing required field "arg" in CollateClause node'); + $this->expectExceptionMessageIsOrContains('Missing required field "arg" in CollateClause node'); Collate::fromAst(new Node()->setCollateClause(new CollateClause())); } @@ -85,7 +87,7 @@ public function test_from_ast_throws_without_arg(): void public function test_from_ast_throws_without_collname(): void { $this->expectException(InvalidAstException::class); - $this->expectExceptionMessage('Missing required field "collname" in CollateClause node'); + $this->expectExceptionMessageIsOrContains('Missing required field "collname" in CollateClause node'); Collate::fromAst(new Node()->setCollateClause(new CollateClause()->setArg(col('name')->toAst()))); } diff --git a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Expression/ColumnTest.php b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Expression/ColumnTest.php index 9549cddf41..c92ac215be 100644 --- a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Expression/ColumnTest.php +++ b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Expression/ColumnTest.php @@ -89,7 +89,7 @@ public function test_rejects_empty_part_string(): void public function test_rejects_empty_parts(): void { $this->expectException(InvalidExpressionException::class); - $this->expectExceptionMessage('Column parts cannot be empty'); + $this->expectExceptionMessageIsOrContains('Column parts cannot be empty'); Column::fromParts([]); } diff --git a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Expression/GreatestTest.php b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Expression/GreatestTest.php index 9e57594f01..09a4ffc13b 100644 --- a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Expression/GreatestTest.php +++ b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Expression/GreatestTest.php @@ -38,7 +38,7 @@ public function test_as_returns_aliased_expression(): void public function test_constructor_throws_on_less_than_two_expressions(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('GREATEST requires at least 2 expressions'); + $this->expectExceptionMessageIsOrContains('GREATEST requires at least 2 expressions'); new Greatest([new MockExpression()]); } @@ -62,7 +62,7 @@ public function test_expressions_getter(): void public function test_from_ast_throws_on_insufficient_args(): void { $this->expectException(InvalidAstException::class); - $this->expectExceptionMessage('must have at least 2 arguments'); + $this->expectExceptionMessageIsOrContains('must have at least 2 arguments'); $minMaxExpr = new MinMaxExpr(); $minMaxExpr->setOp(MinMaxOp::IS_GREATEST); @@ -77,7 +77,7 @@ public function test_from_ast_throws_on_insufficient_args(): void public function test_from_ast_throws_on_non_min_max_expr(): void { $this->expectException(InvalidAstException::class); - $this->expectExceptionMessage('Expected MinMaxExpr node, got unknown'); + $this->expectExceptionMessageIsOrContains('Expected MinMaxExpr node, got unknown'); $node = new Node(); Greatest::fromAst($node); @@ -86,7 +86,7 @@ public function test_from_ast_throws_on_non_min_max_expr(): void public function test_from_ast_throws_on_wrong_op(): void { $this->expectException(InvalidAstException::class); - $this->expectExceptionMessage('must be IS_GREATEST'); + $this->expectExceptionMessageIsOrContains('must be IS_GREATEST'); $minMaxExpr = new MinMaxExpr(); $minMaxExpr->setOp(MinMaxOp::IS_LEAST); diff --git a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Expression/LeastTest.php b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Expression/LeastTest.php index ff4475f826..56410c2890 100644 --- a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Expression/LeastTest.php +++ b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Expression/LeastTest.php @@ -38,7 +38,7 @@ public function test_as_returns_aliased_expression(): void public function test_constructor_throws_on_less_than_two_expressions(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('LEAST requires at least 2 expressions'); + $this->expectExceptionMessageIsOrContains('LEAST requires at least 2 expressions'); new Least([new MockExpression()]); } @@ -62,7 +62,7 @@ public function test_expressions_getter(): void public function test_from_ast_throws_on_insufficient_args(): void { $this->expectException(InvalidAstException::class); - $this->expectExceptionMessage('must have at least 2 arguments'); + $this->expectExceptionMessageIsOrContains('must have at least 2 arguments'); $minMaxExpr = new MinMaxExpr(); $minMaxExpr->setOp(MinMaxOp::IS_LEAST); @@ -77,7 +77,7 @@ public function test_from_ast_throws_on_insufficient_args(): void public function test_from_ast_throws_on_non_min_max_expr(): void { $this->expectException(InvalidAstException::class); - $this->expectExceptionMessage('Expected MinMaxExpr node, got unknown'); + $this->expectExceptionMessageIsOrContains('Expected MinMaxExpr node, got unknown'); $node = new Node(); Least::fromAst($node); @@ -86,7 +86,7 @@ public function test_from_ast_throws_on_non_min_max_expr(): void public function test_from_ast_throws_on_wrong_op(): void { $this->expectException(InvalidAstException::class); - $this->expectExceptionMessage('must be IS_LEAST'); + $this->expectExceptionMessageIsOrContains('must be IS_LEAST'); $minMaxExpr = new MinMaxExpr(); $minMaxExpr->setOp(MinMaxOp::IS_GREATEST); diff --git a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Expression/NullIfTest.php b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Expression/NullIfTest.php index 41ffcd83ab..7a36ff413c 100644 --- a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Expression/NullIfTest.php +++ b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Expression/NullIfTest.php @@ -37,7 +37,7 @@ public function test_as_returns_aliased_expression(): void public function test_from_ast_throws_on_non_a_expr(): void { $this->expectException(InvalidAstException::class); - $this->expectExceptionMessage('Expected A_Expr node, got unknown'); + $this->expectExceptionMessageIsOrContains('Expected A_Expr node, got unknown'); $node = new Node(); NullIf::fromAst($node); @@ -46,7 +46,7 @@ public function test_from_ast_throws_on_non_a_expr(): void public function test_from_ast_throws_on_wrong_a_expr_kind(): void { $this->expectException(InvalidAstException::class); - $this->expectExceptionMessage('Expected AEXPR_NULLIF for NullIf expression'); + $this->expectExceptionMessageIsOrContains('Expected AEXPR_NULLIF for NullIf expression'); $aExpr = new A_Expr(); $aExpr->setKind(A_Expr_Kind::AEXPR_OP); diff --git a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Expression/RowExpressionTest.php b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Expression/RowExpressionTest.php index ede84f606b..a02cfc7141 100644 --- a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Expression/RowExpressionTest.php +++ b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Expression/RowExpressionTest.php @@ -54,7 +54,7 @@ public function test_as_returns_aliased_expression(): void public function test_constructor_throws_on_empty_args(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('RowExpression requires at least 1 expression'); + $this->expectExceptionMessageIsOrContains('RowExpression requires at least 1 expression'); new RowExpression([]); } @@ -75,7 +75,7 @@ public function test_explicit_row_format(): void public function test_from_ast_throws_on_empty_args(): void { $this->expectException(InvalidAstException::class); - $this->expectExceptionMessage('must have at least 1 argument'); + $this->expectExceptionMessageIsOrContains('must have at least 1 argument'); $rowExpr = new RowExpr(); $rowExpr->setArgs([]); @@ -89,7 +89,7 @@ public function test_from_ast_throws_on_empty_args(): void public function test_from_ast_throws_on_non_row_expr(): void { $this->expectException(InvalidAstException::class); - $this->expectExceptionMessage('Expected RowExpr node, got unknown'); + $this->expectExceptionMessageIsOrContains('Expected RowExpr node, got unknown'); $node = new Node(); RowExpression::fromAst($node); diff --git a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Expression/SubqueryTest.php b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Expression/SubqueryTest.php index b1acf67ffb..12d93c8fac 100644 --- a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Expression/SubqueryTest.php +++ b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Expression/SubqueryTest.php @@ -88,7 +88,7 @@ public function test_round_trip_conversion(): void public function test_throws_exception_for_non_expr_sublink_type(): void { $this->expectException(InvalidAstException::class); - $this->expectExceptionMessage('expected EXPR_SUBLINK'); + $this->expectExceptionMessageIsOrContains('expected EXPR_SUBLINK'); $selectStmt = new SelectStmt(); $selectNode = new Node(); diff --git a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Insert/BulkInsertTest.php b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Insert/BulkInsertTest.php index 1b53564d43..0011bad4c9 100644 --- a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Insert/BulkInsertTest.php +++ b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Insert/BulkInsertTest.php @@ -246,7 +246,7 @@ public function test_placeholder_offset_calculation(): void public function test_throws_exception_for_empty_columns(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('At least one column is required'); + $this->expectExceptionMessageIsOrContains('At least one column is required'); BulkInsert::into('users', [], 1); } @@ -254,7 +254,7 @@ public function test_throws_exception_for_empty_columns(): void public function test_throws_exception_for_negative_rows(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Row count must be at least 1'); + $this->expectExceptionMessageIsOrContains('Row count must be at least 1'); BulkInsert::into('users', ['name'], -1); } @@ -262,7 +262,7 @@ public function test_throws_exception_for_negative_rows(): void public function test_throws_exception_for_zero_rows(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Row count must be at least 1'); + $this->expectExceptionMessageIsOrContains('Row count must be at least 1'); BulkInsert::into('users', ['name'], 0); } diff --git a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Insert/InsertBuilderTest.php b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Insert/InsertBuilderTest.php index 3a31ccbf7e..154e7895cf 100644 --- a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Insert/InsertBuilderTest.php +++ b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Insert/InsertBuilderTest.php @@ -804,7 +804,7 @@ public function test_returning_aliases_to_sql(): void public function test_returning_aliases_without_alias_throws(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('returningAliases() needs an old or a new alias'); + $this->expectExceptionMessageIsOrContains('returningAliases() needs an old or a new alias'); insert()->into('children')->columns('id')->values(literal(12))->returningAliases(); } @@ -812,7 +812,7 @@ public function test_returning_aliases_without_alias_throws(): void public function test_returning_aliases_without_returning_list_throws(): void { $this->expectException(InvalidBuilderStateException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'RETURNING WITH (NEW AS n) needs a RETURNING list. Call returning() or returningAll() after returningAliases().', ); @@ -822,7 +822,7 @@ public function test_returning_aliases_without_returning_list_throws(): void public function test_returning_without_expressions_throws(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'returning() needs at least one expression. Call returningAll() for RETURNING *.', ); diff --git a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Merge/MergeBuilderTest.php b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Merge/MergeBuilderTest.php index 03afb003a8..c28f34448c 100644 --- a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Merge/MergeBuilderTest.php +++ b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Merge/MergeBuilderTest.php @@ -861,7 +861,7 @@ public function test_merge_returning_aliases_to_sql(): void public function test_merge_returning_aliases_without_alias_throws(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('returningAliases() needs an old or a new alias'); + $this->expectExceptionMessageIsOrContains('returningAliases() needs an old or a new alias'); merge('children', 'c') ->using('parents', 'p') @@ -872,7 +872,7 @@ public function test_merge_returning_aliases_without_alias_throws(): void public function test_merge_returning_aliases_without_returning_list_throws(): void { $this->expectException(InvalidBuilderStateException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'RETURNING WITH (OLD AS o) needs a RETURNING list. Call returning() or returningAll() after returningAliases().', ); @@ -888,7 +888,7 @@ public function test_merge_returning_aliases_without_returning_list_throws(): vo public function test_merge_returning_without_expressions_throws(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'returning() needs at least one expression. Call returningAll() for RETURNING *.', ); diff --git a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Update/UpdateBuilderTest.php b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Update/UpdateBuilderTest.php index 59b6863b0f..9dd4b19ce7 100644 --- a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Update/UpdateBuilderTest.php +++ b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/Update/UpdateBuilderTest.php @@ -304,7 +304,7 @@ public function test_simple_update_deparsed_output(): void public function test_throws_on_empty_assignments(): void { $this->expectException(InvalidExpressionException::class); - $this->expectExceptionMessage('assignments cannot be empty'); + $this->expectExceptionMessageIsOrContains('assignments cannot be empty'); UpdateBuilder::create()->update('users')->toAst(); } @@ -842,7 +842,7 @@ public function test_returning_aliases_to_sql(): void public function test_returning_aliases_without_alias_throws(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('returningAliases() needs an old or a new alias'); + $this->expectExceptionMessageIsOrContains('returningAliases() needs an old or a new alias'); update()->update('children')->set('parent_id', literal(2))->returningAliases(); } @@ -850,7 +850,7 @@ public function test_returning_aliases_without_alias_throws(): void public function test_returning_aliases_without_returning_list_throws(): void { $this->expectException(InvalidBuilderStateException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'RETURNING WITH (OLD AS o, NEW AS n) needs a RETURNING list. Call returning() or returningAll() after returningAliases().', ); @@ -860,7 +860,7 @@ public function test_returning_aliases_without_returning_list_throws(): void public function test_returning_without_expressions_throws(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'returning() needs at least one expression. Call returningAll() for RETURNING *.', ); diff --git a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/With/WithBuilderTest.php b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/With/WithBuilderTest.php index 55ca0718fc..c00c9b8d43 100644 --- a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/With/WithBuilderTest.php +++ b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/QueryBuilder/With/WithBuilderTest.php @@ -19,7 +19,7 @@ final class WithBuilderTest extends TestCase public function test_merge_on_recursive_with_throws(): void { $this->expectException(InvalidBuilderStateException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'MERGE does not accept WITH RECURSIVE, because PostgreSQL rejects it. Remove recursive() from the WITH clause of this MERGE, or use INSERT, UPDATE or DELETE.', ); diff --git a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/Schema/CatalogTest.php b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/Schema/CatalogTest.php index 630a2c9ec6..9cafa5a341 100644 --- a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/Schema/CatalogTest.php +++ b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/Schema/CatalogTest.php @@ -89,7 +89,7 @@ public function test_empty_catalog_normalize_and_from_array(): void public function test_extension_in_undeclared_schema_is_rejected(): void { $this->expectException(SchemaException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Extension "pgcrypto" is placed in schema "public", which the catalog does not declare; add schema("public") to catalog().', ); diff --git a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/Schema/Diff/DomainDiffTest.php b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/Schema/Diff/DomainDiffTest.php index dfbd3f22af..5aae3db804 100644 --- a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/Schema/Diff/DomainDiffTest.php +++ b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/Schema/Diff/DomainDiffTest.php @@ -213,7 +213,7 @@ public function test_throws_when_adding_unnamed_constraint(): void ); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Cannot add unnamed check constraint on domain "positive_int"'); + $this->expectExceptionMessageIsOrContains('Cannot add unnamed check constraint on domain "positive_int"'); $diff->generate(); } @@ -226,7 +226,7 @@ public function test_throws_when_dropping_unnamed_constraint(): void ); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Cannot drop unnamed check constraint on domain "positive_int"'); + $this->expectExceptionMessageIsOrContains('Cannot drop unnamed check constraint on domain "positive_int"'); $diff->generate(); } } diff --git a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/Schema/Diff/TableDiffTest.php b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/Schema/Diff/TableDiffTest.php index 71a83101b1..414a4b0262 100644 --- a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/Schema/Diff/TableDiffTest.php +++ b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/Schema/Diff/TableDiffTest.php @@ -719,7 +719,7 @@ public function test_partition_changed_throws_runtime_exception(): void $diff = new TableDiff($source, $target, partitionChanged: true); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Partition strategy change on table "public.events" cannot be applied via ALTER TABLE', ); @@ -960,7 +960,7 @@ public function test_throws_when_dropping_unnamed_check_constraint(): void $diff = new TableDiff($table, $table, removedCheckConstraints: [schema_check('age > 0')]); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Cannot drop unnamed check constraint on table "public.users"'); + $this->expectExceptionMessageIsOrContains('Cannot drop unnamed check constraint on table "public.users"'); $diff->generate(); } @@ -972,7 +972,7 @@ public function test_throws_when_dropping_unnamed_exclude_constraint(): void $diff = new TableDiff($table, $table, removedExcludeConstraints: [schema_exclude('USING gist (col WITH &&)')]); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Cannot drop unnamed exclude constraint on table "public.users"'); + $this->expectExceptionMessageIsOrContains('Cannot drop unnamed exclude constraint on table "public.users"'); $diff->generate(); } @@ -988,7 +988,7 @@ public function test_throws_when_dropping_unnamed_foreign_key(): void )]); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Cannot drop unnamed foreign key on table "public.users"'); + $this->expectExceptionMessageIsOrContains('Cannot drop unnamed foreign key on table "public.users"'); $diff->generate(); } @@ -1000,7 +1000,7 @@ public function test_throws_when_dropping_unnamed_primary_key(): void $diff = new TableDiff($table, $table, removedPrimaryKey: schema_primary_key(['id'])); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Cannot drop unnamed primary key on table "public.users"'); + $this->expectExceptionMessageIsOrContains('Cannot drop unnamed primary key on table "public.users"'); $diff->generate(); } @@ -1012,7 +1012,7 @@ public function test_throws_when_dropping_unnamed_unique_constraint(): void $diff = new TableDiff($table, $table, removedUniqueConstraints: [schema_unique(['email'])]); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Cannot drop unnamed unique constraint on table "public.users"'); + $this->expectExceptionMessageIsOrContains('Cannot drop unnamed unique constraint on table "public.users"'); $diff->generate(); } diff --git a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/Schema/ForeignKeyDependencyOrderTest.php b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/Schema/ForeignKeyDependencyOrderTest.php index 6a36ee528c..c2b4f228f0 100644 --- a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/Schema/ForeignKeyDependencyOrderTest.php +++ b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/Schema/ForeignKeyDependencyOrderTest.php @@ -37,7 +37,7 @@ public function test_circular_dependency_throws_exception(): void ); $this->expectException(SchemaException::class); - $this->expectExceptionMessage('Circular foreign key dependency'); + $this->expectExceptionMessageIsOrContains('Circular foreign key dependency'); new ForeignKeyDependencyOrder()->order([$tableA, $tableB]); } diff --git a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/Schema/MaterializedViewDependencyOrderTest.php b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/Schema/MaterializedViewDependencyOrderTest.php index c96d91cccd..8f54da38be 100644 --- a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/Schema/MaterializedViewDependencyOrderTest.php +++ b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/Schema/MaterializedViewDependencyOrderTest.php @@ -20,7 +20,7 @@ public function test_circular_dependency_throws_exception(): void $viewB = new MaterializedView('mv_b', 'SELECT * FROM mv_a'); $this->expectException(SchemaException::class); - $this->expectExceptionMessage('Circular dependency detected between materialized views'); + $this->expectExceptionMessageIsOrContains('Circular dependency detected between materialized views'); new MaterializedViewDependencyOrder(new Parser())->order([$viewA, $viewB]); } diff --git a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/Schema/SchemaTest.php b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/Schema/SchemaTest.php index a9bc6a64c8..5e80a7d543 100644 --- a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/Schema/SchemaTest.php +++ b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/Schema/SchemaTest.php @@ -118,7 +118,7 @@ public static function conflicting_schema_objects(): Generator public function test_schema_object_with_conflicting_schema_is_rejected(Closure $build, string $message): void { $this->expectException(SchemaException::class); - $this->expectExceptionMessage($message); + $this->expectExceptionMessageIsOrContains($message); $build(); } @@ -764,7 +764,7 @@ public function test_table_without_schema_takes_the_schema_it_is_placed_in(): vo public function test_table_with_conflicting_schema_is_rejected(): void { $this->expectException(SchemaException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Table "t" declares schema "other" but is placed in schema "pivotly"; pass schema: "pivotly" to schema_table() or move it.', ); diff --git a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/Schema/ViewDependencyOrderTest.php b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/Schema/ViewDependencyOrderTest.php index 8c8dc3dd0f..11cd08cb17 100644 --- a/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/Schema/ViewDependencyOrderTest.php +++ b/src/lib/postgresql/tests/Flow/PostgreSql/Tests/Unit/Schema/ViewDependencyOrderTest.php @@ -20,7 +20,7 @@ public function test_circular_dependency_throws_exception(): void $viewB = new View('view_b', 'SELECT * FROM view_a'); $this->expectException(SchemaException::class); - $this->expectExceptionMessage('Circular view dependency'); + $this->expectExceptionMessageIsOrContains('Circular view dependency'); new ViewDependencyOrder(new Parser())->order([$viewA, $viewB]); } diff --git a/src/lib/telemetry/tests/Flow/Telemetry/Tests/Unit/Context/SpanIdTest.php b/src/lib/telemetry/tests/Flow/Telemetry/Tests/Unit/Context/SpanIdTest.php index d14a5c087d..fb84e1abf7 100644 --- a/src/lib/telemetry/tests/Flow/Telemetry/Tests/Unit/Context/SpanIdTest.php +++ b/src/lib/telemetry/tests/Flow/Telemetry/Tests/Unit/Context/SpanIdTest.php @@ -98,7 +98,7 @@ public function test_from_bytes_creates_span_id(): void public function test_from_bytes_throws_on_invalid_length(int $length): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('SpanId must be exactly 8 bytes'); + $this->expectExceptionMessageIsOrContains('SpanId must be exactly 8 bytes'); SpanId::fromBytes(str_repeat("\x01", $length)); } @@ -124,7 +124,7 @@ public function test_from_hex_allows_all_zeros(): void public function test_from_hex_throws_on_invalid_hex_strings(string $hex, string $expectedMessage): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage($expectedMessage); + $this->expectExceptionMessageIsOrContains($expectedMessage); SpanId::fromHex($hex); } diff --git a/src/lib/telemetry/tests/Flow/Telemetry/Tests/Unit/Context/TraceFlagsTest.php b/src/lib/telemetry/tests/Flow/Telemetry/Tests/Unit/Context/TraceFlagsTest.php index 7e9207beb3..e0f9e4367d 100644 --- a/src/lib/telemetry/tests/Flow/Telemetry/Tests/Unit/Context/TraceFlagsTest.php +++ b/src/lib/telemetry/tests/Flow/Telemetry/Tests/Unit/Context/TraceFlagsTest.php @@ -58,7 +58,7 @@ public function test_from_byte_creates_flags(int $byte, bool $sampled, bool $ran public function test_from_byte_throws_on_invalid_byte(int $byte): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('TraceFlags byte must be between 0 and 255'); + $this->expectExceptionMessageIsOrContains('TraceFlags byte must be between 0 and 255'); TraceFlags::fromByte($byte); } @@ -83,7 +83,7 @@ public function test_from_hex_creates_unsampled_flags(): void public function test_from_hex_throws_on_invalid_hex(string $hex, string $expectedMessage): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage($expectedMessage); + $this->expectExceptionMessageIsOrContains($expectedMessage); TraceFlags::fromHex($hex); } diff --git a/src/lib/telemetry/tests/Flow/Telemetry/Tests/Unit/Context/TraceIdTest.php b/src/lib/telemetry/tests/Flow/Telemetry/Tests/Unit/Context/TraceIdTest.php index 356b5dcc61..54f0f8b3d1 100644 --- a/src/lib/telemetry/tests/Flow/Telemetry/Tests/Unit/Context/TraceIdTest.php +++ b/src/lib/telemetry/tests/Flow/Telemetry/Tests/Unit/Context/TraceIdTest.php @@ -101,7 +101,7 @@ public function test_from_bytes_creates_trace_id(): void public function test_from_bytes_throws_on_invalid_length(int $length): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('TraceId must be exactly 16 bytes'); + $this->expectExceptionMessageIsOrContains('TraceId must be exactly 16 bytes'); TraceId::fromBytes(str_repeat("\x01", $length)); } @@ -127,7 +127,7 @@ public function test_from_hex_allows_all_zeros(): void public function test_from_hex_throws_on_invalid_hex_strings(string $hex, string $expectedMessage): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage($expectedMessage); + $this->expectExceptionMessageIsOrContains($expectedMessage); TraceId::fromHex($hex); } diff --git a/src/lib/telemetry/tests/Flow/Telemetry/Tests/Unit/Context/TraceStateTest.php b/src/lib/telemetry/tests/Flow/Telemetry/Tests/Unit/Context/TraceStateTest.php index 4870940153..95d405a41f 100644 --- a/src/lib/telemetry/tests/Flow/Telemetry/Tests/Unit/Context/TraceStateTest.php +++ b/src/lib/telemetry/tests/Flow/Telemetry/Tests/Unit/Context/TraceStateTest.php @@ -83,7 +83,7 @@ public function test_from_string_parses_correctly(string $input, array $expected public function test_from_string_throws_on_invalid_entries(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Invalid tracestate entry'); + $this->expectExceptionMessageIsOrContains('Invalid tracestate entry'); TraceState::fromString('valid=value,invalid,also=valid'); } @@ -193,7 +193,7 @@ public function test_with_returns_new_instance(): void public function test_with_throws_on_invalid_key(string $key, string $expectedMessage): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage($expectedMessage); + $this->expectExceptionMessageIsOrContains($expectedMessage); TraceState::empty()->with($key, 'value'); } diff --git a/src/lib/telemetry/tests/Flow/Telemetry/Tests/Unit/Filter/AttributeFilterTest.php b/src/lib/telemetry/tests/Flow/Telemetry/Tests/Unit/Filter/AttributeFilterTest.php index 900739aa24..a871f4f682 100644 --- a/src/lib/telemetry/tests/Flow/Telemetry/Tests/Unit/Filter/AttributeFilterTest.php +++ b/src/lib/telemetry/tests/Flow/Telemetry/Tests/Unit/Filter/AttributeFilterTest.php @@ -123,7 +123,7 @@ public function test_cache_dir_is_created_with_configured_permissions(): void public function test_cache_dir_permissions_out_of_range_throws(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Cache directory permissions must be between 0 and 0777'); + $this->expectExceptionMessageIsOrContains('Cache directory permissions must be between 0 and 0777'); attribute_filter(attribute_rule('x', MatchMode::EQUAL, 'y'), cacheDirPermissions: 0o1000); } diff --git a/src/lib/telemetry/tests/Flow/Telemetry/Tests/Unit/Meter/Instrument/CounterTest.php b/src/lib/telemetry/tests/Flow/Telemetry/Tests/Unit/Meter/Instrument/CounterTest.php index cec60f1f22..b656ba7a87 100644 --- a/src/lib/telemetry/tests/Flow/Telemetry/Tests/Unit/Meter/Instrument/CounterTest.php +++ b/src/lib/telemetry/tests/Flow/Telemetry/Tests/Unit/Meter/Instrument/CounterTest.php @@ -49,7 +49,7 @@ public function test_add_negative_value_throws_exception(): void ); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Counter amount must be >= 0, got -5'); + $this->expectExceptionMessageIsOrContains('Counter amount must be >= 0, got -5'); $counter->add(-5); } diff --git a/src/lib/telemetry/tests/Flow/Telemetry/Tests/Unit/Meter/MeterTest.php b/src/lib/telemetry/tests/Flow/Telemetry/Tests/Unit/Meter/MeterTest.php index 76eb162a76..54d146e98f 100644 --- a/src/lib/telemetry/tests/Flow/Telemetry/Tests/Unit/Meter/MeterTest.php +++ b/src/lib/telemetry/tests/Flow/Telemetry/Tests/Unit/Meter/MeterTest.php @@ -221,7 +221,7 @@ public function test_counter_rejects_negative_amounts(int|float $amount): void $counter = $meter->createCounter('counter'); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Counter amount must be >= 0'); + $this->expectExceptionMessageIsOrContains('Counter amount must be >= 0'); $counter->add($amount); } diff --git a/src/lib/telemetry/tests/Flow/Telemetry/Tests/Unit/Propagation/SuperglobalCarrierTest.php b/src/lib/telemetry/tests/Flow/Telemetry/Tests/Unit/Propagation/SuperglobalCarrierTest.php index 0cdc2c3765..fd63734671 100644 --- a/src/lib/telemetry/tests/Flow/Telemetry/Tests/Unit/Propagation/SuperglobalCarrierTest.php +++ b/src/lib/telemetry/tests/Flow/Telemetry/Tests/Unit/Propagation/SuperglobalCarrierTest.php @@ -168,7 +168,7 @@ public function test_set_throws_runtime_exception(): void $carrier = new SuperglobalCarrier(); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('SuperglobalCarrier is read-only'); + $this->expectExceptionMessageIsOrContains('SuperglobalCarrier is read-only'); $carrier->set('key', 'value'); } diff --git a/src/lib/telemetry/tests/Flow/Telemetry/Tests/Unit/Provider/Console/ConsoleOutputTest.php b/src/lib/telemetry/tests/Flow/Telemetry/Tests/Unit/Provider/Console/ConsoleOutputTest.php index 9e2ebdddc1..786f56ab26 100644 --- a/src/lib/telemetry/tests/Flow/Telemetry/Tests/Unit/Provider/Console/ConsoleOutputTest.php +++ b/src/lib/telemetry/tests/Flow/Telemetry/Tests/Unit/Provider/Console/ConsoleOutputTest.php @@ -48,7 +48,7 @@ public function test_rejects_a_value_that_is_not_an_open_stream(): void fclose($stream); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Console output needs an open stream'); + $this->expectExceptionMessageIsOrContains('Console output needs an open stream'); new ConsoleOutput(stream: $stream); } diff --git a/src/lib/telemetry/tests/Flow/Telemetry/Tests/Unit/Provider/Memory/MemoryExporterTest.php b/src/lib/telemetry/tests/Flow/Telemetry/Tests/Unit/Provider/Memory/MemoryExporterTest.php index a2e6a21f40..adcd01f016 100644 --- a/src/lib/telemetry/tests/Flow/Telemetry/Tests/Unit/Provider/Memory/MemoryExporterTest.php +++ b/src/lib/telemetry/tests/Flow/Telemetry/Tests/Unit/Provider/Memory/MemoryExporterTest.php @@ -25,7 +25,9 @@ final class MemoryExporterTest extends TestCase public function test_constructor_rejects_non_positive_max_entries(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('MemoryExporter maxEntriesPerSignal must be a positive integer, got 0'); + $this->expectExceptionMessageIsOrContains( + 'MemoryExporter maxEntriesPerSignal must be a positive integer, got 0', + ); new MemoryExporter(0); } diff --git a/src/lib/telemetry/tests/Flow/Telemetry/Tests/Unit/Tracer/Sampler/TraceIdRatioBasedSamplerTest.php b/src/lib/telemetry/tests/Flow/Telemetry/Tests/Unit/Tracer/Sampler/TraceIdRatioBasedSamplerTest.php index 707821ee48..1b651ae5d8 100644 --- a/src/lib/telemetry/tests/Flow/Telemetry/Tests/Unit/Tracer/Sampler/TraceIdRatioBasedSamplerTest.php +++ b/src/lib/telemetry/tests/Flow/Telemetry/Tests/Unit/Tracer/Sampler/TraceIdRatioBasedSamplerTest.php @@ -33,7 +33,7 @@ public static function provideInvalidRatios(): Generator public function test_constructor_throws_on_invalid_ratio(float $ratio): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Sampling ratio must be between 0.0 and 1.0'); + $this->expectExceptionMessageIsOrContains('Sampling ratio must be between 0.0 and 1.0'); new TraceIdRatioBasedSampler($ratio); } diff --git a/src/lib/telemetry/tests/Flow/Telemetry/Tests/Unit/Tracer/TracerTest.php b/src/lib/telemetry/tests/Flow/Telemetry/Tests/Unit/Tracer/TracerTest.php index 40a5b80aff..95fc765157 100644 --- a/src/lib/telemetry/tests/Flow/Telemetry/Tests/Unit/Tracer/TracerTest.php +++ b/src/lib/telemetry/tests/Flow/Telemetry/Tests/Unit/Tracer/TracerTest.php @@ -346,7 +346,7 @@ public function test_trace_records_exception_on_error(): void public function test_trace_rethrows_exception(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Test error'); + $this->expectExceptionMessageIsOrContains('Test error'); TracerMother::create()->trace('test-span', static function (): void { throw new RuntimeException('Test error'); diff --git a/src/lib/types/tests/Flow/Types/Tests/Unit/Type/Logical/DateTimeTypeTest.php b/src/lib/types/tests/Flow/Types/Tests/Unit/Type/Logical/DateTimeTypeTest.php index b70278cc65..71867cbd04 100644 --- a/src/lib/types/tests/Flow/Types/Tests/Unit/Type/Logical/DateTimeTypeTest.php +++ b/src/lib/types/tests/Flow/Types/Tests/Unit/Type/Logical/DateTimeTypeTest.php @@ -324,7 +324,7 @@ public function test_to_string(): void public function test_abbreviation_is_refused_with_its_region(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Time zone "CET" is parsed by PHP as a fixed-offset abbreviation without daylight-saving rules, use the region it links to: "Europe/Brussels"', ); @@ -437,7 +437,7 @@ public function test_types_of_different_zones_are_not_equal(): void public function test_unknown_zone_is_refused(string $zone): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage(sprintf( + $this->expectExceptionMessageIsOrContains(sprintf( 'Time zone "%s" cannot be a datetime column zone, use an IANA name like "Europe/Warsaw", "UTC" or an offset "+HH:MM"', $zone, )); diff --git a/src/lib/types/tests/Flow/Types/Tests/Unit/Type/Logical/ListTypeTest.php b/src/lib/types/tests/Flow/Types/Tests/Unit/Type/Logical/ListTypeTest.php index 41315c342e..88e20caa5c 100644 --- a/src/lib/types/tests/Flow/Types/Tests/Unit/Type/Logical/ListTypeTest.php +++ b/src/lib/types/tests/Flow/Types/Tests/Unit/Type/Logical/ListTypeTest.php @@ -225,7 +225,7 @@ public function test_cast(mixed $value, ListType $listType, mixed $expected, ?st public function test_a_scalar_is_not_wrapped_into_a_container(): void { $this->expectException(CastingException::class); - $this->expectExceptionMessage('wrap the value first, e.g. type_list(type_string())'); + $this->expectExceptionMessageIsOrContains('wrap the value first, e.g. type_list(type_string())'); type_list(type_integer())->cast(5); } diff --git a/src/lib/types/tests/Flow/Types/Tests/Unit/Type/Logical/OptionalTypeTest.php b/src/lib/types/tests/Flow/Types/Tests/Unit/Type/Logical/OptionalTypeTest.php index 235961c113..4cad7082b1 100644 --- a/src/lib/types/tests/Flow/Types/Tests/Unit/Type/Logical/OptionalTypeTest.php +++ b/src/lib/types/tests/Flow/Types/Tests/Unit/Type/Logical/OptionalTypeTest.php @@ -161,7 +161,7 @@ public function test_cast(OptionalType $type, mixed $value, mixed $expected, ?st #[DataProvider('invalid_creation_data_provider')] public function test_invalid_creation(Type $type, string $exceptionMessage): void { - $this->expectExceptionMessage($exceptionMessage); + $this->expectExceptionMessageIsOrContains($exceptionMessage); type_optional($type); } diff --git a/src/lib/types/tests/Flow/Types/Tests/Unit/Type/Logical/PositiveIntegerTypeTest.php b/src/lib/types/tests/Flow/Types/Tests/Unit/Type/Logical/PositiveIntegerTypeTest.php index 6ff2fd3610..8d6cbaa254 100644 --- a/src/lib/types/tests/Flow/Types/Tests/Unit/Type/Logical/PositiveIntegerTypeTest.php +++ b/src/lib/types/tests/Flow/Types/Tests/Unit/Type/Logical/PositiveIntegerTypeTest.php @@ -215,7 +215,7 @@ public function test_cast_form_feed_padded_integer(string $value): void public function test_an_out_of_range_literal_names_the_range_as_the_reason(): void { $this->expectException(CastingException::class); - $this->expectExceptionMessage('value is out of range for integer'); + $this->expectExceptionMessageIsOrContains('value is out of range for integer'); type_positive_integer()->cast('9223372036854775808'); } diff --git a/src/lib/types/tests/Flow/Types/Tests/Unit/Type/Logical/StructureElementTest.php b/src/lib/types/tests/Flow/Types/Tests/Unit/Type/Logical/StructureElementTest.php index 386e979e25..a3edd39996 100644 --- a/src/lib/types/tests/Flow/Types/Tests/Unit/Type/Logical/StructureElementTest.php +++ b/src/lib/types/tests/Flow/Types/Tests/Unit/Type/Logical/StructureElementTest.php @@ -16,7 +16,7 @@ final class StructureElementTest extends TestCase public function test_rejects_empty_name(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Structure element name cannot be empty.'); + $this->expectExceptionMessageIsOrContains('Structure element name cannot be empty.'); structure_element('', type_string()); } diff --git a/src/lib/types/tests/Flow/Types/Tests/Unit/Type/Logical/StructureTypeTest.php b/src/lib/types/tests/Flow/Types/Tests/Unit/Type/Logical/StructureTypeTest.php index c41dd3162a..a344d6453e 100644 --- a/src/lib/types/tests/Flow/Types/Tests/Unit/Type/Logical/StructureTypeTest.php +++ b/src/lib/types/tests/Flow/Types/Tests/Unit/Type/Logical/StructureTypeTest.php @@ -617,7 +617,7 @@ public function test_structure_element_values_delegate_to_the_constructor(): voi public function test_structure_element_value_must_match_its_key(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Structure element name "nick" does not match its key "nickname"'); + $this->expectExceptionMessageIsOrContains('Structure element name "nick" does not match its key "nickname"'); type_structure(['nickname' => structure_element('nick', type_string(), optional: true)]); } @@ -633,7 +633,7 @@ public function test_structure_element_with_numeric_string_name_matches_its_coer public function test_constructor_rejects_duplicate_element_names(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Structure element names must be unique: id'); + $this->expectExceptionMessageIsOrContains('Structure element names must be unique: id'); new StructureType([ new StructureElement('id', type_integer()), @@ -664,7 +664,7 @@ public function test_element_lookup_returns_null_for_unknown_name(): void public function test_constructor_requires_at_least_one_element(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Structure must receive at least one element (required or optional)'); + $this->expectExceptionMessageIsOrContains('Structure must receive at least one element (required or optional)'); type_structure([]); } @@ -763,7 +763,7 @@ public function test_from_array_ignores_allow_extra_false(): void public function test_from_array_refuses_allow_extra_true(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Structure "allow_extra": true is no longer supported'); + $this->expectExceptionMessageIsOrContains('Structure "allow_extra": true is no longer supported'); StructureType::fromArray([ 'type' => 'structure_v2', diff --git a/src/lib/types/tests/Flow/Types/Tests/Unit/Type/Logical/TimeTypeTest.php b/src/lib/types/tests/Flow/Types/Tests/Unit/Type/Logical/TimeTypeTest.php index 1acaf2006e..799cf5ed73 100644 --- a/src/lib/types/tests/Flow/Types/Tests/Unit/Type/Logical/TimeTypeTest.php +++ b/src/lib/types/tests/Flow/Types/Tests/Unit/Type/Logical/TimeTypeTest.php @@ -208,7 +208,7 @@ public function test_normalization(): void public function test_time_type_cast_rejects_relative_interval(): void { $this->expectException(CastingException::class); - $this->expectExceptionMessage("Relative DateInterval (with months/years) can't be cast to time"); + $this->expectExceptionMessageIsOrContains("Relative DateInterval (with months/years) can't be cast to time"); type_time()->cast(new DateInterval('P1M')); } diff --git a/src/lib/types/tests/Flow/Types/Tests/Unit/Type/Native/ArrayTypeTest.php b/src/lib/types/tests/Flow/Types/Tests/Unit/Type/Native/ArrayTypeTest.php index 3104a9a79b..c98eaa9fea 100644 --- a/src/lib/types/tests/Flow/Types/Tests/Unit/Type/Native/ArrayTypeTest.php +++ b/src/lib/types/tests/Flow/Types/Tests/Unit/Type/Native/ArrayTypeTest.php @@ -174,7 +174,7 @@ public function test_cast(mixed $value, mixed $expected, ?string $exceptionClass public function test_a_scalar_is_not_wrapped_into_a_container(): void { $this->expectException(CastingException::class); - $this->expectExceptionMessage('wrap the value first, e.g. type_list(type_string())'); + $this->expectExceptionMessageIsOrContains('wrap the value first, e.g. type_list(type_string())'); type_array()->cast('abc'); } diff --git a/src/lib/types/tests/Flow/Types/Tests/Unit/Type/Native/IntegerTypeTest.php b/src/lib/types/tests/Flow/Types/Tests/Unit/Type/Native/IntegerTypeTest.php index 5aec377213..8dfa978480 100644 --- a/src/lib/types/tests/Flow/Types/Tests/Unit/Type/Native/IntegerTypeTest.php +++ b/src/lib/types/tests/Flow/Types/Tests/Unit/Type/Native/IntegerTypeTest.php @@ -285,7 +285,7 @@ public function test_assert(mixed $value, ?string $exceptionClass = null): void public function test_an_out_of_range_literal_names_the_range_as_the_reason(): void { $this->expectException(CastingException::class); - $this->expectExceptionMessage('value is out of range for integer'); + $this->expectExceptionMessageIsOrContains('value is out of range for integer'); type_integer()->cast('9223372036854775808'); } diff --git a/src/lib/types/tests/Flow/Types/Tests/Unit/Type/Native/IntersectionTypeTest.php b/src/lib/types/tests/Flow/Types/Tests/Unit/Type/Native/IntersectionTypeTest.php index ce3ae21429..1398d24613 100644 --- a/src/lib/types/tests/Flow/Types/Tests/Unit/Type/Native/IntersectionTypeTest.php +++ b/src/lib/types/tests/Flow/Types/Tests/Unit/Type/Native/IntersectionTypeTest.php @@ -261,7 +261,9 @@ public function test_cast_of_clock_time_reaches_the_time_member(): void public function test_intersection_with_mixed_type_as_left(): void { $this->expectException(InvalidTypeException::class); - $this->expectExceptionMessage('IntersectionType cannot be mixed with MixedType, mixed is a standalone type'); + $this->expectExceptionMessageIsOrContains( + 'IntersectionType cannot be mixed with MixedType, mixed is a standalone type', + ); type_intersection(type_mixed(), type_integer()); } @@ -269,7 +271,9 @@ public function test_intersection_with_mixed_type_as_left(): void public function test_intersection_with_mixed_type_as_right(): void { $this->expectException(InvalidTypeException::class); - $this->expectExceptionMessage('IntersectionType cannot be mixed with MixedType, mixed is a standalone type'); + $this->expectExceptionMessageIsOrContains( + 'IntersectionType cannot be mixed with MixedType, mixed is a standalone type', + ); type_intersection(type_integer(), type_mixed()); } diff --git a/src/lib/types/tests/Flow/Types/Tests/Unit/Type/Native/UnionTypeTest.php b/src/lib/types/tests/Flow/Types/Tests/Unit/Type/Native/UnionTypeTest.php index 04e83df0d4..9ea1ba4979 100644 --- a/src/lib/types/tests/Flow/Types/Tests/Unit/Type/Native/UnionTypeTest.php +++ b/src/lib/types/tests/Flow/Types/Tests/Unit/Type/Native/UnionTypeTest.php @@ -307,7 +307,9 @@ public function test_union_member_for_unwraps_optional_members(): void public function test_union_with_mixed_type(): void { $this->expectException(InvalidTypeException::class); - $this->expectExceptionMessage('UnionType cannot be mixed with MixedType, mixed is a standalone type'); + $this->expectExceptionMessageIsOrContains( + 'UnionType cannot be mixed with MixedType, mixed is a standalone type', + ); type_union(type_integer(), type_mixed()); } diff --git a/src/lib/types/tests/Flow/Types/Tests/Unit/Type/TypeDetectorTest.php b/src/lib/types/tests/Flow/Types/Tests/Unit/Type/TypeDetectorTest.php index cc6c976260..31860a1333 100644 --- a/src/lib/types/tests/Flow/Types/Tests/Unit/Type/TypeDetectorTest.php +++ b/src/lib/types/tests/Flow/Types/Tests/Unit/Type/TypeDetectorTest.php @@ -665,7 +665,7 @@ public static function provide_scalar_data(): Generator public function test_closure_is_rejected(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Closure is not a supported value type.'); + $this->expectExceptionMessageIsOrContains('Closure is not a supported value type.'); new TypeDetector()->detectType(static fn(): int => 1); } diff --git a/src/lib/types/tests/Flow/Types/Tests/Unit/Type/ValueComparatorTest.php b/src/lib/types/tests/Flow/Types/Tests/Unit/Type/ValueComparatorTest.php index dc2f5bf2d7..518c8553bf 100644 --- a/src/lib/types/tests/Flow/Types/Tests/Unit/Type/ValueComparatorTest.php +++ b/src/lib/types/tests/Flow/Types/Tests/Unit/Type/ValueComparatorTest.php @@ -60,7 +60,7 @@ public function test_assert_all_types_comparable_checks_all_combinations(): void $types = [type_boolean(), type_integer(), type_string()]; $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( "Can't compare '(integer === boolean)' due to data type mismatch - an explicit cast is required.", ); @@ -91,7 +91,7 @@ public function test_assert_all_types_comparable_with_incompatible_types(): void $types = [type_boolean(), type_string(), type_integer()]; $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( "Can't compare '(string == boolean)' due to data type mismatch - an explicit cast is required.", ); @@ -122,7 +122,7 @@ public function test_assert_all_types_comparable_with_string_operator_incompatib $types = [type_boolean(), type_integer()]; $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( "Can't compare '(integer != boolean)' due to data type mismatch - an explicit cast is required.", ); @@ -150,7 +150,7 @@ public function test_assert_comparable_types_with_incompatible_types( $comparator = new ValueComparator(); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage(sprintf( + $this->expectExceptionMessageIsOrContains(sprintf( "Can't compare '(%s %s %s)' due to data type mismatch - an explicit cast is required.", $left->toString(), $operator->value, @@ -179,7 +179,7 @@ public function test_assert_comparable_types_with_string_operator_incompatible() $operatorString = '=='; $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage(sprintf( + $this->expectExceptionMessageIsOrContains(sprintf( "Can't compare '(%s %s %s)' due to data type mismatch - an explicit cast is required.", $left->toString(), Operator::EQUAL->value, diff --git a/src/lib/types/tests/Flow/Types/Tests/Unit/Value/JsonTest.php b/src/lib/types/tests/Flow/Types/Tests/Unit/Value/JsonTest.php index d86c07a1b0..4e676b619d 100644 --- a/src/lib/types/tests/Flow/Types/Tests/Unit/Value/JsonTest.php +++ b/src/lib/types/tests/Flow/Types/Tests/Unit/Value/JsonTest.php @@ -114,7 +114,7 @@ public function test_json_object_rejects_non_string_keys(): void static::assertSame('{"1":"a"}', Json::fromArray([1 => 'a'])->toString()); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('All keys of a JSON object must be strings'); + $this->expectExceptionMessageIsOrContains('All keys of a JSON object must be strings'); Json::fromArray([1 => 'a'], asObject: true); } diff --git a/src/lib/types/tests/Flow/Types/Tests/Unit/Value/UuidTest.php b/src/lib/types/tests/Flow/Types/Tests/Unit/Value/UuidTest.php index 2ec7fc6ed6..b672793df8 100644 --- a/src/lib/types/tests/Flow/Types/Tests/Unit/Value/UuidTest.php +++ b/src/lib/types/tests/Flow/Types/Tests/Unit/Value/UuidTest.php @@ -26,7 +26,7 @@ public function test_from_bytes_builds_canonical_lowercase_text(): void public function test_from_bytes_refuses_fifteen_bytes(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Uuid::fromBytes() expects 16 bytes, got 15'); + $this->expectExceptionMessageIsOrContains('Uuid::fromBytes() expects 16 bytes, got 15'); Uuid::fromBytes(str_repeat('a', 15)); } @@ -34,7 +34,7 @@ public function test_from_bytes_refuses_fifteen_bytes(): void public function test_from_bytes_refuses_seventeen_bytes(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Uuid::fromBytes() expects 16 bytes, got 17'); + $this->expectExceptionMessageIsOrContains('Uuid::fromBytes() expects 16 bytes, got 17'); Uuid::fromBytes(str_repeat('a', 17)); } diff --git a/tools/infection/phpunit.xml b/tools/infection/phpunit.xml index a5251d645e..a32e1652a9 100644 --- a/tools/infection/phpunit.xml +++ b/tools/infection/phpunit.xml @@ -26,6 +26,7 @@ ../../src/core/etl/src/Flow/ETL/DSL + diff --git a/tools/phpunit/composer.json b/tools/phpunit/composer.json index 0224c2c5e0..c749b7fd66 100644 --- a/tools/phpunit/composer.json +++ b/tools/phpunit/composer.json @@ -3,12 +3,14 @@ "description": "Flow PHP ETL - Tools", "require-dev": { "php": "~8.5.0 || ~8.6.0", - "phpunit/phpunit": "^12.5" + "phpunit/phpunit": "^13.3", + "shipmonk/turbocov-phpunit": "^0.1.0" }, "config": { "allow-plugins": false, "platform": { - "php": "8.5.0" + "php": "8.5.0", + "ext-turbocov": "0.1.2" } } } diff --git a/tools/phpunit/composer.lock b/tools/phpunit/composer.lock index 4ecbedc8b5..3a48e798cd 100644 --- a/tools/phpunit/composer.lock +++ b/tools/phpunit/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "391e91fe37d6db2c5c6cc9aca66d788b", + "content-hash": "b45d731f569a4d529a6fe21d4a3fc9c3", "packages": [], "packages-dev": [ { @@ -248,33 +248,34 @@ }, { "name": "phpunit/php-code-coverage", - "version": "12.5.8", + "version": "14.5.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "7440368d94738d54f2c1de24dbd3871793bbb0dd" + "reference": "2f122b9b48af71ad9b4448368febc26af86534c9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/7440368d94738d54f2c1de24dbd3871793bbb0dd", - "reference": "7440368d94738d54f2c1de24dbd3871793bbb0dd", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/2f122b9b48af71ad9b4448368febc26af86534c9", + "reference": "2f122b9b48af71ad9b4448368febc26af86534c9", "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", + "ext-mbstring": "*", "ext-xmlwriter": "*", "nikic/php-parser": "^5.9.0", - "php": ">=8.3", - "phpunit/php-text-template": "^5.0.1", - "sebastian/complexity": "^5.0", - "sebastian/environment": "^8.1.2", - "sebastian/lines-of-code": "^4.0.1", - "sebastian/version": "^6.0", - "theseer/tokenizer": "^2.0.1" + "php": ">=8.4", + "phpunit/php-text-template": "^6.0.1", + "sebastian/complexity": "^6.0", + "sebastian/environment": "^9.3.3", + "sebastian/git-state": "^1.1.0", + "sebastian/lines-of-code": "^5.0.2", + "sebastian/version": "^7.0.1" }, "require-dev": { - "phpunit/phpunit": "^12.5.37" + "phpunit/phpunit": "^13.4.6" }, "suggest": { "ext-pcov": "PHP extension that provides line coverage", @@ -283,7 +284,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "12.5.x-dev" + "dev-main": "14.5.x-dev" } }, "autoload": { @@ -312,7 +313,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/12.5.8" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/14.5.2" }, "funding": [ { @@ -332,33 +333,33 @@ "type": "tidelift" } ], - "time": "2026-10-03T14:03:50+00:00", - "published-time": "2026-10-03T14:04:33+00:00" + "time": "2026-11-09T05:24:08+00:00", + "published-time": "2026-11-09T05:25:09+00:00" }, { "name": "phpunit/php-file-iterator", - "version": "6.0.2", + "version": "7.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "a248d1640ab059b075f53a2ef0f9856e864e06b5" + "reference": "9bb4e6c58b62c1e043be995c66abec7c97307aae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/a248d1640ab059b075f53a2ef0f9856e864e06b5", - "reference": "a248d1640ab059b075f53a2ef0f9856e864e06b5", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/9bb4e6c58b62c1e043be995c66abec7c97307aae", + "reference": "9bb4e6c58b62c1e043be995c66abec7c97307aae", "shasum": "" }, "require": { - "php": ">=8.3" + "php": ">=8.4" }, "require-dev": { - "phpunit/phpunit": "^12.5.33" + "phpunit/phpunit": "^13.3.1" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "6.0-dev" + "dev-main": "7.0-dev" } }, "autoload": { @@ -386,7 +387,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", "security": "https://github.com/sebastianbergmann/php-file-iterator/security/policy", - "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/6.0.2" + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/7.0.2" }, "funding": [ { @@ -406,29 +407,29 @@ "type": "tidelift" } ], - "time": "2026-08-25T14:40:53+00:00", - "published-time": "2026-08-25T14:41:57+00:00" + "time": "2026-08-25T14:47:43+00:00", + "published-time": "2026-08-25T14:48:49+00:00" }, { "name": "phpunit/php-invoker", - "version": "6.0.0", + "version": "7.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-invoker.git", - "reference": "12b54e689b07a25a9b41e57736dfab6ec9ae5406" + "reference": "42e5c5cae0c65df12d1b1a3ab52bf3f50f244d88" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/12b54e689b07a25a9b41e57736dfab6ec9ae5406", - "reference": "12b54e689b07a25a9b41e57736dfab6ec9ae5406", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/42e5c5cae0c65df12d1b1a3ab52bf3f50f244d88", + "reference": "42e5c5cae0c65df12d1b1a3ab52bf3f50f244d88", "shasum": "" }, "require": { - "php": ">=8.3" + "php": ">=8.4" }, "require-dev": { "ext-pcntl": "*", - "phpunit/phpunit": "^12.0" + "phpunit/phpunit": "^13.0" }, "suggest": { "ext-pcntl": "*" @@ -436,7 +437,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "6.0-dev" + "dev-main": "7.0-dev" } }, "autoload": { @@ -463,41 +464,53 @@ "support": { "issues": "https://github.com/sebastianbergmann/php-invoker/issues", "security": "https://github.com/sebastianbergmann/php-invoker/security/policy", - "source": "https://github.com/sebastianbergmann/php-invoker/tree/6.0.0" + "source": "https://github.com/sebastianbergmann/php-invoker/tree/7.0.0" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpunit/php-invoker", + "type": "tidelift" } ], - "time": "2025-02-07T04:58:58+00:00", - "published-time": "2025-02-07T04:59:09+00:00" + "time": "2026-02-06T04:34:47+00:00", + "published-time": "2026-02-06T04:35:29+00:00" }, { "name": "phpunit/php-text-template", - "version": "5.0.1", + "version": "6.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "babab73b7ef9fae406f2eb3ee11323a61caa63d5" + "reference": "97107691cb2b6c743b5e0c44be19e983cb337a02" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/babab73b7ef9fae406f2eb3ee11323a61caa63d5", - "reference": "babab73b7ef9fae406f2eb3ee11323a61caa63d5", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/97107691cb2b6c743b5e0c44be19e983cb337a02", + "reference": "97107691cb2b6c743b5e0c44be19e983cb337a02", "shasum": "" }, "require": { - "php": ">=8.3" + "php": ">=8.4" }, "require-dev": { - "phpunit/phpunit": "^12.5.37" + "phpunit/phpunit": "^13.3.6" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "5.0-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -524,7 +537,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/php-text-template/issues", "security": "https://github.com/sebastianbergmann/php-text-template/security/policy", - "source": "https://github.com/sebastianbergmann/php-text-template/tree/5.0.1" + "source": "https://github.com/sebastianbergmann/php-text-template/tree/6.0.1" }, "funding": [ { @@ -544,33 +557,33 @@ "type": "tidelift" } ], - "time": "2026-10-03T04:51:29+00:00", + "time": "2026-10-03T04:54:24+00:00", "published-time": "2026-10-03T04:54:39+00:00" }, { "name": "phpunit/php-timer", - "version": "8.0.0", + "version": "9.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "f258ce36aa457f3aa3339f9ed4c81fc66dc8c2cc" + "reference": "a0e12065831f6ab0d83120dc61513eb8d9a966f6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/f258ce36aa457f3aa3339f9ed4c81fc66dc8c2cc", - "reference": "f258ce36aa457f3aa3339f9ed4c81fc66dc8c2cc", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/a0e12065831f6ab0d83120dc61513eb8d9a966f6", + "reference": "a0e12065831f6ab0d83120dc61513eb8d9a966f6", "shasum": "" }, "require": { - "php": ">=8.3" + "php": ">=8.4" }, "require-dev": { - "phpunit/phpunit": "^12.0" + "phpunit/phpunit": "^13.0" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "8.0-dev" + "dev-main": "9.0-dev" } }, "autoload": { @@ -597,29 +610,41 @@ "support": { "issues": "https://github.com/sebastianbergmann/php-timer/issues", "security": "https://github.com/sebastianbergmann/php-timer/security/policy", - "source": "https://github.com/sebastianbergmann/php-timer/tree/8.0.0" + "source": "https://github.com/sebastianbergmann/php-timer/tree/9.0.0" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpunit/php-timer", + "type": "tidelift" } ], - "time": "2025-02-07T04:59:38+00:00", - "published-time": "2025-02-07T04:59:52+00:00" + "time": "2026-02-06T04:37:53+00:00", + "published-time": "2026-02-06T04:38:39+00:00" }, { "name": "phpunit/phpunit", - "version": "12.5.45", + "version": "13.4.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "ca97be2931de6a0adf824da12889cbf935a016e9" + "reference": "291e66a76eb39f2fb8f880d38edc30dbd7acd9a2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/ca97be2931de6a0adf824da12889cbf935a016e9", - "reference": "ca97be2931de6a0adf824da12889cbf935a016e9", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/291e66a76eb39f2fb8f880d38edc30dbd7acd9a2", + "reference": "291e66a76eb39f2fb8f880d38edc30dbd7acd9a2", "shasum": "" }, "require": { @@ -632,22 +657,24 @@ "myclabs/deep-copy": "^1.14.0", "phar-io/manifest": "^2.0.4", "phar-io/version": "^3.2.1", - "php": ">=8.3", - "phpunit/php-code-coverage": "^12.5.8", - "phpunit/php-file-iterator": "^6.0.2", - "phpunit/php-invoker": "^6.0.0", - "phpunit/php-text-template": "^5.0.1", - "phpunit/php-timer": "^8.0.0", - "sebastian/cli-parser": "^4.2.1", - "sebastian/comparator": "^7.1.8", - "sebastian/diff": "^7.0.1", - "sebastian/environment": "^8.1.2", - "sebastian/exporter": "^7.0.3", - "sebastian/global-state": "^8.0.3", - "sebastian/object-enumerator": "^7.0.0", - "sebastian/recursion-context": "^7.0.1", - "sebastian/type": "^6.0.4", - "sebastian/version": "^6.0.2", + "php": ">=8.4.1", + "phpunit/php-code-coverage": "^14.5.2", + "phpunit/php-file-iterator": "^7.0.2", + "phpunit/php-invoker": "^7.0.0", + "phpunit/php-text-template": "^6.0.1", + "phpunit/php-timer": "^9.0.0", + "sebastian/cli-parser": "^5.0.1", + "sebastian/comparator": "^8.4", + "sebastian/diff": "^9.0.1", + "sebastian/environment": "^9.3.3", + "sebastian/exporter": "^8.2.1", + "sebastian/file-filter": "^1.0", + "sebastian/git-state": "^1.1", + "sebastian/global-state": "^9.0.1", + "sebastian/object-enumerator": "^8.1.0", + "sebastian/recursion-context": "^8.0.1", + "sebastian/type": "^7.0.2", + "sebastian/version": "^7.1.0", "staabm/side-effects-detector": "^1.0.5" }, "bin": [ @@ -656,7 +683,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "12.5-dev" + "dev-main": "13.4-dev" } }, "autoload": { @@ -688,7 +715,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/12.5.45" + "source": "https://github.com/sebastianbergmann/phpunit/tree/13.4.8" }, "funding": [ { @@ -696,33 +723,33 @@ "type": "other" } ], - "time": "2026-11-19T12:16:09+00:00", - "published-time": "2026-11-19T12:17:59+00:00" + "time": "2026-11-19T12:17:15+00:00", + "published-time": "2026-11-19T12:18:28+00:00" }, { "name": "sebastian/cli-parser", - "version": "4.2.1", + "version": "5.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/cli-parser.git", - "reference": "7d05781b13f7dec9043a629a21d086ed74582a15" + "reference": "eeb759ad3146b7096fb59c3195d39e071cd409e3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/7d05781b13f7dec9043a629a21d086ed74582a15", - "reference": "7d05781b13f7dec9043a629a21d086ed74582a15", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/eeb759ad3146b7096fb59c3195d39e071cd409e3", + "reference": "eeb759ad3146b7096fb59c3195d39e071cd409e3", "shasum": "" }, "require": { - "php": ">=8.3" + "php": ">=8.4" }, "require-dev": { - "phpunit/phpunit": "^12.5.25" + "phpunit/phpunit": "^13.2.6" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "4.2-dev" + "dev-main": "5.0-dev" } }, "autoload": { @@ -746,7 +773,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/cli-parser/issues", "security": "https://github.com/sebastianbergmann/cli-parser/security/policy", - "source": "https://github.com/sebastianbergmann/cli-parser/tree/4.2.1" + "source": "https://github.com/sebastianbergmann/cli-parser/tree/5.0.1" }, "funding": [ { @@ -766,32 +793,32 @@ "type": "tidelift" } ], - "time": "2026-05-17T05:29:34+00:00", - "published-time": "2026-05-17T05:30:34+00:00" + "time": "2026-08-01T04:27:14+00:00", + "published-time": "2026-08-01T04:29:01+00:00" }, { "name": "sebastian/comparator", - "version": "7.1.8", + "version": "8.4.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "7c65c1e79836812819705b473a90c12399542485" + "reference": "3b070e608146cba00fd6fd1f0ffba89e5a8897fb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/7c65c1e79836812819705b473a90c12399542485", - "reference": "7c65c1e79836812819705b473a90c12399542485", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/3b070e608146cba00fd6fd1f0ffba89e5a8897fb", + "reference": "3b070e608146cba00fd6fd1f0ffba89e5a8897fb", "shasum": "" }, "require": { "ext-dom": "*", "ext-mbstring": "*", - "php": ">=8.3", - "sebastian/diff": "^7.0", - "sebastian/exporter": "^7.0.3" + "php": ">=8.4", + "sebastian/diff": "^9.0", + "sebastian/exporter": "^8.2" }, "require-dev": { - "phpunit/phpunit": "^12.5.25" + "phpunit/phpunit": "^13.3" }, "suggest": { "ext-bcmath": "For comparing BcMath\\Number objects" @@ -799,7 +826,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "7.1-dev" + "dev-main": "8.4-dev" } }, "autoload": { @@ -839,7 +866,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/comparator/issues", "security": "https://github.com/sebastianbergmann/comparator/security/policy", - "source": "https://github.com/sebastianbergmann/comparator/tree/7.1.8" + "source": "https://github.com/sebastianbergmann/comparator/tree/8.4.0" }, "funding": [ { @@ -859,34 +886,34 @@ "type": "tidelift" } ], - "time": "2026-05-21T04:45:25+00:00", - "published-time": "2026-05-21T04:45:36+00:00" + "time": "2026-08-07T07:23:13+00:00", + "published-time": "2026-08-07T07:23:29+00:00" }, { "name": "sebastian/complexity", - "version": "5.0.0", + "version": "6.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/complexity.git", - "reference": "bad4316aba5303d0221f43f8cee37eb58d384bbb" + "reference": "c5651c795c98093480df79350cb050813fc7a2f3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/bad4316aba5303d0221f43f8cee37eb58d384bbb", - "reference": "bad4316aba5303d0221f43f8cee37eb58d384bbb", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/c5651c795c98093480df79350cb050813fc7a2f3", + "reference": "c5651c795c98093480df79350cb050813fc7a2f3", "shasum": "" }, "require": { "nikic/php-parser": "^5.0", - "php": ">=8.3" + "php": ">=8.4" }, "require-dev": { - "phpunit/phpunit": "^12.0" + "phpunit/phpunit": "^13.0" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "5.0-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -910,42 +937,54 @@ "support": { "issues": "https://github.com/sebastianbergmann/complexity/issues", "security": "https://github.com/sebastianbergmann/complexity/security/policy", - "source": "https://github.com/sebastianbergmann/complexity/tree/5.0.0" + "source": "https://github.com/sebastianbergmann/complexity/tree/6.0.0" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/complexity", + "type": "tidelift" } ], - "time": "2025-02-07T04:55:25+00:00", - "published-time": "2025-02-07T04:55:36+00:00" + "time": "2026-02-06T04:41:32+00:00", + "published-time": "2026-02-06T04:41:49+00:00" }, { "name": "sebastian/diff", - "version": "7.0.1", + "version": "9.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "cd4cabe39f8a4e8ee6818ba99f10a05561ea4ad6" + "reference": "a2df6626c1baf31d5a88674882a3072f151b5a26" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/cd4cabe39f8a4e8ee6818ba99f10a05561ea4ad6", - "reference": "cd4cabe39f8a4e8ee6818ba99f10a05561ea4ad6", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/a2df6626c1baf31d5a88674882a3072f151b5a26", + "reference": "a2df6626c1baf31d5a88674882a3072f151b5a26", "shasum": "" }, "require": { - "php": ">=8.3" + "php": ">=8.4" }, "require-dev": { - "phpunit/phpunit": "^12.5.33", + "phpunit/phpunit": "^13.3.1", "symfony/process": "^7.4.17" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "7.0-dev" + "dev-main": "9.0-dev" } }, "autoload": { @@ -978,7 +1017,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", "security": "https://github.com/sebastianbergmann/diff/security/policy", - "source": "https://github.com/sebastianbergmann/diff/tree/7.0.1" + "source": "https://github.com/sebastianbergmann/diff/tree/9.0.1" }, "funding": [ { @@ -998,28 +1037,28 @@ "type": "tidelift" } ], - "time": "2026-08-25T15:35:54+00:00", - "published-time": "2026-08-25T15:37:16+00:00" + "time": "2026-08-25T15:38:55+00:00", + "published-time": "2026-08-25T15:39:44+00:00" }, { "name": "sebastian/environment", - "version": "8.1.2", + "version": "9.3.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "9d32c685773823b1983e256ae4ecd48a10d6e439" + "reference": "d4dd10267a11055066a2a78ae04583d8ddd4f595" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/9d32c685773823b1983e256ae4ecd48a10d6e439", - "reference": "9d32c685773823b1983e256ae4ecd48a10d6e439", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/d4dd10267a11055066a2a78ae04583d8ddd4f595", + "reference": "d4dd10267a11055066a2a78ae04583d8ddd4f595", "shasum": "" }, "require": { - "php": ">=8.3" + "php": ">=8.4" }, "require-dev": { - "phpunit/phpunit": "^12.5.26" + "phpunit/phpunit": "^13.3.6" }, "suggest": { "ext-posix": "*" @@ -1027,7 +1066,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "8.1-dev" + "dev-main": "9.3-dev" } }, "autoload": { @@ -1055,7 +1094,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/environment/issues", "security": "https://github.com/sebastianbergmann/environment/security/policy", - "source": "https://github.com/sebastianbergmann/environment/tree/8.1.2" + "source": "https://github.com/sebastianbergmann/environment/tree/9.3.3" }, "funding": [ { @@ -1075,35 +1114,35 @@ "type": "tidelift" } ], - "time": "2026-05-25T13:40:20+00:00", - "published-time": "2026-05-25T13:40:39+00:00" + "time": "2026-10-01T12:37:56+00:00", + "published-time": "2026-10-01T12:38:48+00:00" }, { "name": "sebastian/exporter", - "version": "7.0.3", + "version": "8.2.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "c5e21b5de653ce0a769fb36f5cdfcb5e7a32cf23" + "reference": "24a3b69bba4a12ab615fca9d34680c5598d9ab7a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/c5e21b5de653ce0a769fb36f5cdfcb5e7a32cf23", - "reference": "c5e21b5de653ce0a769fb36f5cdfcb5e7a32cf23", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/24a3b69bba4a12ab615fca9d34680c5598d9ab7a", + "reference": "24a3b69bba4a12ab615fca9d34680c5598d9ab7a", "shasum": "" }, "require": { "ext-mbstring": "*", - "php": ">=8.3", - "sebastian/recursion-context": "^7.0.1" + "php": ">=8.4", + "sebastian/recursion-context": "^8.0.1" }, "require-dev": { - "phpunit/phpunit": "^12.5.25" + "phpunit/phpunit": "^13.3" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "7.0-dev" + "dev-main": "8.2-dev" } }, "autoload": { @@ -1146,7 +1185,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", "security": "https://github.com/sebastianbergmann/exporter/security/policy", - "source": "https://github.com/sebastianbergmann/exporter/tree/7.0.3" + "source": "https://github.com/sebastianbergmann/exporter/tree/8.2.1" }, "funding": [ { @@ -1166,36 +1205,176 @@ "type": "tidelift" } ], - "time": "2026-05-20T04:37:17+00:00", - "published-time": "2026-05-20T04:37:31+00:00" + "time": "2026-08-07T07:22:06+00:00", + "published-time": "2026-08-07T07:23:47+00:00" + }, + { + "name": "sebastian/file-filter", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/file-filter.git", + "reference": "33a26f394330f6faa7684bb9cc73afb7727aae93" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/file-filter/zipball/33a26f394330f6faa7684bb9cc73afb7727aae93", + "reference": "33a26f394330f6faa7684bb9cc73afb7727aae93", + "shasum": "" + }, + "require": { + "php": ">=8.4" + }, + "require-dev": { + "phpunit/phpunit": "^13.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for filtering files", + "homepage": "https://github.com/sebastianbergmann/file-filter", + "support": { + "issues": "https://github.com/sebastianbergmann/file-filter/issues", + "security": "https://github.com/sebastianbergmann/file-filter/security/policy", + "source": "https://github.com/sebastianbergmann/file-filter/tree/1.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/file-filter", + "type": "tidelift" + } + ], + "time": "2026-04-22T07:20:04+00:00", + "published-time": "2026-04-22T07:20:25+00:00" + }, + { + "name": "sebastian/git-state", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/git-state.git", + "reference": "31a565f463686f0eefa85f899549256bf5805985" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/git-state/zipball/31a565f463686f0eefa85f899549256bf5805985", + "reference": "31a565f463686f0eefa85f899549256bf5805985", + "shasum": "" + }, + "require": { + "php": ">=8.4" + }, + "require-dev": { + "phpunit/phpunit": "^13.4.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for describing the state of a Git checkout", + "homepage": "https://github.com/sebastianbergmann/git-state", + "support": { + "issues": "https://github.com/sebastianbergmann/git-state/issues", + "security": "https://github.com/sebastianbergmann/git-state/security/policy", + "source": "https://github.com/sebastianbergmann/git-state/tree/1.1.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/git-state", + "type": "tidelift" + } + ], + "time": "2026-10-21T05:59:52+00:00", + "published-time": "2026-10-21T06:01:28+00:00" }, { "name": "sebastian/global-state", - "version": "8.0.3", + "version": "9.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "b164d3274d6537ab462591c5755f76a8f5b1aae9" + "reference": "ba68ba79da690cf7eddefd3ce5b78b20b9ba9945" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/b164d3274d6537ab462591c5755f76a8f5b1aae9", - "reference": "b164d3274d6537ab462591c5755f76a8f5b1aae9", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/ba68ba79da690cf7eddefd3ce5b78b20b9ba9945", + "reference": "ba68ba79da690cf7eddefd3ce5b78b20b9ba9945", "shasum": "" }, "require": { - "php": ">=8.3", - "sebastian/object-reflector": "^5.0", - "sebastian/recursion-context": "^7.0.1" + "php": ">=8.4", + "sebastian/object-reflector": "^6.0", + "sebastian/recursion-context": "^8.0" }, "require-dev": { "ext-dom": "*", - "phpunit/phpunit": "^12.5.28" + "phpunit/phpunit": "^13.1.13" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "8.0-dev" + "dev-main": "9.0-dev" } }, "autoload": { @@ -1221,7 +1400,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/global-state/issues", "security": "https://github.com/sebastianbergmann/global-state/security/policy", - "source": "https://github.com/sebastianbergmann/global-state/tree/8.0.3" + "source": "https://github.com/sebastianbergmann/global-state/tree/9.0.1" }, "funding": [ { @@ -1241,34 +1420,34 @@ "type": "tidelift" } ], - "time": "2026-06-01T15:10:33+00:00", + "time": "2026-06-01T15:11:33+00:00", "published-time": "2026-06-01T15:20:45+00:00" }, { "name": "sebastian/lines-of-code", - "version": "4.0.1", + "version": "5.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/lines-of-code.git", - "reference": "d543b8ef219dcd8da262cbb958639a96bedba10e" + "reference": "d1b6f8fce682505dbd048977f1abedf1b8ad3ff8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/d543b8ef219dcd8da262cbb958639a96bedba10e", - "reference": "d543b8ef219dcd8da262cbb958639a96bedba10e", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/d1b6f8fce682505dbd048977f1abedf1b8ad3ff8", + "reference": "d1b6f8fce682505dbd048977f1abedf1b8ad3ff8", "shasum": "" }, "require": { - "nikic/php-parser": "^5.7.0", - "php": ">=8.3" + "nikic/php-parser": "^5.8.0", + "php": ">=8.4" }, "require-dev": { - "phpunit/phpunit": "^12.5.25" + "phpunit/phpunit": "^13.2.4" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "4.0-dev" + "dev-main": "5.0-dev" } }, "autoload": { @@ -1292,7 +1471,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", "security": "https://github.com/sebastianbergmann/lines-of-code/security/policy", - "source": "https://github.com/sebastianbergmann/lines-of-code/tree/4.0.1" + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/5.0.2" }, "funding": [ { @@ -1312,35 +1491,34 @@ "type": "tidelift" } ], - "time": "2026-05-19T16:22:07+00:00", - "published-time": "2026-05-19T16:22:47+00:00" + "time": "2026-07-09T08:42:34+00:00", + "published-time": "2026-07-09T08:44:06+00:00" }, { "name": "sebastian/object-enumerator", - "version": "7.0.0", + "version": "8.1.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "1effe8e9b8e068e9ae228e542d5d11b5d16db894" + "reference": "511064ecde82bd747e2ba2fab3dda8d977b59576" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/1effe8e9b8e068e9ae228e542d5d11b5d16db894", - "reference": "1effe8e9b8e068e9ae228e542d5d11b5d16db894", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/511064ecde82bd747e2ba2fab3dda8d977b59576", + "reference": "511064ecde82bd747e2ba2fab3dda8d977b59576", "shasum": "" }, "require": { - "php": ">=8.3", - "sebastian/object-reflector": "^5.0", - "sebastian/recursion-context": "^7.0" + "php": ">=8.4", + "sebastian/recursion-context": "^8.0.1" }, "require-dev": { - "phpunit/phpunit": "^12.0" + "phpunit/phpunit": "^13.3.0" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "7.0-dev" + "dev-main": "8.1-dev" } }, "autoload": { @@ -1363,41 +1541,53 @@ "support": { "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", "security": "https://github.com/sebastianbergmann/object-enumerator/security/policy", - "source": "https://github.com/sebastianbergmann/object-enumerator/tree/7.0.0" + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/8.1.0" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/object-enumerator", + "type": "tidelift" } ], - "time": "2025-02-07T04:57:48+00:00", - "published-time": "2025-02-07T04:58:08+00:00" + "time": "2026-08-13T07:05:05+00:00", + "published-time": "2026-08-13T07:07:58+00:00" }, { "name": "sebastian/object-reflector", - "version": "5.0.0", + "version": "6.1.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "4bfa827c969c98be1e527abd576533293c634f6a" + "reference": "f71bbcdc4f95456b4622810bec64eb06372e25b2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/4bfa827c969c98be1e527abd576533293c634f6a", - "reference": "4bfa827c969c98be1e527abd576533293c634f6a", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/f71bbcdc4f95456b4622810bec64eb06372e25b2", + "reference": "f71bbcdc4f95456b4622810bec64eb06372e25b2", "shasum": "" }, "require": { - "php": ">=8.3" + "php": ">=8.4" }, "require-dev": { - "phpunit/phpunit": "^12.0" + "phpunit/phpunit": "^13.3.0" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "5.0-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -1420,41 +1610,53 @@ "support": { "issues": "https://github.com/sebastianbergmann/object-reflector/issues", "security": "https://github.com/sebastianbergmann/object-reflector/security/policy", - "source": "https://github.com/sebastianbergmann/object-reflector/tree/5.0.0" + "source": "https://github.com/sebastianbergmann/object-reflector/tree/6.1.0" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/object-reflector", + "type": "tidelift" } ], - "time": "2025-02-07T04:58:17+00:00", - "published-time": "2025-02-07T04:58:28+00:00" + "time": "2026-08-13T06:34:36+00:00", + "published-time": "2026-08-13T06:39:22+00:00" }, { "name": "sebastian/recursion-context", - "version": "7.0.1", + "version": "8.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "0b01998a7d5b1f122911a66bebcb8d46f0c82d8c" + "reference": "32dba72f2b4642d6a93db22d6c0a9280ff2e3ca0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/0b01998a7d5b1f122911a66bebcb8d46f0c82d8c", - "reference": "0b01998a7d5b1f122911a66bebcb8d46f0c82d8c", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/32dba72f2b4642d6a93db22d6c0a9280ff2e3ca0", + "reference": "32dba72f2b4642d6a93db22d6c0a9280ff2e3ca0", "shasum": "" }, "require": { - "php": ">=8.3" + "php": ">=8.4" }, "require-dev": { - "phpunit/phpunit": "^12.0" + "phpunit/phpunit": "^13.2.6" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "7.0-dev" + "dev-main": "8.0-dev" } }, "autoload": { @@ -1485,7 +1687,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/recursion-context/issues", "security": "https://github.com/sebastianbergmann/recursion-context/security/policy", - "source": "https://github.com/sebastianbergmann/recursion-context/tree/7.0.1" + "source": "https://github.com/sebastianbergmann/recursion-context/tree/8.0.1" }, "funding": [ { @@ -1505,33 +1707,33 @@ "type": "tidelift" } ], - "time": "2025-08-13T04:44:59+00:00", - "published-time": "2025-08-13T04:45:10+00:00" + "time": "2026-08-03T05:58:12+00:00", + "published-time": "2026-08-03T05:59:59+00:00" }, { "name": "sebastian/type", - "version": "6.0.4", + "version": "7.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/type.git", - "reference": "82ff822c2edc46724be9f7411d3163021f602773" + "reference": "bd1df467864cb95140414059a535b2d906173fcf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/82ff822c2edc46724be9f7411d3163021f602773", - "reference": "82ff822c2edc46724be9f7411d3163021f602773", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/bd1df467864cb95140414059a535b2d906173fcf", + "reference": "bd1df467864cb95140414059a535b2d906173fcf", "shasum": "" }, "require": { - "php": ">=8.3" + "php": ">=8.4" }, "require-dev": { - "phpunit/phpunit": "^12.5.25" + "phpunit/phpunit": "^13.3.0" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "6.0-dev" + "dev-main": "7.0-dev" } }, "autoload": { @@ -1555,7 +1757,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/type/issues", "security": "https://github.com/sebastianbergmann/type/security/policy", - "source": "https://github.com/sebastianbergmann/type/tree/6.0.4" + "source": "https://github.com/sebastianbergmann/type/tree/7.0.2" }, "funding": [ { @@ -1575,30 +1777,30 @@ "type": "tidelift" } ], - "time": "2026-05-20T06:45:45+00:00", - "published-time": "2026-05-20T06:50:13+00:00" + "time": "2026-08-10T08:00:57+00:00", + "published-time": "2026-08-10T08:01:43+00:00" }, { "name": "sebastian/version", - "version": "6.0.2", + "version": "7.1.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/version.git", - "reference": "a8b6643a19ba6c8125a473623e45fb8cbb0e4159" + "reference": "08e41d0c7e146bfc8cef7e63989b1294453a6d6a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/a8b6643a19ba6c8125a473623e45fb8cbb0e4159", - "reference": "a8b6643a19ba6c8125a473623e45fb8cbb0e4159", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/08e41d0c7e146bfc8cef7e63989b1294453a6d6a", + "reference": "08e41d0c7e146bfc8cef7e63989b1294453a6d6a", "shasum": "" }, "require": { - "php": ">=8.3" + "php": ">=8.4" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "6.0-dev" + "dev-main": "7.1-dev" } }, "autoload": { @@ -1622,7 +1824,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/version/issues", "security": "https://github.com/sebastianbergmann/version/security/policy", - "source": "https://github.com/sebastianbergmann/version/tree/6.0.2" + "source": "https://github.com/sebastianbergmann/version/tree/7.1.0" }, "funding": [ { @@ -1642,8 +1844,66 @@ "type": "tidelift" } ], - "time": "2026-11-09T06:30:55+00:00", - "published-time": "2026-11-09T06:31:20+00:00" + "time": "2026-11-09T06:31:27+00:00", + "published-time": "2026-11-09T06:31:50+00:00" + }, + { + "name": "shipmonk/turbocov-phpunit", + "version": "0.1.0", + "source": { + "type": "git", + "url": "https://github.com/shipmonk-rnd/turbocov-phpunit.git", + "reference": "05b4fc716639c1e2d35c66d8352487ed485ab682" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/shipmonk-rnd/turbocov-phpunit/zipball/05b4fc716639c1e2d35c66d8352487ed485ab682", + "reference": "05b4fc716639c1e2d35c66d8352487ed485ab682", + "shasum": "" + }, + "require": { + "ext-turbocov": "*", + "php": "^8.4", + "phpunit/php-code-coverage": "^14.3" + }, + "require-dev": { + "editorconfig-checker/editorconfig-checker": "10.7.0", + "ergebnis/composer-normalize": "2.48.2", + "phpstan/phpstan": "2.2.0", + "phpstan/phpstan-phpunit": "2.0.16", + "phpstan/phpstan-strict-rules": "2.0.11", + "phpunit/phpunit": "^13.3", + "shipmonk/coding-standard": "^0.2.4", + "shipmonk/composer-dependency-analyser": "1.8.4", + "shipmonk/dead-code-detector": "^1.0", + "shipmonk/name-collision-detector": "2.1.1", + "shipmonk/phpstan-rules": "4.3.6" + }, + "type": "library", + "autoload": { + "psr-4": { + "ShipMonk\\Turbocov\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHPUnit code coverage driver for the turbocov extension, which runs covered code at plain PHP speed", + "keywords": [ + "Xdebug", + "code coverage", + "pcov", + "phpunit", + "testing", + "turbocov" + ], + "support": { + "issues": "https://github.com/shipmonk-rnd/turbocov-phpunit/issues", + "source": "https://github.com/shipmonk-rnd/turbocov-phpunit/tree/0.1.0" + }, + "time": "2026-11-20T07:33:18+00:00", + "published-time": "2026-11-20T07:47:14+00:00" }, { "name": "staabm/side-effects-detector", @@ -1697,57 +1957,6 @@ ], "time": "2024-10-20T05:08:20+00:00", "published-time": "2024-10-20T05:09:39+00:00" - }, - { - "name": "theseer/tokenizer", - "version": "2.0.1", - "source": { - "type": "git", - "url": "https://github.com/theseer/tokenizer.git", - "reference": "7989e43bf381af0eac72e4f0ca5bcbfa81658be4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/7989e43bf381af0eac72e4f0ca5bcbfa81658be4", - "reference": "7989e43bf381af0eac72e4f0ca5bcbfa81658be4", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-tokenizer": "*", - "ext-xmlwriter": "*", - "php": "^8.1" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - } - ], - "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", - "support": { - "issues": "https://github.com/theseer/tokenizer/issues", - "source": "https://github.com/theseer/tokenizer/tree/2.0.1" - }, - "funding": [ - { - "url": "https://github.com/theseer", - "type": "github" - } - ], - "time": "2025-12-08T11:19:18+00:00", - "published-time": "2025-12-08T11:19:39+00:00" } ], "aliases": [], @@ -1760,7 +1969,8 @@ "php": "~8.5.0 || ~8.6.0" }, "platform-overrides": { - "php": "8.5.0" + "php": "8.5.0", + "ext-turbocov": "0.1.2" }, "plugin-api-version": "2.11.0" } diff --git a/web/landing/tests/Flow/Website/Tests/Integration/ExamplesTest.php b/web/landing/tests/Flow/Website/Tests/Integration/ExamplesTest.php index c77a11a0bf..5bb753e7a7 100644 --- a/web/landing/tests/Flow/Website/Tests/Integration/ExamplesTest.php +++ b/web/landing/tests/Flow/Website/Tests/Integration/ExamplesTest.php @@ -116,7 +116,7 @@ public function test_throw_exception_when_example_code_does_not_exists(): void $service = new Examples($path); $this->expectException(ExampleNotFound::class); - $this->expectExceptionMessage('Example "topic_1/example_1" does not exist.'); + $this->expectExceptionMessageIsOrContains('Example "topic_1/example_1" does not exist.'); $service->code('topic_1', 'example_1'); } @@ -127,7 +127,7 @@ public function test_throw_exception_when_topic_directory_does_not_exists(): voi $service = new Examples($path); $this->expectException(ExampleNotFound::class); - $this->expectExceptionMessage('Topic "non_existing_topic" does not exist.'); + $this->expectExceptionMessageIsOrContains('Topic "non_existing_topic" does not exist.'); $service->examples('non_existing_topic'); } @@ -138,7 +138,7 @@ public function test_throw_exception_when_topic_directory_is_empty(): void $service = new Examples($path); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage( + $this->expectExceptionMessageIsOrContains( 'Topic "topic_1" doesn\'t have any example, there should be at least one example in path', ); @@ -238,7 +238,7 @@ public function test_meta_of_an_unknown_example_throws(): void $service = new Examples(__DIR__ . '/../Fixtures/Valid'); $this->expectException(ExampleNotFound::class); - $this->expectExceptionMessage('Example "topic_1/example_9" does not exist.'); + $this->expectExceptionMessageIsOrContains('Example "topic_1/example_9" does not exist.'); $service->meta('topic_1', 'example_9'); } @@ -248,7 +248,7 @@ public function test_meta_of_an_unknown_option_throws(): void $service = new Examples(__DIR__ . '/../Fixtures/WithDataFiles'); $this->expectException(ExampleNotFound::class); - $this->expectExceptionMessage('Option "data_topic/option_example/missing" does not exist.'); + $this->expectExceptionMessageIsOrContains('Option "data_topic/option_example/missing" does not exist.'); $service->meta('data_topic', 'option_example', 'missing'); } @@ -268,7 +268,9 @@ public function test_throw_exception_when_topics_directory_is_empty(): void $service = new Examples($path); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Topics root directory doesn\'t exists, it should be located in path:'); + $this->expectExceptionMessageIsOrContains( + 'Topics root directory doesn\'t exists, it should be located in path:', + ); $service->topics(); } diff --git a/web/landing/tests/Flow/Website/Tests/Integration/FlowManifestRendererTest.php b/web/landing/tests/Flow/Website/Tests/Integration/FlowManifestRendererTest.php index 7d710fe289..c511285db3 100644 --- a/web/landing/tests/Flow/Website/Tests/Integration/FlowManifestRendererTest.php +++ b/web/landing/tests/Flow/Website/Tests/Integration/FlowManifestRendererTest.php @@ -123,7 +123,7 @@ public function test_throws_when_manifest_file_is_missing(): void ); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Flow manifest not found'); + $this->expectExceptionMessageIsOrContains('Flow manifest not found'); $converter->convert('[FLOW_MANIFEST]'); } diff --git a/web/landing/tests/Flow/Website/Tests/Unit/Service/Manifest/ManifestTest.php b/web/landing/tests/Flow/Website/Tests/Unit/Service/Manifest/ManifestTest.php index 8d16a4c696..cb4b158127 100644 --- a/web/landing/tests/Flow/Website/Tests/Unit/Service/Manifest/ManifestTest.php +++ b/web/landing/tests/Flow/Website/Tests/Unit/Service/Manifest/ManifestTest.php @@ -108,7 +108,7 @@ public function test_throws_when_file_missing(): void $manifest = new Manifest('/no/such/manifest.json'); $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Flow manifest not found'); + $this->expectExceptionMessageIsOrContains('Flow manifest not found'); $manifest->all(); } diff --git a/web/landing/tests/Flow/Website/Tests/Unit/Service/Markdown/FlowCodeRendererTest.php b/web/landing/tests/Flow/Website/Tests/Unit/Service/Markdown/FlowCodeRendererTest.php index 08ce40b727..0ff55815ab 100644 --- a/web/landing/tests/Flow/Website/Tests/Unit/Service/Markdown/FlowCodeRendererTest.php +++ b/web/landing/tests/Flow/Website/Tests/Unit/Service/Markdown/FlowCodeRendererTest.php @@ -73,7 +73,7 @@ public function test_identical_blocks_get_the_same_id(): void public function test_throws_on_incompatible_node_type(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Incompatible node type: ' . Paragraph::class); + $this->expectExceptionMessageIsOrContains('Incompatible node type: ' . Paragraph::class); new FlowCodeRenderer(new Packages(new PathPackage('/', new EmptyVersionStrategy())))->render( new Paragraph(), diff --git a/web/landing/tests/Flow/Website/Tests/Unit/Service/Markdown/MermaidCodeRendererTest.php b/web/landing/tests/Flow/Website/Tests/Unit/Service/Markdown/MermaidCodeRendererTest.php index 8c565dca0e..32a545d442 100644 --- a/web/landing/tests/Flow/Website/Tests/Unit/Service/Markdown/MermaidCodeRendererTest.php +++ b/web/landing/tests/Flow/Website/Tests/Unit/Service/Markdown/MermaidCodeRendererTest.php @@ -56,7 +56,7 @@ public function test_returns_null_for_non_mermaid_fenced_code(string $info): voi public function test_throws_on_incompatible_node_type(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Incompatible node type: ' . Paragraph::class); + $this->expectExceptionMessageIsOrContains('Incompatible node type: ' . Paragraph::class); $this->buildRenderer()->render(new Paragraph(), new NullChildNodeRenderer()); } diff --git a/web/landing/tests/Flow/Website/Tests/Unit/WorkShop/ListingsTest.php b/web/landing/tests/Flow/Website/Tests/Unit/WorkShop/ListingsTest.php index 17b4939552..878c0c2ece 100644 --- a/web/landing/tests/Flow/Website/Tests/Unit/WorkShop/ListingsTest.php +++ b/web/landing/tests/Flow/Website/Tests/Unit/WorkShop/ListingsTest.php @@ -59,7 +59,7 @@ public function test_find_by_slug_returns_the_listing_with_its_category(): void public function test_find_by_slug_throws_for_an_unknown_slug(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Listing not found: unknown'); + $this->expectExceptionMessageIsOrContains('Listing not found: unknown'); new Listings()->findBySlug('unknown'); }