File tree Expand file tree Collapse file tree
tests/system/Database/Live Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2929use Rector \CodingStyle \Rector \FuncCall \CountArrayToEmptyArrayComparisonRector ;
3030use Rector \Config \RectorConfig ;
3131use Rector \DeadCode \Rector \ClassMethod \RemoveUnusedPrivateMethodRector ;
32+ use Rector \DeadCode \Rector \ClassMethod \RemoveUselessReturnTagRector ;
3233use Rector \DeadCode \Rector \If_ \UnwrapFutureCompatibleIfPhpVersionRector ;
3334use Rector \DeadCode \Rector \MethodCall \RemoveEmptyMethodCallRector ;
3435use Rector \EarlyReturn \Rector \Foreach_ \ChangeNestedForeachIfsToEarlyContinueRector ;
129130
130131 // buggy on union mixed type, new class extends SomeClass marked as object in union, and false replaced with bool in Union
131132 TypedPropertyFromAssignsRector::class,
133+
134+ // rector mistakenly removes `@return true`
135+ RemoveUselessReturnTagRector::class => [
136+ __DIR__ . '/system/Debug/Exceptions.php ' ,
137+ ],
132138 ]);
133139
134140 // auto import fully qualified class names
Original file line number Diff line number Diff line change @@ -379,8 +379,6 @@ private function isDeprecationError(int $error): bool
379379 }
380380
381381 /**
382- * @noRector \Rector\DeadCode\Rector\ClassMethod\RemoveUselessReturnTagRector
383- *
384382 * @return true
385383 */
386384 private function handleDeprecationError (string $ message , ?string $ file = null , ?int $ line = null ): bool
Original file line number Diff line number Diff line change 1111
1212namespace CodeIgniter \Database \Live ;
1313
14+ use CodeIgniter \Database \Exceptions \DatabaseException ;
1415use CodeIgniter \Test \CIUnitTestCase ;
1516use CodeIgniter \Test \DatabaseTestTrait ;
1617use Config \Database ;
17- use Exception ;
1818use Tests \Support \Database \Seeds \CITestSeeder ;
1919
2020/**
@@ -78,7 +78,7 @@ public function testTransStartDBDebugTrue()
7878 $ builder ->insert ($ jobData );
7979
8080 $ this ->db ->transComplete ();
81- } catch (Exception $ e ) {
81+ } catch (DatabaseException $ e ) {
8282 // Do nothing.
8383
8484 // MySQLi
@@ -99,7 +99,7 @@ public function testTransStartDBDebugTrue()
9999 // ErrorException: oci_execute(): ORA-00001: unique constraint (ORACLE.pk_db_job) violated
100100 }
101101
102- $ this ->assertInstanceOf (Exception ::class, $ e );
102+ $ this ->assertInstanceOf (DatabaseException ::class, $ e );
103103 $ this ->dontSeeInDatabase ('job ' , ['name ' => 'Grocery Sales ' ]);
104104 }
105105
You can’t perform that action at this time.
0 commit comments