From 20821bc11f033cb9a804f5f1f236f0502b2385af Mon Sep 17 00:00:00 2001 From: Alexey Rogachev Date: Thu, 26 Sep 2024 19:04:03 +0500 Subject: [PATCH] WIP --- composer.json | 2 +- tests/Base/{TestCase.php => DataTrait.php} | 20 ++++++++++++++++++- tests/Base/FilterHandler/AllHandlerTest.php | 13 ------------ tests/Base/FilterHandler/AnyHandlerTest.php | 13 ------------ .../Base/FilterHandler/BetweenHandlerTest.php | 13 ------------ .../Base/FilterHandler/EqualsHandlerTest.php | 13 ------------ .../FilterHandler/EqualsNullHandlerTest.php | 13 ------------ .../FilterHandler/GreaterThanHandlerTest.php | 13 ------------ .../GreaterThanOrEqualHandlerTest.php | 13 ------------ .../FilterHandler/LessThanHandlerTest.php | 13 ------------ .../LessThanOrEqualHandlerTest.php | 13 ------------ tests/Base/FilterHandler/LikeHandlerTest.php | 13 ------------ tests/Base/FilterHandler/NotHandlerTest.php | 13 ------------ tests/Base/QueryDataReaderTest.php | 3 +++ .../BaseReaderWithAllTestCase.php | 12 +++++++++++ .../BaseReaderWithAnyTestCase.php | 12 +++++++++++ .../BaseReaderWithBetweenTestCase.php | 12 +++++++++++ .../BaseReaderWithEqualsNullTestCase.php | 12 +++++++++++ .../BaseReaderWithEqualsTestCase.php | 12 +++++++++++ ...seReaderWithGreaterThanOrEqualTestCase.php | 12 +++++++++++ .../BaseReaderWithGreaterThanTestCase.php | 12 +++++++++++ .../BaseReaderWithInTestCase.php | 12 +++++++++++ .../BaseReaderWithLessThanOrEqualTestCase.php | 12 +++++++++++ .../BaseReaderWithLessThanTestCase.php | 12 +++++++++++ .../BaseReaderWithLikeTestCase.php | 12 +++++++++++ .../BaseReaderWithNotTestCase.php | 12 +++++++++++ tests/Base/ReaderTrait.php | 9 --------- tests/Mssql/FilterHandler/AllHandlerTest.php | 12 ----------- tests/Mssql/FilterHandler/AnyHandlerTest.php | 12 ----------- .../FilterHandler/BetweenHandlerTest.php | 12 ----------- .../Mssql/FilterHandler/EqualsHandlerTest.php | 12 ----------- .../FilterHandler/EqualsNullHandlerTest.php | 12 ----------- .../FilterHandler/GreaterThanHandlerTest.php | 12 ----------- .../GreaterThanOrEqualHandlerTest.php | 12 ----------- .../FilterHandler/LessThanHandlerTest.php | 12 ----------- .../LessThanOrEqualHandlerTest.php | 12 ----------- tests/Mssql/FilterHandler/LikeHandlerTest.php | 12 ----------- tests/Mssql/FilterHandler/NotHandlerTest.php | 12 ----------- .../ReaderWithHandler/ReaderWithAllTest.php | 13 ++++++++++++ .../ReaderWithHandler/ReaderWithAnyTest.php | 13 ++++++++++++ .../ReaderWithBetweenTest.php | 13 ++++++++++++ .../ReaderWithEqualsNullTest.php | 13 ++++++++++++ .../ReaderWithEqualsTest.php | 13 ++++++++++++ .../ReaderWithGreaterThanOrEqualTest.php | 13 ++++++++++++ .../ReaderWithGreaterThanTest.php | 13 ++++++++++++ .../ReaderWithHandler/ReaderWithInTest.php | 13 ++++++++++++ .../ReaderWithLessThanOrEqualTest.php | 13 ++++++++++++ .../ReaderWithLessThanTest.php | 13 ++++++++++++ .../ReaderWithHandler/ReaderWithLikeTest.php | 13 ++++++++++++ .../ReaderWithHandler/ReaderWithNotTest.php | 13 ++++++++++++ tests/Mysql/FilterHandler/AllHandlerTest.php | 12 ----------- tests/Mysql/FilterHandler/AnyHandlerTest.php | 12 ----------- .../FilterHandler/BetweenHandlerTest.php | 12 ----------- .../Mysql/FilterHandler/EqualsHandlerTest.php | 12 ----------- .../FilterHandler/EqualsNullHandlerTest.php | 12 ----------- .../FilterHandler/GreaterThanHandlerTest.php | 12 ----------- .../GreaterThanOrEqualHandlerTest.php | 12 ----------- .../FilterHandler/LessThanHandlerTest.php | 12 ----------- .../LessThanOrEqualHandlerTest.php | 12 ----------- tests/Mysql/FilterHandler/LikeHandlerTest.php | 12 ----------- tests/Mysql/FilterHandler/NotHandlerTest.php | 12 ----------- .../ReaderWithFilter/ReaderWithAllTest.php | 13 ++++++++++++ .../ReaderWithFilter/ReaderWithAnyTest.php | 13 ++++++++++++ .../ReaderWithBetweenTest.php | 13 ++++++++++++ .../ReaderWithEqualsNullTest.php | 13 ++++++++++++ .../ReaderWithFilter/ReaderWithEqualsTest.php | 13 ++++++++++++ .../ReaderWithGreaterThanOrEqualTest.php | 13 ++++++++++++ .../ReaderWithGreaterThanTest.php | 13 ++++++++++++ .../ReaderWithFilter/ReaderWithInTest.php | 13 ++++++++++++ .../ReaderWithLessThanOrEqualTest.php | 13 ++++++++++++ .../ReaderWithLessThanTest.php | 13 ++++++++++++ .../ReaderWithFilter/ReaderWithLikeTest.php | 13 ++++++++++++ .../ReaderWithFilter/ReaderWithNotTest.php | 13 ++++++++++++ tests/Oracle/FilterHandler/AllHandlerTest.php | 12 ----------- tests/Oracle/FilterHandler/AnyHandlerTest.php | 12 ----------- .../FilterHandler/BetweenHandlerTest.php | 12 ----------- .../FilterHandler/EqualsHandlerTest.php | 12 ----------- .../FilterHandler/EqualsNullHandlerTest.php | 12 ----------- .../FilterHandler/GreaterThanHandlerTest.php | 12 ----------- .../GreaterThanOrEqualHandlerTest.php | 12 ----------- .../FilterHandler/LessThanHandlerTest.php | 12 ----------- .../LessThanOrEqualHandlerTest.php | 12 ----------- .../Oracle/FilterHandler/LikeHandlerTest.php | 12 ----------- tests/Oracle/FilterHandler/NotHandlerTest.php | 12 ----------- .../ReaderWithHandler/ReaderWithAllTest.php | 13 ++++++++++++ .../ReaderWithHandler/ReaderWithAnyTest.php | 13 ++++++++++++ .../ReaderWithBetweenTest.php | 13 ++++++++++++ .../ReaderWithEqualsNullTest.php | 13 ++++++++++++ .../ReaderWithEqualsTest.php | 13 ++++++++++++ .../ReaderWithGreaterThanOrEqualTest.php | 13 ++++++++++++ .../ReaderWithGreaterThanTest.php | 13 ++++++++++++ .../ReaderWithHandler/ReaderWithInTest.php | 13 ++++++++++++ .../ReaderWithLessThanOrEqualTest.php | 13 ++++++++++++ .../ReaderWithLessThanTest.php | 13 ++++++++++++ .../ReaderWithHandler/ReaderWithLikeTest.php | 13 ++++++++++++ .../ReaderWithHandler/ReaderWithNotTest.php | 13 ++++++++++++ tests/Pgsql/FilterHandler/AllHandlerTest.php | 12 ----------- tests/Pgsql/FilterHandler/AnyHandlerTest.php | 12 ----------- .../FilterHandler/BetweenHandlerTest.php | 12 ----------- .../Pgsql/FilterHandler/EqualsHandlerTest.php | 12 ----------- .../FilterHandler/EqualsNullHandlerTest.php | 12 ----------- .../FilterHandler/GreaterThanHandlerTest.php | 12 ----------- .../GreaterThanOrEqualHandlerTest.php | 12 ----------- .../FilterHandler/LessThanHandlerTest.php | 12 ----------- .../LessThanOrEqualHandlerTest.php | 12 ----------- tests/Pgsql/FilterHandler/LikeHandlerTest.php | 12 ----------- tests/Pgsql/FilterHandler/NotHandlerTest.php | 12 ----------- .../ReaderWithFilter/ReaderWithAllTest.php | 13 ++++++++++++ .../ReaderWithFilter/ReaderWithAnyTest.php | 13 ++++++++++++ .../ReaderWithBetweenTest.php | 13 ++++++++++++ .../ReaderWithEqualsNullTest.php | 13 ++++++++++++ .../ReaderWithFilter/ReaderWithEqualsTest.php | 13 ++++++++++++ .../ReaderWithGreaterThanOrEqualTest.php | 13 ++++++++++++ .../ReaderWithGreaterThanTest.php | 13 ++++++++++++ .../ReaderWithFilter/ReaderWithInTest.php | 13 ++++++++++++ .../ReaderWithLessThanOrEqualTest.php | 13 ++++++++++++ .../ReaderWithLessThanTest.php | 13 ++++++++++++ .../ReaderWithFilter/ReaderWithLikeTest.php | 13 ++++++++++++ .../ReaderWithFilter/ReaderWithNotTest.php | 13 ++++++++++++ tests/Sqlite/FilterHandler/AllHandlerTest.php | 12 ----------- tests/Sqlite/FilterHandler/AnyHandlerTest.php | 12 ----------- .../FilterHandler/BetweenHandlerTest.php | 12 ----------- .../FilterHandler/EqualsHandlerTest.php | 12 ----------- .../FilterHandler/EqualsNullHandlerTest.php | 12 ----------- .../FilterHandler/GreaterThanHandlerTest.php | 12 ----------- .../GreaterThanOrEqualHandlerTest.php | 12 ----------- .../FilterHandler/LessThanHandlerTest.php | 12 ----------- .../LessThanOrEqualHandlerTest.php | 12 ----------- .../Sqlite/FilterHandler/LikeHandlerTest.php | 12 ----------- tests/Sqlite/FilterHandler/NotHandlerTest.php | 12 ----------- .../ReaderWithFilter/ReaderWithAllTest.php | 13 ++++++++++++ .../ReaderWithFilter/ReaderWithAnyTest.php | 13 ++++++++++++ .../ReaderWithBetweenTest.php | 13 ++++++++++++ .../ReaderWithEqualsNullTest.php | 13 ++++++++++++ .../ReaderWithFilter/ReaderWithEqualsTest.php | 13 ++++++++++++ .../ReaderWithGreaterThanOrEqualTest.php | 13 ++++++++++++ .../ReaderWithGreaterThanTest.php | 13 ++++++++++++ .../ReaderWithFilter/ReaderWithInTestCase.php | 13 ++++++++++++ .../ReaderWithLessThanOrEqualTest.php | 13 ++++++++++++ .../ReaderWithLessThanTest.php | 13 ++++++++++++ .../ReaderWithFilter/ReaderWithLikeTest.php | 13 ++++++++++++ .../ReaderWithFilter/ReaderWithNotTest.php | 13 ++++++++++++ 142 files changed, 947 insertions(+), 814 deletions(-) rename tests/Base/{TestCase.php => DataTrait.php} (77%) delete mode 100644 tests/Base/FilterHandler/AllHandlerTest.php delete mode 100644 tests/Base/FilterHandler/AnyHandlerTest.php delete mode 100644 tests/Base/FilterHandler/BetweenHandlerTest.php delete mode 100644 tests/Base/FilterHandler/EqualsHandlerTest.php delete mode 100644 tests/Base/FilterHandler/EqualsNullHandlerTest.php delete mode 100644 tests/Base/FilterHandler/GreaterThanHandlerTest.php delete mode 100644 tests/Base/FilterHandler/GreaterThanOrEqualHandlerTest.php delete mode 100644 tests/Base/FilterHandler/LessThanHandlerTest.php delete mode 100644 tests/Base/FilterHandler/LessThanOrEqualHandlerTest.php delete mode 100644 tests/Base/FilterHandler/LikeHandlerTest.php delete mode 100644 tests/Base/FilterHandler/NotHandlerTest.php create mode 100644 tests/Base/Reader/ReaderWithFilter/BaseReaderWithAllTestCase.php create mode 100644 tests/Base/Reader/ReaderWithFilter/BaseReaderWithAnyTestCase.php create mode 100644 tests/Base/Reader/ReaderWithFilter/BaseReaderWithBetweenTestCase.php create mode 100644 tests/Base/Reader/ReaderWithFilter/BaseReaderWithEqualsNullTestCase.php create mode 100644 tests/Base/Reader/ReaderWithFilter/BaseReaderWithEqualsTestCase.php create mode 100644 tests/Base/Reader/ReaderWithFilter/BaseReaderWithGreaterThanOrEqualTestCase.php create mode 100644 tests/Base/Reader/ReaderWithFilter/BaseReaderWithGreaterThanTestCase.php create mode 100644 tests/Base/Reader/ReaderWithFilter/BaseReaderWithInTestCase.php create mode 100644 tests/Base/Reader/ReaderWithFilter/BaseReaderWithLessThanOrEqualTestCase.php create mode 100644 tests/Base/Reader/ReaderWithFilter/BaseReaderWithLessThanTestCase.php create mode 100644 tests/Base/Reader/ReaderWithFilter/BaseReaderWithLikeTestCase.php create mode 100644 tests/Base/Reader/ReaderWithFilter/BaseReaderWithNotTestCase.php delete mode 100644 tests/Base/ReaderTrait.php delete mode 100644 tests/Mssql/FilterHandler/AllHandlerTest.php delete mode 100644 tests/Mssql/FilterHandler/AnyHandlerTest.php delete mode 100644 tests/Mssql/FilterHandler/BetweenHandlerTest.php delete mode 100644 tests/Mssql/FilterHandler/EqualsHandlerTest.php delete mode 100644 tests/Mssql/FilterHandler/EqualsNullHandlerTest.php delete mode 100644 tests/Mssql/FilterHandler/GreaterThanHandlerTest.php delete mode 100644 tests/Mssql/FilterHandler/GreaterThanOrEqualHandlerTest.php delete mode 100644 tests/Mssql/FilterHandler/LessThanHandlerTest.php delete mode 100644 tests/Mssql/FilterHandler/LessThanOrEqualHandlerTest.php delete mode 100644 tests/Mssql/FilterHandler/LikeHandlerTest.php delete mode 100644 tests/Mssql/FilterHandler/NotHandlerTest.php create mode 100644 tests/Mssql/ReaderWithHandler/ReaderWithAllTest.php create mode 100644 tests/Mssql/ReaderWithHandler/ReaderWithAnyTest.php create mode 100644 tests/Mssql/ReaderWithHandler/ReaderWithBetweenTest.php create mode 100644 tests/Mssql/ReaderWithHandler/ReaderWithEqualsNullTest.php create mode 100644 tests/Mssql/ReaderWithHandler/ReaderWithEqualsTest.php create mode 100644 tests/Mssql/ReaderWithHandler/ReaderWithGreaterThanOrEqualTest.php create mode 100644 tests/Mssql/ReaderWithHandler/ReaderWithGreaterThanTest.php create mode 100644 tests/Mssql/ReaderWithHandler/ReaderWithInTest.php create mode 100644 tests/Mssql/ReaderWithHandler/ReaderWithLessThanOrEqualTest.php create mode 100644 tests/Mssql/ReaderWithHandler/ReaderWithLessThanTest.php create mode 100644 tests/Mssql/ReaderWithHandler/ReaderWithLikeTest.php create mode 100644 tests/Mssql/ReaderWithHandler/ReaderWithNotTest.php delete mode 100644 tests/Mysql/FilterHandler/AllHandlerTest.php delete mode 100644 tests/Mysql/FilterHandler/AnyHandlerTest.php delete mode 100644 tests/Mysql/FilterHandler/BetweenHandlerTest.php delete mode 100644 tests/Mysql/FilterHandler/EqualsHandlerTest.php delete mode 100644 tests/Mysql/FilterHandler/EqualsNullHandlerTest.php delete mode 100644 tests/Mysql/FilterHandler/GreaterThanHandlerTest.php delete mode 100644 tests/Mysql/FilterHandler/GreaterThanOrEqualHandlerTest.php delete mode 100644 tests/Mysql/FilterHandler/LessThanHandlerTest.php delete mode 100644 tests/Mysql/FilterHandler/LessThanOrEqualHandlerTest.php delete mode 100644 tests/Mysql/FilterHandler/LikeHandlerTest.php delete mode 100644 tests/Mysql/FilterHandler/NotHandlerTest.php create mode 100644 tests/Mysql/ReaderWithFilter/ReaderWithAllTest.php create mode 100644 tests/Mysql/ReaderWithFilter/ReaderWithAnyTest.php create mode 100644 tests/Mysql/ReaderWithFilter/ReaderWithBetweenTest.php create mode 100644 tests/Mysql/ReaderWithFilter/ReaderWithEqualsNullTest.php create mode 100644 tests/Mysql/ReaderWithFilter/ReaderWithEqualsTest.php create mode 100644 tests/Mysql/ReaderWithFilter/ReaderWithGreaterThanOrEqualTest.php create mode 100644 tests/Mysql/ReaderWithFilter/ReaderWithGreaterThanTest.php create mode 100644 tests/Mysql/ReaderWithFilter/ReaderWithInTest.php create mode 100644 tests/Mysql/ReaderWithFilter/ReaderWithLessThanOrEqualTest.php create mode 100644 tests/Mysql/ReaderWithFilter/ReaderWithLessThanTest.php create mode 100644 tests/Mysql/ReaderWithFilter/ReaderWithLikeTest.php create mode 100644 tests/Mysql/ReaderWithFilter/ReaderWithNotTest.php delete mode 100644 tests/Oracle/FilterHandler/AllHandlerTest.php delete mode 100644 tests/Oracle/FilterHandler/AnyHandlerTest.php delete mode 100644 tests/Oracle/FilterHandler/BetweenHandlerTest.php delete mode 100644 tests/Oracle/FilterHandler/EqualsHandlerTest.php delete mode 100644 tests/Oracle/FilterHandler/EqualsNullHandlerTest.php delete mode 100644 tests/Oracle/FilterHandler/GreaterThanHandlerTest.php delete mode 100644 tests/Oracle/FilterHandler/GreaterThanOrEqualHandlerTest.php delete mode 100644 tests/Oracle/FilterHandler/LessThanHandlerTest.php delete mode 100644 tests/Oracle/FilterHandler/LessThanOrEqualHandlerTest.php delete mode 100644 tests/Oracle/FilterHandler/LikeHandlerTest.php delete mode 100644 tests/Oracle/FilterHandler/NotHandlerTest.php create mode 100644 tests/Oracle/ReaderWithHandler/ReaderWithAllTest.php create mode 100644 tests/Oracle/ReaderWithHandler/ReaderWithAnyTest.php create mode 100644 tests/Oracle/ReaderWithHandler/ReaderWithBetweenTest.php create mode 100644 tests/Oracle/ReaderWithHandler/ReaderWithEqualsNullTest.php create mode 100644 tests/Oracle/ReaderWithHandler/ReaderWithEqualsTest.php create mode 100644 tests/Oracle/ReaderWithHandler/ReaderWithGreaterThanOrEqualTest.php create mode 100644 tests/Oracle/ReaderWithHandler/ReaderWithGreaterThanTest.php create mode 100644 tests/Oracle/ReaderWithHandler/ReaderWithInTest.php create mode 100644 tests/Oracle/ReaderWithHandler/ReaderWithLessThanOrEqualTest.php create mode 100644 tests/Oracle/ReaderWithHandler/ReaderWithLessThanTest.php create mode 100644 tests/Oracle/ReaderWithHandler/ReaderWithLikeTest.php create mode 100644 tests/Oracle/ReaderWithHandler/ReaderWithNotTest.php delete mode 100644 tests/Pgsql/FilterHandler/AllHandlerTest.php delete mode 100644 tests/Pgsql/FilterHandler/AnyHandlerTest.php delete mode 100644 tests/Pgsql/FilterHandler/BetweenHandlerTest.php delete mode 100644 tests/Pgsql/FilterHandler/EqualsHandlerTest.php delete mode 100644 tests/Pgsql/FilterHandler/EqualsNullHandlerTest.php delete mode 100644 tests/Pgsql/FilterHandler/GreaterThanHandlerTest.php delete mode 100644 tests/Pgsql/FilterHandler/GreaterThanOrEqualHandlerTest.php delete mode 100644 tests/Pgsql/FilterHandler/LessThanHandlerTest.php delete mode 100644 tests/Pgsql/FilterHandler/LessThanOrEqualHandlerTest.php delete mode 100644 tests/Pgsql/FilterHandler/LikeHandlerTest.php delete mode 100644 tests/Pgsql/FilterHandler/NotHandlerTest.php create mode 100644 tests/Pgsql/ReaderWithFilter/ReaderWithAllTest.php create mode 100644 tests/Pgsql/ReaderWithFilter/ReaderWithAnyTest.php create mode 100644 tests/Pgsql/ReaderWithFilter/ReaderWithBetweenTest.php create mode 100644 tests/Pgsql/ReaderWithFilter/ReaderWithEqualsNullTest.php create mode 100644 tests/Pgsql/ReaderWithFilter/ReaderWithEqualsTest.php create mode 100644 tests/Pgsql/ReaderWithFilter/ReaderWithGreaterThanOrEqualTest.php create mode 100644 tests/Pgsql/ReaderWithFilter/ReaderWithGreaterThanTest.php create mode 100644 tests/Pgsql/ReaderWithFilter/ReaderWithInTest.php create mode 100644 tests/Pgsql/ReaderWithFilter/ReaderWithLessThanOrEqualTest.php create mode 100644 tests/Pgsql/ReaderWithFilter/ReaderWithLessThanTest.php create mode 100644 tests/Pgsql/ReaderWithFilter/ReaderWithLikeTest.php create mode 100644 tests/Pgsql/ReaderWithFilter/ReaderWithNotTest.php delete mode 100644 tests/Sqlite/FilterHandler/AllHandlerTest.php delete mode 100644 tests/Sqlite/FilterHandler/AnyHandlerTest.php delete mode 100644 tests/Sqlite/FilterHandler/BetweenHandlerTest.php delete mode 100644 tests/Sqlite/FilterHandler/EqualsHandlerTest.php delete mode 100644 tests/Sqlite/FilterHandler/EqualsNullHandlerTest.php delete mode 100644 tests/Sqlite/FilterHandler/GreaterThanHandlerTest.php delete mode 100644 tests/Sqlite/FilterHandler/GreaterThanOrEqualHandlerTest.php delete mode 100644 tests/Sqlite/FilterHandler/LessThanHandlerTest.php delete mode 100644 tests/Sqlite/FilterHandler/LessThanOrEqualHandlerTest.php delete mode 100644 tests/Sqlite/FilterHandler/LikeHandlerTest.php delete mode 100644 tests/Sqlite/FilterHandler/NotHandlerTest.php create mode 100644 tests/Sqlite/ReaderWithFilter/ReaderWithAllTest.php create mode 100644 tests/Sqlite/ReaderWithFilter/ReaderWithAnyTest.php create mode 100644 tests/Sqlite/ReaderWithFilter/ReaderWithBetweenTest.php create mode 100644 tests/Sqlite/ReaderWithFilter/ReaderWithEqualsNullTest.php create mode 100644 tests/Sqlite/ReaderWithFilter/ReaderWithEqualsTest.php create mode 100644 tests/Sqlite/ReaderWithFilter/ReaderWithGreaterThanOrEqualTest.php create mode 100644 tests/Sqlite/ReaderWithFilter/ReaderWithGreaterThanTest.php create mode 100644 tests/Sqlite/ReaderWithFilter/ReaderWithInTestCase.php create mode 100644 tests/Sqlite/ReaderWithFilter/ReaderWithLessThanOrEqualTest.php create mode 100644 tests/Sqlite/ReaderWithFilter/ReaderWithLessThanTest.php create mode 100644 tests/Sqlite/ReaderWithFilter/ReaderWithLikeTest.php create mode 100644 tests/Sqlite/ReaderWithFilter/ReaderWithNotTest.php diff --git a/composer.json b/composer.json index 1f564f4..94926f7 100644 --- a/composer.json +++ b/composer.json @@ -31,7 +31,7 @@ "prefer-stable": true, "require": { "php": "^8.1", - "yiisoft/data": "dev-tests-reogranization", + "yiisoft/data": "dev-master", "yiisoft/db": "^1.3" }, "require-dev": { diff --git a/tests/Base/TestCase.php b/tests/Base/DataTrait.php similarity index 77% rename from tests/Base/TestCase.php rename to tests/Base/DataTrait.php index 075fd54..ee10162 100644 --- a/tests/Base/TestCase.php +++ b/tests/Base/DataTrait.php @@ -10,7 +10,7 @@ use Yiisoft\Db\Driver\Pdo\PdoConnectionInterface; use Yiisoft\Db\Query\Query; -abstract class TestCase extends \PHPUnit\Framework\TestCase +trait DataTrait { use FixtureTrait; @@ -45,6 +45,24 @@ protected function getReader(): DataReaderInterface return new QueryDataReader((new Query($db))->from('user')); } + protected function assertFixtures(array $expectedFixtureIndexes, array $actualFixtures): void + { + $processedActualFixtures = []; + foreach ($actualFixtures as $fixture) { + if (is_object($fixture)) { + $fixture = json_decode(json_encode($fixture), associative: true); + } + + unset($fixture['id']); + $fixture['number'] = (int) $fixture['number']; + $fixture['balance'] = (float) $fixture['balance']; + + $processedActualFixtures[$fixture['number'] - 1] = $fixture; + } + + parent::assertFixtures($expectedFixtureIndexes, $processedActualFixtures); + } + protected function populateDatabase(): void { /** @var PdoConnectionInterface $db */ diff --git a/tests/Base/FilterHandler/AllHandlerTest.php b/tests/Base/FilterHandler/AllHandlerTest.php deleted file mode 100644 index 375dd94..0000000 --- a/tests/Base/FilterHandler/AllHandlerTest.php +++ /dev/null @@ -1,13 +0,0 @@ -getConnection(); diff --git a/tests/Base/Reader/ReaderWithFilter/BaseReaderWithAllTestCase.php b/tests/Base/Reader/ReaderWithFilter/BaseReaderWithAllTestCase.php new file mode 100644 index 0000000..7aa5200 --- /dev/null +++ b/tests/Base/Reader/ReaderWithFilter/BaseReaderWithAllTestCase.php @@ -0,0 +1,12 @@ +