From cde50e288532ecf0e080438f856de5c44d2460d9 Mon Sep 17 00:00:00 2001 From: Gustavo Freze Date: Fri, 16 Jan 2026 09:05:42 -0300 Subject: [PATCH] refactor: Refactor test namespaces. Remove redundant array_first/array_last usage in First and Last operations. --- Makefile | 2 +- README.md | 6 +-- composer.json | 7 +-- src/Internal/Operations/Order/Sort.php | 8 ++-- src/Internal/Operations/Retrieve/First.php | 4 -- src/Internal/Operations/Retrieve/Last.php | 4 -- src/Internal/Operations/Transform/Each.php | 12 ++--- tests/CollectionIteratorTest.php | 3 +- tests/CollectionPerformanceTest.php | 8 ++-- tests/CollectionTest.php | 8 ++-- tests/Models/Amount.php | 4 +- tests/Models/CryptoCurrency.php | 2 +- tests/Models/Currency.php | 12 ----- tests/Models/Dragon.php | 2 +- tests/Models/Invoice.php | 2 +- tests/Models/InvoiceSummaries.php | 2 +- tests/Models/InvoiceSummary.php | 2 +- tests/Models/Invoices.php | 2 +- tests/Models/Order.php | 2 +- tests/Models/Product.php | 2 +- tests/Models/Products.php | 2 +- tests/Models/Status.php | 2 +- .../CollectionReduceOperationTest.php | 6 +-- .../CollectionContainsOperationTest.php | 4 +- .../Compare/CollectionEqualsOperationTest.php | 4 +- .../Filter/CollectionFilterOperationTest.php | 4 +- .../Order/CollectionSortOperationTest.php | 6 +-- .../Retrieve/CollectionFindOperationTest.php | 4 +- .../Retrieve/CollectionFirstOperationTest.php | 16 ++++++- .../Retrieve/CollectionGetOperationTest.php | 4 +- .../Retrieve/CollectionLastOperationTest.php | 46 ++++++++++++++++++- .../Retrieve/CollectionSliceOperationTest.php | 4 +- .../Transform/CollectionEachOperationTest.php | 11 +++-- .../CollectionFlattenOperationTest.php | 2 +- .../CollectionGroupByOperationTest.php | 6 +-- .../Transform/CollectionJoinToStringTest.php | 2 +- .../Transform/CollectionMapOperationTest.php | 4 +- .../CollectionMapToArrayOperationTest.php | 10 ++-- .../CollectionMapToJsonOperationTest.php | 8 ++-- .../Write/CollectionAddOperationTest.php | 17 +++---- .../Write/CollectionCreateOperationTest.php | 4 +- .../Write/CollectionRemoveOperationTest.php | 10 ++-- 42 files changed, 156 insertions(+), 114 deletions(-) delete mode 100644 tests/Models/Currency.php diff --git a/Makefile b/Makefile index ef9a884..07b3559 100644 --- a/Makefile +++ b/Makefile @@ -23,7 +23,7 @@ test: ## Run all tests with coverage @${DOCKER_RUN} composer tests .PHONY: test-file -test-file: ## Run tests for a specific file (usage: make test-file FILE=path/to/file) +test-file: ## Run tests for a specific file (usage: make test-file FILE=ClassNameTest) @${DOCKER_RUN} composer test-file ${FILE} .PHONY: test-no-coverage diff --git a/README.md b/README.md index 5d60447..d946533 100644 --- a/README.md +++ b/README.md @@ -107,7 +107,7 @@ These methods enable adding, removing, and modifying elements in the Collection. - **With a filter**: Removes only the elements that match the provided filter. ```php - $collection->removeAll(filter: fn(Amount $amount): bool => $amount->value > 10.0); + $collection->removeAll(filter: static fn(Amount $amount): bool => $amount->value > 10.0); ``` - **Without a filter**: Removes all elements from the Collection. @@ -130,7 +130,7 @@ These methods enable filtering elements in the Collection based on specific cond - **With predicates**: Filter elements are based on the provided predicates. ```php - $collection->filter(predicates: fn(Amount $amount): bool => $amount->value > 100); + $collection->filter(predicates: static fn(Amount $amount): bool => $amount->value > 100); ``` - **Without predicates**: Removes all empty or false values (e.g., `null`, `false`, empty arrays). @@ -170,7 +170,7 @@ These methods enable sorting elements in the Collection based on the specified o ```php use TinyBlocks\Collection\Order; - $collection->sort(order: Order::ASCENDING_VALUE, predicate: fn(Amount $amount): float => $amount->value); + $collection->sort(order: Order::ASCENDING_VALUE, predicate: static fn(Amount $amount): float => $amount->value); ```
diff --git a/composer.json b/composer.json index 1257c8f..1bb28b8 100644 --- a/composer.json +++ b/composer.json @@ -40,18 +40,19 @@ }, "autoload-dev": { "psr-4": { - "TinyBlocks\\Collection\\": "tests/" + "Test\\TinyBlocks\\Collection\\": "tests/" } }, "require": { "php": "^8.5", - "tiny-blocks/mapper": "1.2.*" + "tiny-blocks/mapper": "1.4.*" }, "require-dev": { "phpunit/phpunit": "^11.5", "phpstan/phpstan": "^2.1", "infection/infection": "^0.32", - "squizlabs/php_codesniffer": "^3.13" + "tiny-blocks/currency": "^2.3", + "squizlabs/php_codesniffer": "^4.0" }, "scripts": { "test": "php -d memory_limit=2G ./vendor/bin/phpunit --configuration phpunit.xml tests", diff --git a/src/Internal/Operations/Order/Sort.php b/src/Internal/Operations/Order/Sort.php index f76e624..0eab8f3 100644 --- a/src/Internal/Operations/Order/Sort.php +++ b/src/Internal/Operations/Order/Sort.php @@ -22,10 +22,12 @@ public static function from(Order $order, ?Closure $predicate = null): Sort public function apply(iterable $elements): Generator { - $temporaryElements = []; + $temporaryElements = is_array($elements) ? $elements : []; - foreach ($elements as $key => $value) { - $temporaryElements[$key] = $value; + if (!is_array($elements)) { + foreach ($elements as $key => $value) { + $temporaryElements[$key] = $value; + } } $predicate = is_null($this->predicate) diff --git a/src/Internal/Operations/Retrieve/First.php b/src/Internal/Operations/Retrieve/First.php index 7eaf3cf..2592c12 100644 --- a/src/Internal/Operations/Retrieve/First.php +++ b/src/Internal/Operations/Retrieve/First.php @@ -19,10 +19,6 @@ public static function from(iterable $elements): First public function element(mixed $defaultValueIfNotFound = null): mixed { - if (is_array($this->elements)) { - return array_first($this->elements) ?? $defaultValueIfNotFound; - } - foreach ($this->elements as $element) { return $element; } diff --git a/src/Internal/Operations/Retrieve/Last.php b/src/Internal/Operations/Retrieve/Last.php index 7046f5b..764a4b8 100644 --- a/src/Internal/Operations/Retrieve/Last.php +++ b/src/Internal/Operations/Retrieve/Last.php @@ -19,10 +19,6 @@ public static function from(iterable $elements): Last public function element(mixed $defaultValueIfNotFound = null): mixed { - if (is_array($this->elements)) { - return array_last($this->elements) ?? $defaultValueIfNotFound; - } - $lastElement = $defaultValueIfNotFound; foreach ($this->elements as $element) { diff --git a/src/Internal/Operations/Transform/Each.php b/src/Internal/Operations/Transform/Each.php index 1128e73..25d9bff 100644 --- a/src/Internal/Operations/Transform/Each.php +++ b/src/Internal/Operations/Transform/Each.php @@ -23,14 +23,10 @@ public static function from(Closure ...$actions): Each public function execute(iterable $elements): void { - $runActions = static function (iterable $actions) use ($elements): void { - foreach ($elements as $key => $value) { - foreach ($actions as $action) { - $action($value, $key); - } + foreach ($elements as $key => $value) { + foreach ($this->actions as $action) { + $action($value, $key); } - }; - - $runActions($this->actions); + } } } diff --git a/tests/CollectionIteratorTest.php b/tests/CollectionIteratorTest.php index 57ed626..24c9a67 100644 --- a/tests/CollectionIteratorTest.php +++ b/tests/CollectionIteratorTest.php @@ -2,9 +2,10 @@ declare(strict_types=1); -namespace TinyBlocks\Collection; +namespace Test\TinyBlocks\Collection; use PHPUnit\Framework\TestCase; +use TinyBlocks\Collection\Collection; final class CollectionIteratorTest extends TestCase { diff --git a/tests/CollectionPerformanceTest.php b/tests/CollectionPerformanceTest.php index 5a8ca66..6a2ac27 100644 --- a/tests/CollectionPerformanceTest.php +++ b/tests/CollectionPerformanceTest.php @@ -2,12 +2,14 @@ declare(strict_types=1); -namespace TinyBlocks\Collection; +namespace Test\TinyBlocks\Collection; use Generator; use PHPUnit\Framework\TestCase; -use TinyBlocks\Collection\Models\Amount; -use TinyBlocks\Collection\Models\Currency; +use Test\TinyBlocks\Collection\Models\Amount; +use TinyBlocks\Collection\Collection; +use TinyBlocks\Collection\Order; +use TinyBlocks\Currency\Currency; final class CollectionPerformanceTest extends TestCase { diff --git a/tests/CollectionTest.php b/tests/CollectionTest.php index c53b46a..84333fa 100644 --- a/tests/CollectionTest.php +++ b/tests/CollectionTest.php @@ -2,11 +2,13 @@ declare(strict_types=1); -namespace TinyBlocks\Collection; +namespace Test\TinyBlocks\Collection; use PHPUnit\Framework\TestCase; -use TinyBlocks\Collection\Models\Amount; -use TinyBlocks\Collection\Models\Currency; +use Test\TinyBlocks\Collection\Models\Amount; +use TinyBlocks\Collection\Collection; +use TinyBlocks\Collection\Order; +use TinyBlocks\Currency\Currency; final class CollectionTest extends TestCase { diff --git a/tests/Models/Amount.php b/tests/Models/Amount.php index b67cdb7..f9231db 100644 --- a/tests/Models/Amount.php +++ b/tests/Models/Amount.php @@ -2,7 +2,9 @@ declare(strict_types=1); -namespace TinyBlocks\Collection\Models; +namespace Test\TinyBlocks\Collection\Models; + +use TinyBlocks\Currency\Currency; final class Amount { diff --git a/tests/Models/CryptoCurrency.php b/tests/Models/CryptoCurrency.php index c80629e..0f61031 100644 --- a/tests/Models/CryptoCurrency.php +++ b/tests/Models/CryptoCurrency.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace TinyBlocks\Collection\Models; +namespace Test\TinyBlocks\Collection\Models; use TinyBlocks\Mapper\ObjectMappability; use TinyBlocks\Mapper\ObjectMapper; diff --git a/tests/Models/Currency.php b/tests/Models/Currency.php deleted file mode 100644 index 62e656e..0000000 --- a/tests/Models/Currency.php +++ /dev/null @@ -1,12 +0,0 @@ -first(defaultValueIfNotFound: 'default'); + + /** @Then the first element should be null */ + self::assertNull($actual); + } + public function testFirstReturnsDefaultValueWhenCollectionIsEmpty(): void { /** @Given an empty collection */ diff --git a/tests/Operations/Retrieve/CollectionGetOperationTest.php b/tests/Operations/Retrieve/CollectionGetOperationTest.php index 2a92644..6615774 100644 --- a/tests/Operations/Retrieve/CollectionGetOperationTest.php +++ b/tests/Operations/Retrieve/CollectionGetOperationTest.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace TinyBlocks\Collection\Operations\Retrieve; +namespace Test\TinyBlocks\Collection\Operations\Retrieve; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; +use Test\TinyBlocks\Collection\Models\CryptoCurrency; use TinyBlocks\Collection\Collection; -use TinyBlocks\Collection\Models\CryptoCurrency; final class CollectionGetOperationTest extends TestCase { diff --git a/tests/Operations/Retrieve/CollectionLastOperationTest.php b/tests/Operations/Retrieve/CollectionLastOperationTest.php index b105ba7..3e14966 100644 --- a/tests/Operations/Retrieve/CollectionLastOperationTest.php +++ b/tests/Operations/Retrieve/CollectionLastOperationTest.php @@ -2,11 +2,13 @@ declare(strict_types=1); -namespace TinyBlocks\Collection\Operations\Retrieve; +namespace Test\TinyBlocks\Collection\Operations\Retrieve; +use ArrayIterator; use PHPUnit\Framework\TestCase; +use SplDoublyLinkedList; +use Test\TinyBlocks\Collection\Models\CryptoCurrency; use TinyBlocks\Collection\Collection; -use TinyBlocks\Collection\Models\CryptoCurrency; final class CollectionLastOperationTest extends TestCase { @@ -27,6 +29,18 @@ public function testLastReturnsLastElement(): void self::assertSame($elements[2], $actual); } + public function testLastReturnsNullWhenLastElementIsNull(): void + { + /** @Given a collection whose last element is null */ + $collection = Collection::createFrom(elements: ['value', null]); + + /** @When retrieving the last element with a default value */ + $actual = $collection->last(defaultValueIfNotFound: 'default'); + + /** @Then the last element should be null */ + self::assertNull($actual); + } + public function testLastReturnsDefaultValueWhenCollectionIsEmpty(): void { /** @Given an empty collection */ @@ -39,6 +53,34 @@ public function testLastReturnsDefaultValueWhenCollectionIsEmpty(): void self::assertSame('default', $actual); } + public function testLastReturnsLastElementFromSplDoublyLinkedList(): void + { + /** @Given a collection created from a SplDoublyLinkedList */ + $elements = new SplDoublyLinkedList(); + $elements->push('first'); + $elements->push('second'); + $elements->push('third'); + $collection = Collection::createFrom(elements: $elements); + + /** @When retrieving the last element */ + $actual = $collection->last(); + + /** @Then the result should be the last value */ + self::assertSame('third', $actual); + } + + public function testLastReturnsLastElementFromArrayAccessCountableIterable(): void + { + /** @Given a collection created from an ArrayIterator */ + $collection = Collection::createFrom(elements: new ArrayIterator(['alpha', 'beta', 'gamma'])); + + /** @When retrieving the last element */ + $actual = $collection->last(); + + /** @Then the result should be the last value */ + self::assertSame('gamma', $actual); + } + public function testLastReturnsNullWhenCollectionIsEmptyWithoutDefaultValue(): void { /** @Given an empty collection */ diff --git a/tests/Operations/Retrieve/CollectionSliceOperationTest.php b/tests/Operations/Retrieve/CollectionSliceOperationTest.php index 7e16f6d..5afd14e 100644 --- a/tests/Operations/Retrieve/CollectionSliceOperationTest.php +++ b/tests/Operations/Retrieve/CollectionSliceOperationTest.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace TinyBlocks\Collection\Operations\Retrieve; +namespace Test\TinyBlocks\Collection\Operations\Retrieve; use PHPUnit\Framework\TestCase; +use Test\TinyBlocks\Collection\Models\CryptoCurrency; use TinyBlocks\Collection\Collection; -use TinyBlocks\Collection\Models\CryptoCurrency; final class CollectionSliceOperationTest extends TestCase { diff --git a/tests/Operations/Transform/CollectionEachOperationTest.php b/tests/Operations/Transform/CollectionEachOperationTest.php index be175d2..1cdee04 100644 --- a/tests/Operations/Transform/CollectionEachOperationTest.php +++ b/tests/Operations/Transform/CollectionEachOperationTest.php @@ -2,14 +2,15 @@ declare(strict_types=1); -namespace TinyBlocks\Collection\Operations\Transform; +namespace Test\TinyBlocks\Collection\Operations\Transform; use PHPUnit\Framework\TestCase; +use Test\TinyBlocks\Collection\Models\Invoice; +use Test\TinyBlocks\Collection\Models\Invoices; +use Test\TinyBlocks\Collection\Models\InvoiceSummaries; +use Test\TinyBlocks\Collection\Models\InvoiceSummary; use TinyBlocks\Collection\Collection; -use TinyBlocks\Collection\Models\Invoice; -use TinyBlocks\Collection\Models\Invoices; -use TinyBlocks\Collection\Models\InvoiceSummaries; -use TinyBlocks\Collection\Models\InvoiceSummary; + final class CollectionEachOperationTest extends TestCase { diff --git a/tests/Operations/Transform/CollectionFlattenOperationTest.php b/tests/Operations/Transform/CollectionFlattenOperationTest.php index 81d248e..c0bca75 100644 --- a/tests/Operations/Transform/CollectionFlattenOperationTest.php +++ b/tests/Operations/Transform/CollectionFlattenOperationTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace TinyBlocks\Collection\Operations\Transform; +namespace Test\TinyBlocks\Collection\Operations\Transform; use PHPUnit\Framework\TestCase; use TinyBlocks\Collection\Collection; diff --git a/tests/Operations/Transform/CollectionGroupByOperationTest.php b/tests/Operations/Transform/CollectionGroupByOperationTest.php index 45a3ca4..9345566 100644 --- a/tests/Operations/Transform/CollectionGroupByOperationTest.php +++ b/tests/Operations/Transform/CollectionGroupByOperationTest.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace TinyBlocks\Collection\Operations\Transform; +namespace Test\TinyBlocks\Collection\Operations\Transform; use PHPUnit\Framework\TestCase; +use Test\TinyBlocks\Collection\Models\Amount; use TinyBlocks\Collection\Collection; -use TinyBlocks\Collection\Models\Amount; -use TinyBlocks\Collection\Models\Currency; +use TinyBlocks\Currency\Currency; final class CollectionGroupByOperationTest extends TestCase { diff --git a/tests/Operations/Transform/CollectionJoinToStringTest.php b/tests/Operations/Transform/CollectionJoinToStringTest.php index 8e5b03d..b89f0ac 100644 --- a/tests/Operations/Transform/CollectionJoinToStringTest.php +++ b/tests/Operations/Transform/CollectionJoinToStringTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace TinyBlocks\Collection\Operations\Transform; +namespace Test\TinyBlocks\Collection\Operations\Transform; use PHPUnit\Framework\TestCase; use TinyBlocks\Collection\Collection; diff --git a/tests/Operations/Transform/CollectionMapOperationTest.php b/tests/Operations/Transform/CollectionMapOperationTest.php index 5a8786a..ca12a8d 100644 --- a/tests/Operations/Transform/CollectionMapOperationTest.php +++ b/tests/Operations/Transform/CollectionMapOperationTest.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace TinyBlocks\Collection\Operations\Transform; +namespace Test\TinyBlocks\Collection\Operations\Transform; use PHPUnit\Framework\TestCase; +use Test\TinyBlocks\Collection\Models\Dragon; use TinyBlocks\Collection\Collection; -use TinyBlocks\Collection\Models\Dragon; final class CollectionMapOperationTest extends TestCase { diff --git a/tests/Operations/Transform/CollectionMapToArrayOperationTest.php b/tests/Operations/Transform/CollectionMapToArrayOperationTest.php index 71acd53..e4629fe 100644 --- a/tests/Operations/Transform/CollectionMapToArrayOperationTest.php +++ b/tests/Operations/Transform/CollectionMapToArrayOperationTest.php @@ -2,14 +2,14 @@ declare(strict_types=1); -namespace TinyBlocks\Collection\Operations\Transform; +namespace Test\TinyBlocks\Collection\Operations\Transform; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; +use Test\TinyBlocks\Collection\Models\Amount; +use Test\TinyBlocks\Collection\Models\Status; use TinyBlocks\Collection\Collection; -use TinyBlocks\Collection\Models\Amount; -use TinyBlocks\Collection\Models\Currency; -use TinyBlocks\Collection\Models\Status; +use TinyBlocks\Currency\Currency; final class CollectionMapToArrayOperationTest extends TestCase { @@ -24,7 +24,7 @@ public function testCollectionToArrayConversion(iterable $elements, iterable $ex /** @Then the array representation should match the expected format */ self::assertSame($expected, $actual); - self::assertSame(count($expected), $collection->count()); + self::assertSame(count((array)$expected), $collection->count()); } public static function elementsDataProvider(): iterable diff --git a/tests/Operations/Transform/CollectionMapToJsonOperationTest.php b/tests/Operations/Transform/CollectionMapToJsonOperationTest.php index 60b261c..24ef90a 100644 --- a/tests/Operations/Transform/CollectionMapToJsonOperationTest.php +++ b/tests/Operations/Transform/CollectionMapToJsonOperationTest.php @@ -2,14 +2,14 @@ declare(strict_types=1); -namespace TinyBlocks\Collection\Operations\Transform; +namespace Test\TinyBlocks\Collection\Operations\Transform; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; +use Test\TinyBlocks\Collection\Models\Amount; +use Test\TinyBlocks\Collection\Models\Status; use TinyBlocks\Collection\Collection; -use TinyBlocks\Collection\Models\Amount; -use TinyBlocks\Collection\Models\Currency; -use TinyBlocks\Collection\Models\Status; +use TinyBlocks\Currency\Currency; final class CollectionMapToJsonOperationTest extends TestCase { diff --git a/tests/Operations/Write/CollectionAddOperationTest.php b/tests/Operations/Write/CollectionAddOperationTest.php index 29f6af2..6da6723 100644 --- a/tests/Operations/Write/CollectionAddOperationTest.php +++ b/tests/Operations/Write/CollectionAddOperationTest.php @@ -2,18 +2,19 @@ declare(strict_types=1); -namespace TinyBlocks\Collection\Operations\Write; +namespace Test\TinyBlocks\Collection\Operations\Write; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; +use Test\TinyBlocks\Collection\Models\Amount; +use Test\TinyBlocks\Collection\Models\CryptoCurrency; +use Test\TinyBlocks\Collection\Models\Dragon; +use Test\TinyBlocks\Collection\Models\Order; +use Test\TinyBlocks\Collection\Models\Product; +use Test\TinyBlocks\Collection\Models\Products; use TinyBlocks\Collection\Collection; -use TinyBlocks\Collection\Models\Amount; -use TinyBlocks\Collection\Models\CryptoCurrency; -use TinyBlocks\Collection\Models\Currency; -use TinyBlocks\Collection\Models\Dragon; -use TinyBlocks\Collection\Models\Order; -use TinyBlocks\Collection\Models\Product; -use TinyBlocks\Collection\Models\Products; +use TinyBlocks\Currency\Currency; + final class CollectionAddOperationTest extends TestCase { diff --git a/tests/Operations/Write/CollectionCreateOperationTest.php b/tests/Operations/Write/CollectionCreateOperationTest.php index 0678b81..1849e38 100644 --- a/tests/Operations/Write/CollectionCreateOperationTest.php +++ b/tests/Operations/Write/CollectionCreateOperationTest.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace TinyBlocks\Collection\Operations\Write; +namespace Test\TinyBlocks\Collection\Operations\Write; use PHPUnit\Framework\TestCase; +use Test\TinyBlocks\Collection\Models\CryptoCurrency; use TinyBlocks\Collection\Collection; -use TinyBlocks\Collection\Models\CryptoCurrency; final class CollectionCreateOperationTest extends TestCase { diff --git a/tests/Operations/Write/CollectionRemoveOperationTest.php b/tests/Operations/Write/CollectionRemoveOperationTest.php index fb6803f..1b0a5a8 100644 --- a/tests/Operations/Write/CollectionRemoveOperationTest.php +++ b/tests/Operations/Write/CollectionRemoveOperationTest.php @@ -2,18 +2,18 @@ declare(strict_types=1); -namespace TinyBlocks\Collection\Operations\Write; +namespace Test\TinyBlocks\Collection\Operations\Write; use ArrayIterator; use DateTimeImmutable; use DateTimeZone; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; +use Test\TinyBlocks\Collection\Models\CryptoCurrency; +use Test\TinyBlocks\Collection\Models\Dragon; +use Test\TinyBlocks\Collection\Models\Status; use TinyBlocks\Collection\Collection; -use TinyBlocks\Collection\Models\CryptoCurrency; -use TinyBlocks\Collection\Models\Currency; -use TinyBlocks\Collection\Models\Dragon; -use TinyBlocks\Collection\Models\Status; +use TinyBlocks\Currency\Currency; final class CollectionRemoveOperationTest extends TestCase {