Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions infection.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@
},
"bootstrap": "vendor/autoload.php",
"phpUnit": {
"customPath": "tools/phpunit/vendor/bin/phpunit"
"customPath": "tools/phpunit/vendor/bin/phpunit",
"configDir": "tools/infection"
},
"tmpDir": "var/infection/cache",
"testFrameworkOptions": "--testsuite=infection",
"minMsi": 30,
"minCoveredMsi": 75
}
7 changes: 0 additions & 7 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,6 @@
<testsuite name="adapter-xml-integration">
<directory>src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Integration</directory>
</testsuite>
<testsuite name="infection">
<directory>src/core/etl/tests/Flow/ETL/Tests/Unit</directory>
<directory>src/lib/array-dot/tests/Flow/ArrayDot/Tests/Unit</directory>
<directory>src/lib/doctrine-dbal-bulk/tests/Flow/Doctrine/Bulk/Tests/Unit</directory>
<directory>src/lib/filesystem/tests/Flow/Filesystem/Tests/Unit</directory>
<directory>src/lib/parquet/tests/Flow/Parquet/Tests/Unit</directory>
</testsuite>
</testsuites>
<source>
<include>
Expand Down
4 changes: 2 additions & 2 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
let
nixpkgs = fetchTarball {
url = "https://github.com/NixOS/nixpkgs/archive/41239f03433fe534c51a1526bed9214ab2a3582f.tar.gz";

# Oct 31, 2025
url = "https://github.com/NixOS/nixpkgs/archive/66a437ebcf6160152336e801a7ec289ba2aba3c5.tar.gz";
};

lockedPkgs = import nixpkgs {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use Flow\ETL\NativePHPRandomValueGenerator;
use Flow\ETL\Tests\FlowTestCase;
use PHPUnit\Framework\Attributes\DataProvider;

final class NativePHPRandomValueGeneratorTest extends FlowTestCase
{
Expand Down Expand Up @@ -51,7 +52,7 @@ public function test_can_create_random_int_from_given_range() : void
);
}

/** @dataProvider integers_provider */
#[DataProvider('integers_provider')]
public function test_can_create_random_string_with_given_length(int $expectedLength) : void
{
self::assertSame($expectedLength, mb_strlen((new NativePHPRandomValueGenerator())->string($expectedLength)));
Expand All @@ -69,14 +70,14 @@ public function test_empty_string_on_length_below_1() : void
);
}

/** @dataProvider invalid_range_provider */
#[DataProvider('invalid_range_provider')]
public function test_fail_on_invalid_range(int $min, int $max) : void
{
self::expectException(\ValueError::class);
(new NativePHPRandomValueGenerator())->int($min, $max);
}

/** @dataProvider valid_range_provider */
#[DataProvider('valid_range_provider')]
public function test_return_random_int_on_valid_range(int $min, int $max) : void
{
self::assertThat(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Flow\Filesystem\Exception\InvalidArgumentException;
use Flow\Filesystem\Path\{Options, UnixPath};
use Flow\Filesystem\Tests\Unit\PathTestCase;
use PHPUnit\Framework\Attributes\DataProvider;

final class UnixPathTest extends PathTestCase
{
Expand Down Expand Up @@ -221,9 +222,7 @@ public function test_options_handling() : void
self::assertEquals(['key' => 'value'], $path->options()->toArray());
}

/**
* @dataProvider pathProvider
*/
#[DataProvider('pathProvider')]
public function test_os_agnostic_logic(string $input, string $expectedPath, string $expectedScheme) : void
{
$path = new UnixPath($input);
Expand Down Expand Up @@ -311,9 +310,7 @@ public function test_path_method() : void
self::assertEquals('/path/file.txt', $path->path());
}

/**
* @dataProvider patternProvider
*/
#[DataProvider('patternProvider')]
public function test_pattern_logic(string $pattern, string $filename, bool $expected) : void
{
$patternPath = new UnixPath($pattern);
Expand Down Expand Up @@ -468,9 +465,7 @@ public function test_set_extension_without_existing_extension() : void
self::assertEquals('/path/to/file.txt', $newPath->path());
}

/**
* @dataProvider partitionProvider
*/
#[DataProvider('partitionProvider')]
public function test_shared_partition_logic(string $input, array $partitionData, string $expected) : void
{
$path = new UnixPath($input);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Flow\Filesystem\Exception\InvalidArgumentException;
use Flow\Filesystem\Path\{Options, WindowsPath};
use Flow\Filesystem\Tests\Unit\PathTestCase;
use PHPUnit\Framework\Attributes\DataProvider;

final class WindowsPathTest extends PathTestCase
{
Expand Down Expand Up @@ -253,9 +254,7 @@ public function test_options_handling() : void
self::assertEquals(['key' => 'value'], $path->options()->toArray());
}

/**
* @dataProvider pathProvider
*/
#[DataProvider('pathProvider')]
public function test_os_agnostic_logic(string $input, string $expectedPath, string $expectedScheme) : void
{
$path = new WindowsPath($input);
Expand All @@ -264,9 +263,7 @@ public function test_os_agnostic_logic(string $input, string $expectedPath, stri
self::assertEquals($expectedScheme, $path->protocol()->name);
}

/**
* @dataProvider partitionProvider
*/
#[DataProvider('partitionProvider')]
public function test_partition_logic(string $input, array $partitionData, string $expected) : void
{
$path = new WindowsPath($input);
Expand Down Expand Up @@ -364,9 +361,7 @@ public function test_pathinfo_backslash_edge_case() : void
self::assertEquals('file://', $parent->uri());
}

/**
* @dataProvider patternProvider
*/
#[DataProvider('patternProvider')]
public function test_pattern_logic(string $pattern, string $filename, bool $expected) : void
{
$patternPath = new WindowsPath($pattern);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,15 @@ public function build(WriteFlatColumnValues $data) : Dictionary
continue;
}

/** @phpstan-ignore-next-line */
if (!isset($valueToIndex[$value])) {
$key = \is_float($value) ? \serialize($value) : $value;

if (!isset($valueToIndex[$key])) {
$dictionary[] = $value;
/** @phpstan-ignore-next-line */
$valueToIndex[$value] = $dictionarySize;
$valueToIndex[$key] = $dictionarySize;
$dictionarySize++;
}

/** @phpstan-ignore-next-line */
$indices[] = $valueToIndex[$value];
$indices[] = $valueToIndex[$key];
}

foreach ($dictionary as $index => $value) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use Flow\Parquet\Exception\RuntimeException;
use Flow\Parquet\ParquetFile\Schema;
use Flow\Parquet\ParquetFile\Schema\{FlatColumn, ListElement, MapKey, MapValue, NestedColumn};
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;

final class WriteColumnDataTest extends TestCase
Expand Down Expand Up @@ -102,9 +103,7 @@ public function test_add_value_multiple_values() : void
);
}

/**
* @dataProvider valueTypesDataProvider
*/
#[DataProvider('valueTypesDataProvider')]
public function test_add_value_with_different_value_types(int|float|string|bool|null $value, string $expectedType) : void
{
/** @var FlatColumn $column */
Expand Down Expand Up @@ -222,10 +221,9 @@ public function test_flat_values_returns_all_flat_values() : void
}

/**
* @dataProvider initializeDataProvider
*
* @param array<string> $expectedFlatPaths
*/
#[DataProvider('initializeDataProvider')]
public function test_initialize_with_different_column_types(Schema $schema, string $columnPath, array $expectedFlatPaths) : void
{
$column = $schema->get($columnPath);
Expand All @@ -240,9 +238,7 @@ public function test_initialize_with_different_column_types(Schema $schema, stri
}
}

/**
* @dataProvider isEmptyDataProvider
*/
#[DataProvider('isEmptyDataProvider')]
public function test_is_empty(bool $isEmpty, \Closure $setupCallback) : void
{
/** @var FlatColumn $column */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Flow\Parquet\Tests\Unit\Thrift;

use Flow\Parquet\Thrift\MemoryBuffer;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use Thrift\Exception\TTransportException;

Expand Down Expand Up @@ -258,9 +259,7 @@ public function test_read_sequential_operations() : void
self::assertSame(0, $buffer->available());
}

/**
* @dataProvider read_length_provider
*/
#[DataProvider('read_length_provider')]
public function test_read_various_lengths(int $dataLength, int $readLength, int $expectedReadLength) : void
{
$data = \str_repeat('A', $dataLength);
Expand Down Expand Up @@ -351,9 +350,7 @@ public function test_write_multiple_times() : void
self::assertSame(11, $buffer->available());
}

/**
* @dataProvider write_data_provider
*/
#[DataProvider('write_data_provider')]
public function test_write_various_data_types(string $data) : void
{
$buffer = new MemoryBuffer();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use Flow\Parquet\ParquetFile\Schema\{FlatColumn, LogicalType, NestedColumn, PhysicalType};
use Flow\Parquet\Writer\ColumnChunkBuilder\{NestedColumnChunkBuilder, PlainFlatColumnChunkBuilder};
use Flow\Parquet\Writer\{ColumnChunkBuilder, ColumnChunkContainer};
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;

final class NestedColumnChunkBuilderTest extends TestCase
Expand Down Expand Up @@ -286,10 +287,9 @@ public function test_constructor_initializes_correctly() : void
}

/**
* @dataProvider nested_column_structures_provider
*
* @param array<FlatColumn> $children
*/
#[DataProvider('nested_column_structures_provider')]
public function test_constructor_with_different_nested_structures(array $children, string $description) : void
{
$nestedColumn = NestedColumn::create('nested', $children);
Expand Down Expand Up @@ -759,9 +759,7 @@ public function test_workflow_multiple_cycles() : void
self::assertSame(3, $containers[0]->columnChunk->valuesCount());
}

/**
* @dataProvider compression_types_provider
*/
#[DataProvider('compression_types_provider')]
public function test_workflow_with_different_compressions(Compressions $compression) : void
{
$childColumn = new FlatColumn('child', PhysicalType::INT32);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use Flow\Parquet\ParquetFile\Schema\{FlatColumn, LogicalType, PhysicalType};
use Flow\Parquet\Writer\ColumnChunkBuilder\PlainFlatColumnChunkBuilder;
use Flow\Parquet\Writer\ColumnChunkContainer;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;

final class PlainFlatColumnChunkBuilderTest extends TestCase
Expand Down Expand Up @@ -266,9 +267,7 @@ public function test_close_page_with_data() : void
self::assertGreaterThan(0, $builder->uncompressedSize());
}

/**
* @dataProvider writer_version_provider
*/
#[DataProvider('writer_version_provider')]
public function test_close_page_with_different_writer_versions(int $writerVersion) : void
{
$column = new FlatColumn('test_col', PhysicalType::INT32);
Expand Down Expand Up @@ -369,9 +368,7 @@ public function test_constructor_with_byte_array_logical_type() : void
self::assertSame($column, $builder->column());
}

/**
* @dataProvider compression_types_provider
*/
#[DataProvider('compression_types_provider')]
public function test_constructor_with_different_compressions(Compressions $compression) : void
{
$column = new FlatColumn('test_col', PhysicalType::INT32);
Expand All @@ -382,9 +379,7 @@ public function test_constructor_with_different_compressions(Compressions $compr
self::assertInstanceOf(PlainFlatColumnChunkBuilder::class, $builder);
}

/**
* @dataProvider physical_types_provider
*/
#[DataProvider('physical_types_provider')]
public function test_constructor_with_different_physical_types(PhysicalType $physicalType, mixed $sampleValue) : void
{
$column = new FlatColumn('test_col', $physicalType);
Expand Down Expand Up @@ -624,9 +619,7 @@ public function test_is_full_initially_false() : void
self::assertFalse($builder->isFull());
}

/**
* @dataProvider page_size_provider
*/
#[DataProvider('page_size_provider')]
public function test_is_full_respects_page_size_option(int $pageSize) : void
{
$column = new FlatColumn('test_col', PhysicalType::INT32);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,9 @@ public function test_add_multiple_rows() : void
}

/**
* @dataProvider dictionary_data_provider
*
* @param array<mixed> $values
*/
#[DataProvider('dictionary_data_provider')]
public function test_add_row_with_dictionary_data(array $values, string $description) : void
{
$column = new FlatColumn('test_col', PhysicalType::BYTE_ARRAY, logicalType: LogicalType::string());
Expand Down Expand Up @@ -250,9 +249,7 @@ public function test_close_page_with_data_builds_dictionary() : void
self::assertGreaterThan(0, $builder->uncompressedSize());
}

/**
* @dataProvider writer_version_provider
*/
#[DataProvider('writer_version_provider')]
public function test_close_page_with_different_writer_versions(int $writerVersion) : void
{
$column = new FlatColumn('test_col', PhysicalType::BYTE_ARRAY, logicalType: LogicalType::string());
Expand Down Expand Up @@ -329,9 +326,7 @@ public function test_constructor_initializes_correctly() : void
self::assertSame(0, $builder->uncompressedSize());
}

/**
* @dataProvider compression_types_provider
*/
#[DataProvider('compression_types_provider')]
public function test_constructor_with_different_compressions(Compressions $compression) : void
{
$column = new FlatColumn('test_col', PhysicalType::BYTE_ARRAY, logicalType: LogicalType::string());
Expand All @@ -343,10 +338,9 @@ public function test_constructor_with_different_compressions(Compressions $compr
}

/**
* @dataProvider physical_types_provider
*
* @param array<mixed> $sampleValues
*/
#[DataProvider('physical_types_provider')]
public function test_constructor_with_different_physical_types(PhysicalType $physicalType, array $sampleValues) : void
{
$column = new FlatColumn('test_col', $physicalType);
Expand Down Expand Up @@ -645,9 +639,7 @@ public function test_is_full_initially_false() : void
self::assertFalse($builder->isFull());
}

/**
* @dataProvider page_size_provider
*/
#[DataProvider('page_size_provider')]
public function test_is_full_respects_page_size_option(int $pageSize) : void
{
$column = new FlatColumn('test_col', PhysicalType::BYTE_ARRAY, logicalType: LogicalType::string());
Expand Down
Loading