From f897d2cd243fe6dc54d244ae094c8ba74ee02d44 Mon Sep 17 00:00:00 2001 From: Gustavo Freze Date: Mon, 19 Jan 2026 16:03:43 -0300 Subject: [PATCH] refactor: Updates test namespaces and file structure. Add LazyIteratorTest, improve Slice buffered slicing. --- src/Collectible.php | 89 ++++++++++++++++--- src/Internal/Operations/Retrieve/Slice.php | 19 ++-- tests/Internal/Iterators/LazyIteratorTest.php | 34 +++++++ .../CollectionReduceOperationTest.php | 2 +- .../CollectionContainsOperationTest.php | 2 +- .../Compare/CollectionEqualsOperationTest.php | 17 +++- .../Filter/CollectionFilterOperationTest.php | 2 +- .../Order/CollectionSortOperationTest.php | 2 +- .../Retrieve/CollectionFindOperationTest.php | 2 +- .../Retrieve/CollectionFirstOperationTest.php | 2 +- .../Retrieve/CollectionGetOperationTest.php | 2 +- .../Retrieve/CollectionLastOperationTest.php | 2 +- .../Retrieve/CollectionSliceOperationTest.php | 2 +- .../Transform/CollectionEachOperationTest.php | 2 +- .../CollectionFlattenOperationTest.php | 2 +- .../CollectionGroupByOperationTest.php | 2 +- .../Transform/CollectionJoinToStringTest.php | 2 +- .../Transform/CollectionMapOperationTest.php | 2 +- .../CollectionMapToArrayOperationTest.php | 2 +- .../CollectionMapToJsonOperationTest.php | 2 +- .../Write/CollectionAddOperationTest.php | 2 +- .../Write/CollectionCreateOperationTest.php | 2 +- .../Write/CollectionRemoveOperationTest.php | 2 +- 23 files changed, 161 insertions(+), 36 deletions(-) create mode 100644 tests/Internal/Iterators/LazyIteratorTest.php rename tests/{ => Internal}/Operations/Aggregate/CollectionReduceOperationTest.php (98%) rename tests/{ => Internal}/Operations/Compare/CollectionContainsOperationTest.php (97%) rename tests/{ => Internal}/Operations/Compare/CollectionEqualsOperationTest.php (86%) rename tests/{ => Internal}/Operations/Filter/CollectionFilterOperationTest.php (98%) rename tests/{ => Internal}/Operations/Order/CollectionSortOperationTest.php (99%) rename tests/{ => Internal}/Operations/Retrieve/CollectionFindOperationTest.php (98%) rename tests/{ => Internal}/Operations/Retrieve/CollectionFirstOperationTest.php (97%) rename tests/{ => Internal}/Operations/Retrieve/CollectionGetOperationTest.php (99%) rename tests/{ => Internal}/Operations/Retrieve/CollectionLastOperationTest.php (97%) rename tests/{ => Internal}/Operations/Retrieve/CollectionSliceOperationTest.php (98%) rename tests/{ => Internal}/Operations/Transform/CollectionEachOperationTest.php (97%) rename tests/{ => Internal}/Operations/Transform/CollectionFlattenOperationTest.php (96%) rename tests/{ => Internal}/Operations/Transform/CollectionGroupByOperationTest.php (98%) rename tests/{ => Internal}/Operations/Transform/CollectionJoinToStringTest.php (98%) rename tests/{ => Internal}/Operations/Transform/CollectionMapOperationTest.php (98%) rename tests/{ => Internal}/Operations/Transform/CollectionMapToArrayOperationTest.php (97%) rename tests/{ => Internal}/Operations/Transform/CollectionMapToJsonOperationTest.php (97%) rename tests/{ => Internal}/Operations/Write/CollectionAddOperationTest.php (98%) rename tests/{ => Internal}/Operations/Write/CollectionCreateOperationTest.php (96%) rename tests/{ => Internal}/Operations/Write/CollectionRemoveOperationTest.php (98%) diff --git a/src/Collectible.php b/src/Collectible.php index ab19eaf..7833d92 100644 --- a/src/Collectible.php +++ b/src/Collectible.php @@ -13,6 +13,11 @@ /** * Represents a collection that can be manipulated, iterated, and counted. * + * Complexity notes (Big O): + * - Unless stated otherwise, complexities refer to consuming the collection **once**. + * - `n`: number of elements produced when consuming the collection once. + * - Callback cost is not included (assumed O(1) per callback invocation). + * * @template Key of int|string * @template Value of mixed * @template Element of mixed @@ -23,6 +28,9 @@ interface Collectible extends Countable, IteratorAggregate /** * Creates a new Collectible instance from the given elements. * + * Complexity: O(1) time and O(1) space to create the collection. + * Consuming the collection is O(n) time and O(1) additional space. + * * @param iterable $elements The elements to initialize the Collection with. * @return Collectible A new Collectible instance. */ @@ -31,6 +39,8 @@ public static function createFrom(iterable $elements): Collectible; /** * Creates an empty Collectible instance. * + * Complexity: O(1) time and O(1) space. + * * @return Collectible An empty Collectible instance. */ public static function createFromEmpty(): Collectible; @@ -38,6 +48,9 @@ public static function createFromEmpty(): Collectible; /** * Adds one or more elements to the Collection. * + * Complexity (when consumed): O(n + k) time and O(1) additional space, + * where `k` is the number of elements passed to this method. + * * @param Element ...$elements The elements to be added to the Collection. * @return Collectible The updated Collection. */ @@ -46,6 +59,8 @@ public function add(mixed ...$elements): Collectible; /** * Checks if the Collection contains a specific element. * + * Complexity: best-case O(1), worst-case O(n) time (early termination), O(1) space. + * * @param Element $element The element to check for. * @return bool True if the element is found, false otherwise. */ @@ -54,6 +69,8 @@ public function contains(mixed $element): bool; /** * Returns the total number of elements in the Collection. * + * Complexity: O(n) time and O(1) additional space. + * * @return int The number of elements in the Collection. */ public function count(): int; @@ -61,6 +78,9 @@ public function count(): int; /** * Executes actions on each element in the Collection without modifying it. * + * Complexity: O(n · a) time and O(1) additional space, + * where `a` is the number of actions passed to this method. + * * @param Closure(Element): void ...$actions The actions to perform on each element. * @return Collectible The original Collection for chaining. */ @@ -69,6 +89,9 @@ public function each(Closure ...$actions): Collectible; /** * Compares the Collection with another Collection for equality. * + * Complexity: best-case O(1), worst-case O(min(n, m)) time (early termination), O(1) space, + * where `m` is the size of the other collection. + * * @param Collectible $other The Collection to compare with. * @return bool True if the collections are equal, false otherwise. */ @@ -78,15 +101,21 @@ public function equals(Collectible $other): bool; * Filters elements in the Collection based on the provided predicates. * If no predicates are provided, all empty or falsy values (e.g., null, false, empty arrays) will be removed. * + * Complexity (when consumed): O(n · p) time and O(1) additional space, + * where `p` is the number of predicates. + * * @param Closure(Element): bool|null ...$predicates * @return Collectible The updated Collection. */ public function filter(?Closure ...$predicates): Collectible; /** - * Finds the first element matching the provided predicates. + * Finds the first element that matches any of the provided predicates. * - * @param Closure(Element): bool ...$predicates The predicates to match. + * Complexity: best-case O(1), worst-case O(n · q) time (early termination), O(1) space, + * where `q` is the number of predicates. + * + * @param Closure(Element): bool ...$predicates The predicates to match (evaluated as a logical OR). * @return Element|null The first matching element, or null if none is found. */ public function findBy(Closure ...$predicates): mixed; @@ -94,21 +123,28 @@ public function findBy(Closure ...$predicates): mixed; /** * Retrieves the first element in the Collection or a default value if not found. * + * Complexity: best-case O(1), worst-case O(n) time (early termination), O(1) space. + * * @param Element|null $defaultValueIfNotFound The default value returns if no element is found. * @return Element|null The first element or the default value. */ public function first(mixed $defaultValueIfNotFound = null): mixed; /** - * Flattens a Collection by removing any nested collections and returning a single Collection with all elements. + * Flattens the collection by expanding iterable elements by one level (shallow flatten). * - * @return Collectible A new Collectible instance with all elements flattened into a single Collection. + * Complexity (when consumed): O(n + s) time and O(1) additional space, where `s` is the total number of elements + * inside nested iterables that are expanded. + * + * @return Collectible A new Collectible instance with elements flattened by one level. */ public function flatten(): Collectible; /** * Retrieves an element by its index or a default value if not found. * + * Complexity: O(n) time and O(1) additional space. + * * @param int $index The index of the element to retrieve. * @param Element|null $defaultValueIfNotFound The default value returns if no element is found. * @return Element|null The element at the specified index or the default value. @@ -118,6 +154,8 @@ public function getBy(int $index, mixed $defaultValueIfNotFound = null): mixed; /** * Returns an iterator for traversing the Collection. * + * Complexity: O(1) time and O(1) space to obtain the iterator. + * * @return Traversable An iterator for the Collection. */ public function getIterator(): Traversable; @@ -125,15 +163,20 @@ public function getIterator(): Traversable; /** * Groups the elements in the Collection based on the provided criteria. * + * Complexity (when consumed): O(n) time and O(n) additional space (materializes all groups). + * * @param Closure(Element): Key $grouping The function to define the group key for each element. - * @return Collectible, Element> A Collection of collections, - * grouped by the key returned by the closure. + * @return Collectible, Element> A Collection where each value is a list of elements, + * grouped by the key returned by the closure. */ public function groupBy(Closure $grouping): Collectible; /** * Determines if the Collection is empty. * + * Complexity: best-case O(1), worst-case O(n) time (may need to advance until the first element is produced), + * O(1) space. + * * @return bool True if the Collection is empty, false otherwise. */ public function isEmpty(): bool; @@ -141,6 +184,8 @@ public function isEmpty(): bool; /** * Joins the elements of the Collection into a string, separated by a given separator. * + * Complexity: O(n + L) time and O(L) space, where `L` is the length of the resulting string. + * * @param string $separator The string used to separate the elements. * @return string The concatenated string of all elements in the Collection. */ @@ -149,6 +194,8 @@ public function joinToString(string $separator): string; /** * Retrieves the last element in the Collection or a default value if not found. * + * Complexity: O(n) time and O(1) space. + * * @param Element|null $defaultValueIfNotFound The default value returns if no element is found. * @return Element|null The last element or the default value. */ @@ -158,6 +205,9 @@ public function last(mixed $defaultValueIfNotFound = null): mixed; * Applies transformations to each element in the Collection and returns a new Collection with the transformed * elements. * + * Complexity (when consumed): O(n · t) time and O(1) additional space, + * where `t` is the number of transformations. + * * @param Closure(Element): Element ...$transformations The transformations to apply. * @return Collectible A new Collection with the applied transformations. */ @@ -166,6 +216,8 @@ public function map(Closure ...$transformations): Collectible; /** * Removes a specific element from the Collection. * + * Complexity (when consumed): O(n) time and O(1) additional space. + * * @param Element $element The element to remove. * @return Collectible The updated Collection. */ @@ -175,6 +227,8 @@ public function remove(mixed $element): Collectible; * Removes elements from the Collection based on the provided filter. * If no filter is passed, all elements in the Collection will be removed. * + * Complexity (when consumed): O(n) time and O(1) additional space. + * * @param Closure(Element): bool|null $filter The filter to determine which elements to remove. * @return Collectible The updated Collection. */ @@ -183,6 +237,8 @@ public function removeAll(?Closure $filter = null): Collectible; /** * Reduces the elements in the Collection to a single value by applying an aggregator function. * + * Complexity: O(n) time and O(1) additional space. + * * @param Closure(mixed, Element): mixed $aggregator The function that aggregates the elements. * It receives the current accumulated value and the current element. * @param mixed $initial The initial value to start the aggregation. @@ -201,6 +257,8 @@ public function reduce(Closure $aggregator, mixed $initial): mixed; * * By default, `Order::ASCENDING_KEY` is used. * + * Complexity (when consumed): O(n log n) time and O(n) additional space (materializes elements to sort). + * * @param Order $order The order in which to sort the Collection. * @param Closure(Element, Element): int|null $predicate The predicate to use for sorting. * @return Collectible The updated Collection. @@ -217,6 +275,13 @@ public function sort(Order $order = Order::ASCENDING_KEY, ?Closure $predicate = * @param int $index The zero-based index at which to start the slice. * @param int $length The number of elements to include in the slice. If negative, remove that many from the end. * Default is `-1`, meaning all elements from the index onward will be included. + * + * Complexity (when consumed): + * - If `length === 0`: O(1) time and O(1) additional space. + * - If `length === -1`: O(n) time and O(1) additional space. + * - If `length >= 0`: O(min(n, index + length)) time and O(1) additional space (may stop early). + * - If `length < -1`: O(n) time and O(|length|) additional space (uses a buffer). + * * @return Collectible A new Collection containing the sliced elements. */ public function slice(int $index, int $length = -1): Collectible; @@ -224,11 +289,13 @@ public function slice(int $index, int $length = -1): Collectible; /** * Converts the Collection to an array. * - * The key preservation behavior should be provided from the `PreserveKeys` enum: + * The key preservation behavior should be provided from the `KeyPreservation` enum: * - {@see KeyPreservation::PRESERVE}: Preserves the array keys. * - {@see KeyPreservation::DISCARD}: Discards the array keys. * - * By default, `PreserveKeys::PRESERVE` is used. + * By default, `KeyPreservation::PRESERVE` is used. + * + * Complexity: O(n) time and O(n) space. * * @param KeyPreservation $keyPreservation The option to preserve or discard array keys. * @return array The resulting array. @@ -238,11 +305,13 @@ public function toArray(KeyPreservation $keyPreservation = KeyPreservation::PRES /** * Converts the Collection to a JSON string. * - * The key preservation behavior should be provided from the `PreserveKeys` enum: + * The key preservation behavior should be provided from the `KeyPreservation` enum: * - {@see KeyPreservation::PRESERVE}: Preserves the array keys. * - {@see KeyPreservation::DISCARD}: Discards the array keys. * - * By default, `PreserveKeys::PRESERVE` is used. + * By default, `KeyPreservation::PRESERVE` is used. + * + * Complexity: O(n + L) time and O(n + L) space, where `L` is the length of the resulting JSON. * * @param KeyPreservation $keyPreservation The option to preserve or discard array keys. * @return string The resulting JSON string. diff --git a/src/Internal/Operations/Retrieve/Slice.php b/src/Internal/Operations/Retrieve/Slice.php index 49ddcaa..2403ad1 100644 --- a/src/Internal/Operations/Retrieve/Slice.php +++ b/src/Internal/Operations/Retrieve/Slice.php @@ -5,6 +5,7 @@ namespace TinyBlocks\Collection\Internal\Operations\Retrieve; use Generator; +use SplQueue; use TinyBlocks\Collection\Internal\Operations\LazyOperation; final readonly class Slice implements LazyOperation @@ -48,7 +49,8 @@ public function apply(iterable $elements): Generator private function applyWithBufferedSlice(iterable $elements): Generator { - $collected = []; + $buffer = new SplQueue(); + $skipFromEnd = abs($this->length); $currentIndex = 0; foreach ($elements as $key => $value) { @@ -56,13 +58,18 @@ private function applyWithBufferedSlice(iterable $elements): Generator continue; } - $collected[] = [$key, $value]; - } + $buffer->enqueue([$key, $value]); + + if ($buffer->count() <= $skipFromEnd) { + continue; + } - $collected = array_slice($collected, 0, $this->length); + $dequeued = $buffer->dequeue(); - foreach ($collected as [$key, $value]) { - yield $key => $value; + if (is_array($dequeued)) { + [$yieldKey, $yieldValue] = $dequeued; + yield $yieldKey => $yieldValue; + } } } } diff --git a/tests/Internal/Iterators/LazyIteratorTest.php b/tests/Internal/Iterators/LazyIteratorTest.php new file mode 100644 index 0000000..15530ce --- /dev/null +++ b/tests/Internal/Iterators/LazyIteratorTest.php @@ -0,0 +1,34 @@ + $value) { + yield $key => $value * 2; + } + } + }; + + /** @When creating a LazyIterator from the elements and operation */ + $iterator = LazyIterator::from(elements: $elements, operation: $operation); + + /** @Then the yielded elements should include the operation effect */ + self::assertSame([2, 4, 6], iterator_to_array($iterator)); + } +} diff --git a/tests/Operations/Aggregate/CollectionReduceOperationTest.php b/tests/Internal/Operations/Aggregate/CollectionReduceOperationTest.php similarity index 98% rename from tests/Operations/Aggregate/CollectionReduceOperationTest.php rename to tests/Internal/Operations/Aggregate/CollectionReduceOperationTest.php index 6fc9f21..f4c1cbe 100644 --- a/tests/Operations/Aggregate/CollectionReduceOperationTest.php +++ b/tests/Internal/Operations/Aggregate/CollectionReduceOperationTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Test\TinyBlocks\Collection\Operations\Aggregate; +namespace Test\TinyBlocks\Collection\Internal\Operations\Aggregate; use PHPUnit\Framework\TestCase; use Test\TinyBlocks\Collection\Models\InvoiceSummaries; diff --git a/tests/Operations/Compare/CollectionContainsOperationTest.php b/tests/Internal/Operations/Compare/CollectionContainsOperationTest.php similarity index 97% rename from tests/Operations/Compare/CollectionContainsOperationTest.php rename to tests/Internal/Operations/Compare/CollectionContainsOperationTest.php index c2def9b..38cfd97 100644 --- a/tests/Operations/Compare/CollectionContainsOperationTest.php +++ b/tests/Internal/Operations/Compare/CollectionContainsOperationTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Test\TinyBlocks\Collection\Operations\Compare; +namespace Test\TinyBlocks\Collection\Internal\Operations\Compare; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; diff --git a/tests/Operations/Compare/CollectionEqualsOperationTest.php b/tests/Internal/Operations/Compare/CollectionEqualsOperationTest.php similarity index 86% rename from tests/Operations/Compare/CollectionEqualsOperationTest.php rename to tests/Internal/Operations/Compare/CollectionEqualsOperationTest.php index 3ca1c05..4627b26 100644 --- a/tests/Operations/Compare/CollectionEqualsOperationTest.php +++ b/tests/Internal/Operations/Compare/CollectionEqualsOperationTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Test\TinyBlocks\Collection\Operations\Compare; +namespace Test\TinyBlocks\Collection\Internal\Operations\Compare; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; @@ -42,6 +42,11 @@ public function testCollectionsAreNotEqual(iterable $elementsA, iterable $elemen public static function collectionsEqualDataProvider(): iterable { + yield 'Empty collections are equal' => [ + 'elementsA' => [], + 'elementsB' => [] + ]; + yield 'Collections are equal' => [ 'elementsA' => [ new CryptoCurrency(name: 'Bitcoin', price: 60000.0, symbol: 'BTC'), @@ -70,6 +75,11 @@ public static function collectionsNotEqualDataProvider(): iterable ] ]; + yield 'Collections with different sizes' => [ + 'elementsA' => [], + 'elementsB' => [1] + ]; + yield 'Scalar and non-scalar comparison' => [ 'elementsA' => [1], 'elementsB' => [new stdClass()] @@ -80,6 +90,11 @@ public static function collectionsNotEqualDataProvider(): iterable 'elementsB' => [] ]; + yield 'Collections with different sizes and null' => [ + 'elementsA' => [1, 2], + 'elementsB' => [1, 2, null] + ]; + yield 'Same elements in different order are not equal' => [ 'elementsA' => [1, 2, 3], 'elementsB' => [3, 2, 1] diff --git a/tests/Operations/Filter/CollectionFilterOperationTest.php b/tests/Internal/Operations/Filter/CollectionFilterOperationTest.php similarity index 98% rename from tests/Operations/Filter/CollectionFilterOperationTest.php rename to tests/Internal/Operations/Filter/CollectionFilterOperationTest.php index 237c35e..3eec601 100644 --- a/tests/Operations/Filter/CollectionFilterOperationTest.php +++ b/tests/Internal/Operations/Filter/CollectionFilterOperationTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Test\TinyBlocks\Collection\Operations\Filter; +namespace Test\TinyBlocks\Collection\Internal\Operations\Filter; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; diff --git a/tests/Operations/Order/CollectionSortOperationTest.php b/tests/Internal/Operations/Order/CollectionSortOperationTest.php similarity index 99% rename from tests/Operations/Order/CollectionSortOperationTest.php rename to tests/Internal/Operations/Order/CollectionSortOperationTest.php index 141e8d4..9b32126 100644 --- a/tests/Operations/Order/CollectionSortOperationTest.php +++ b/tests/Internal/Operations/Order/CollectionSortOperationTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Test\TinyBlocks\Collection\Operations\Order; +namespace Test\TinyBlocks\Collection\Internal\Operations\Order; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; diff --git a/tests/Operations/Retrieve/CollectionFindOperationTest.php b/tests/Internal/Operations/Retrieve/CollectionFindOperationTest.php similarity index 98% rename from tests/Operations/Retrieve/CollectionFindOperationTest.php rename to tests/Internal/Operations/Retrieve/CollectionFindOperationTest.php index 0f550df..bb0b6ba 100644 --- a/tests/Operations/Retrieve/CollectionFindOperationTest.php +++ b/tests/Internal/Operations/Retrieve/CollectionFindOperationTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Test\TinyBlocks\Collection\Operations\Retrieve; +namespace Test\TinyBlocks\Collection\Internal\Operations\Retrieve; use PHPUnit\Framework\TestCase; use Test\TinyBlocks\Collection\Models\CryptoCurrency; diff --git a/tests/Operations/Retrieve/CollectionFirstOperationTest.php b/tests/Internal/Operations/Retrieve/CollectionFirstOperationTest.php similarity index 97% rename from tests/Operations/Retrieve/CollectionFirstOperationTest.php rename to tests/Internal/Operations/Retrieve/CollectionFirstOperationTest.php index c9230b7..12d0157 100644 --- a/tests/Operations/Retrieve/CollectionFirstOperationTest.php +++ b/tests/Internal/Operations/Retrieve/CollectionFirstOperationTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Test\TinyBlocks\Collection\Operations\Retrieve; +namespace Test\TinyBlocks\Collection\Internal\Operations\Retrieve; use PHPUnit\Framework\TestCase; use Test\TinyBlocks\Collection\Models\CryptoCurrency; diff --git a/tests/Operations/Retrieve/CollectionGetOperationTest.php b/tests/Internal/Operations/Retrieve/CollectionGetOperationTest.php similarity index 99% rename from tests/Operations/Retrieve/CollectionGetOperationTest.php rename to tests/Internal/Operations/Retrieve/CollectionGetOperationTest.php index 6615774..152b4bd 100644 --- a/tests/Operations/Retrieve/CollectionGetOperationTest.php +++ b/tests/Internal/Operations/Retrieve/CollectionGetOperationTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Test\TinyBlocks\Collection\Operations\Retrieve; +namespace Test\TinyBlocks\Collection\Internal\Operations\Retrieve; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; diff --git a/tests/Operations/Retrieve/CollectionLastOperationTest.php b/tests/Internal/Operations/Retrieve/CollectionLastOperationTest.php similarity index 97% rename from tests/Operations/Retrieve/CollectionLastOperationTest.php rename to tests/Internal/Operations/Retrieve/CollectionLastOperationTest.php index 3e14966..c1d0fb8 100644 --- a/tests/Operations/Retrieve/CollectionLastOperationTest.php +++ b/tests/Internal/Operations/Retrieve/CollectionLastOperationTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Test\TinyBlocks\Collection\Operations\Retrieve; +namespace Test\TinyBlocks\Collection\Internal\Operations\Retrieve; use ArrayIterator; use PHPUnit\Framework\TestCase; diff --git a/tests/Operations/Retrieve/CollectionSliceOperationTest.php b/tests/Internal/Operations/Retrieve/CollectionSliceOperationTest.php similarity index 98% rename from tests/Operations/Retrieve/CollectionSliceOperationTest.php rename to tests/Internal/Operations/Retrieve/CollectionSliceOperationTest.php index 5afd14e..12f9a43 100644 --- a/tests/Operations/Retrieve/CollectionSliceOperationTest.php +++ b/tests/Internal/Operations/Retrieve/CollectionSliceOperationTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Test\TinyBlocks\Collection\Operations\Retrieve; +namespace Test\TinyBlocks\Collection\Internal\Operations\Retrieve; use PHPUnit\Framework\TestCase; use Test\TinyBlocks\Collection\Models\CryptoCurrency; diff --git a/tests/Operations/Transform/CollectionEachOperationTest.php b/tests/Internal/Operations/Transform/CollectionEachOperationTest.php similarity index 97% rename from tests/Operations/Transform/CollectionEachOperationTest.php rename to tests/Internal/Operations/Transform/CollectionEachOperationTest.php index 1cdee04..1d511e9 100644 --- a/tests/Operations/Transform/CollectionEachOperationTest.php +++ b/tests/Internal/Operations/Transform/CollectionEachOperationTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Test\TinyBlocks\Collection\Operations\Transform; +namespace Test\TinyBlocks\Collection\Internal\Operations\Transform; use PHPUnit\Framework\TestCase; use Test\TinyBlocks\Collection\Models\Invoice; diff --git a/tests/Operations/Transform/CollectionFlattenOperationTest.php b/tests/Internal/Operations/Transform/CollectionFlattenOperationTest.php similarity index 96% rename from tests/Operations/Transform/CollectionFlattenOperationTest.php rename to tests/Internal/Operations/Transform/CollectionFlattenOperationTest.php index c0bca75..ef3f34c 100644 --- a/tests/Operations/Transform/CollectionFlattenOperationTest.php +++ b/tests/Internal/Operations/Transform/CollectionFlattenOperationTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Test\TinyBlocks\Collection\Operations\Transform; +namespace Test\TinyBlocks\Collection\Internal\Operations\Transform; use PHPUnit\Framework\TestCase; use TinyBlocks\Collection\Collection; diff --git a/tests/Operations/Transform/CollectionGroupByOperationTest.php b/tests/Internal/Operations/Transform/CollectionGroupByOperationTest.php similarity index 98% rename from tests/Operations/Transform/CollectionGroupByOperationTest.php rename to tests/Internal/Operations/Transform/CollectionGroupByOperationTest.php index 9345566..cce3fdf 100644 --- a/tests/Operations/Transform/CollectionGroupByOperationTest.php +++ b/tests/Internal/Operations/Transform/CollectionGroupByOperationTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Test\TinyBlocks\Collection\Operations\Transform; +namespace Test\TinyBlocks\Collection\Internal\Operations\Transform; use PHPUnit\Framework\TestCase; use Test\TinyBlocks\Collection\Models\Amount; diff --git a/tests/Operations/Transform/CollectionJoinToStringTest.php b/tests/Internal/Operations/Transform/CollectionJoinToStringTest.php similarity index 98% rename from tests/Operations/Transform/CollectionJoinToStringTest.php rename to tests/Internal/Operations/Transform/CollectionJoinToStringTest.php index b89f0ac..47946f7 100644 --- a/tests/Operations/Transform/CollectionJoinToStringTest.php +++ b/tests/Internal/Operations/Transform/CollectionJoinToStringTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Test\TinyBlocks\Collection\Operations\Transform; +namespace Test\TinyBlocks\Collection\Internal\Operations\Transform; use PHPUnit\Framework\TestCase; use TinyBlocks\Collection\Collection; diff --git a/tests/Operations/Transform/CollectionMapOperationTest.php b/tests/Internal/Operations/Transform/CollectionMapOperationTest.php similarity index 98% rename from tests/Operations/Transform/CollectionMapOperationTest.php rename to tests/Internal/Operations/Transform/CollectionMapOperationTest.php index ca12a8d..d2de4b6 100644 --- a/tests/Operations/Transform/CollectionMapOperationTest.php +++ b/tests/Internal/Operations/Transform/CollectionMapOperationTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Test\TinyBlocks\Collection\Operations\Transform; +namespace Test\TinyBlocks\Collection\Internal\Operations\Transform; use PHPUnit\Framework\TestCase; use Test\TinyBlocks\Collection\Models\Dragon; diff --git a/tests/Operations/Transform/CollectionMapToArrayOperationTest.php b/tests/Internal/Operations/Transform/CollectionMapToArrayOperationTest.php similarity index 97% rename from tests/Operations/Transform/CollectionMapToArrayOperationTest.php rename to tests/Internal/Operations/Transform/CollectionMapToArrayOperationTest.php index e4629fe..a472a19 100644 --- a/tests/Operations/Transform/CollectionMapToArrayOperationTest.php +++ b/tests/Internal/Operations/Transform/CollectionMapToArrayOperationTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Test\TinyBlocks\Collection\Operations\Transform; +namespace Test\TinyBlocks\Collection\Internal\Operations\Transform; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; diff --git a/tests/Operations/Transform/CollectionMapToJsonOperationTest.php b/tests/Internal/Operations/Transform/CollectionMapToJsonOperationTest.php similarity index 97% rename from tests/Operations/Transform/CollectionMapToJsonOperationTest.php rename to tests/Internal/Operations/Transform/CollectionMapToJsonOperationTest.php index 24ef90a..c717f10 100644 --- a/tests/Operations/Transform/CollectionMapToJsonOperationTest.php +++ b/tests/Internal/Operations/Transform/CollectionMapToJsonOperationTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Test\TinyBlocks\Collection\Operations\Transform; +namespace Test\TinyBlocks\Collection\Internal\Operations\Transform; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; diff --git a/tests/Operations/Write/CollectionAddOperationTest.php b/tests/Internal/Operations/Write/CollectionAddOperationTest.php similarity index 98% rename from tests/Operations/Write/CollectionAddOperationTest.php rename to tests/Internal/Operations/Write/CollectionAddOperationTest.php index 6da6723..ac1c8e6 100644 --- a/tests/Operations/Write/CollectionAddOperationTest.php +++ b/tests/Internal/Operations/Write/CollectionAddOperationTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Test\TinyBlocks\Collection\Operations\Write; +namespace Test\TinyBlocks\Collection\Internal\Operations\Write; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; diff --git a/tests/Operations/Write/CollectionCreateOperationTest.php b/tests/Internal/Operations/Write/CollectionCreateOperationTest.php similarity index 96% rename from tests/Operations/Write/CollectionCreateOperationTest.php rename to tests/Internal/Operations/Write/CollectionCreateOperationTest.php index 1849e38..31dfe9b 100644 --- a/tests/Operations/Write/CollectionCreateOperationTest.php +++ b/tests/Internal/Operations/Write/CollectionCreateOperationTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Test\TinyBlocks\Collection\Operations\Write; +namespace Test\TinyBlocks\Collection\Internal\Operations\Write; use PHPUnit\Framework\TestCase; use Test\TinyBlocks\Collection\Models\CryptoCurrency; diff --git a/tests/Operations/Write/CollectionRemoveOperationTest.php b/tests/Internal/Operations/Write/CollectionRemoveOperationTest.php similarity index 98% rename from tests/Operations/Write/CollectionRemoveOperationTest.php rename to tests/Internal/Operations/Write/CollectionRemoveOperationTest.php index 1b0a5a8..e977021 100644 --- a/tests/Operations/Write/CollectionRemoveOperationTest.php +++ b/tests/Internal/Operations/Write/CollectionRemoveOperationTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Test\TinyBlocks\Collection\Operations\Write; +namespace Test\TinyBlocks\Collection\Internal\Operations\Write; use ArrayIterator; use DateTimeImmutable;