33use Contributte \Nextras \Orm \QueryObject \Exception \InvalidHydrationModeException ;
44use Contributte \Nextras \Orm \QueryObject \Queryable ;
55use Contributte \Nextras \Orm \QueryObject \Repository \TRepositoryQueryable ;
6+ use Contributte \Tester \Toolkit ;
67use Nextras \Dbal \Connection ;
78use Nextras \Dbal \QueryBuilder \QueryBuilder ;
89use Nextras \Dbal \Result \Result ;
10+ use Nextras \Orm \Collection \EmptyCollection ;
911use Nextras \Orm \Collection \ICollection ;
1012use Nextras \Orm \Mapper \Dbal \DbalMapper ;
1113use Tester \Assert ;
1214use Tests \Mocks \SimpleQueryObject ;
13- use Tests \Mocks \StubCollection ;
1415
1516require_once __DIR__ . '/../bootstrap.php ' ;
1617
@@ -26,7 +27,8 @@ class TestRepository
2627
2728}
2829
29- test ('TRepositoryQueryable injectConnection stores connection ' , function (): void {
30+ // Test: TRepositoryQueryable injectConnection stores connection
31+ Toolkit::test (static function (): void {
3032 $ connection = Mockery::mock (Connection::class);
3133
3234 $ repo = new TestRepository ();
@@ -42,7 +44,8 @@ test('TRepositoryQueryable injectConnection stores connection', function (): voi
4244 Mockery::close ();
4345});
4446
45- test ('TRepositoryQueryable fetch with HYDRATION_RESULTSET returns Result ' , function (): void {
47+ // Test: TRepositoryQueryable fetch with HYDRATION_RESULTSET returns Result
48+ Toolkit::test (static function (): void {
4649 $ connection = Mockery::mock (Connection::class);
4750 $ queryBuilder = Mockery::mock (QueryBuilder::class);
4851 $ result = Mockery::mock (Result::class);
@@ -85,11 +88,13 @@ test('TRepositoryQueryable fetch with HYDRATION_RESULTSET returns Result', funct
8588 Mockery::close ();
8689});
8790
88- test ('TRepositoryQueryable fetch with HYDRATION_ENTITY returns ICollection ' , function (): void {
91+ // Test: TRepositoryQueryable fetch with HYDRATION_ENTITY returns ICollection
92+ Toolkit::test (static function (): void {
8993 $ connection = Mockery::mock (Connection::class);
9094 $ queryBuilder = Mockery::mock (QueryBuilder::class);
9195 $ mapper = Mockery::mock (DbalMapper::class);
92- $ collection = new StubCollection ();
96+
97+ $ collection = new EmptyCollection ();
9398
9499 $ queryBuilder ->shouldReceive ('select ' )
95100 ->with ('* ' )
@@ -122,7 +127,8 @@ test('TRepositoryQueryable fetch with HYDRATION_ENTITY returns ICollection', fun
122127 Mockery::close ();
123128});
124129
125- test ('TRepositoryQueryable fetch throws InvalidHydrationModeException for invalid mode ' , function (): void {
130+ // Test: TRepositoryQueryable fetch throws InvalidHydrationModeException for invalid mode
131+ Toolkit::test (static function (): void {
126132 $ connection = Mockery::mock (Connection::class);
127133 $ queryBuilder = Mockery::mock (QueryBuilder::class);
128134
@@ -145,7 +151,7 @@ test('TRepositoryQueryable fetch throws InvalidHydrationModeException for invali
145151
146152 $ queryObject = new SimpleQueryObject ();
147153
148- Assert::exception (function () use ($ repo , $ queryObject ): void {
154+ Assert::exception (static function () use ($ repo , $ queryObject ): void {
149155 $ repo ->fetch ($ queryObject , 999 );
150156 }, InvalidHydrationModeException::class, 'Invalid hydration mode "999" ' );
151157
0 commit comments