Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft PHP 8.1 min. #19879

Merged
merged 27 commits into from
Jul 10, 2023
Merged

Draft PHP 8.1 min. #19879

merged 27 commits into from
Jul 10, 2023

Conversation

terabytesoftw
Copy link
Member

Q A
Is bugfix?
New feature? ✔️
Breaks BC?

@what-the-diff
Copy link

what-the-diff bot commented Jul 4, 2023

  • Fixed composer version constraint to require PHP 8.0 or higher.
  • Renamed Object class to ObjectDeprecated.
  • Removed some unused dependencies and updated phpunit version to 9.6.
  • Added new workflow file ci-sqlite.yml for running tests with sqlite.
  • Modified db/Schema.php to add a check for null column names when quoting.
* * In `phpunit.xml.dist`, several attributes were added or modified, including `executionOrder`, `failOnRisky`, `failOnWarning`, and `coverage` settings.
* In `tests/IsOneOfAssert.php`, the `__construct` method was modified to use a shorthand property declaration and the `toString` method was modified to use `VarDumper::create()` instead of `VarDumper::dumpAsString()`.
* In `tests/ResultPrinter.php`, the class extends `\PHPUnit\TextUI\DefaultResultPrinter` instead of `\PHPUnit\TextUI\ResultPrinter`, and the `$out` property is now private and has a default value of `null`, and the `flush` method is now `public` instead of `public void`.
* In `tests/TestCase.php`, all methods that were previously `public static` are now `public static void`.
* In `tests/compatibility.php`, the file was deleted.
* In `tests/framework/BaseYiiTest.php`, the `setUp` and `tearDown` methods are now `public void` instead of `protected`.
* In `tests/framework/ChangeLogTest.php`, the `testContributorLine` method now uses `assertMatchesRegularExpression` instead of `assertRegExp`.
* In `tests/framework/base/ActionFilterTest.php`, the `setUp` method is now `protected void` instead of `protected`.
* In `tests/framework/base/BaseObjectTest.php`, the `setUp` and `tearDown` methods are now `protected void` instead of `protected`.
* In `tests/framework/base/BehaviorTest.php`, the `setUp` and `tearDown` methods are now `protected void` instead of `protected`.
* In `tests/framework/base/ComponentTest.php`, the `setUp` and `tearDown` methods are now `protected void` instead of `protected`.
* In `tests/framework/base/DynamicModelTest.php`, the `setUp` and `tearDown` methods are now `protected void` instead of `protected`.
* In `tests/framework/base/EventTest.php`, the `setUp` method is now `protected void` instead of `protected`.
* In `tests/framework/base/ModelTest.php`, the `setUp` and `tearDown` methods are now `protected void` instead of `protected`.
* In `tests/framework/base/ModuleTest.php`, the `setUp` and `tearDown` methods are now `protected void` instead of `protected`.
* In `tests/framework/base/SecurityTest.php`, the `setUp` and `tearDown` methods are now `protected void` instead of `protected`, and the `randomKeyInvalidInput` method now throws an exception using `expectException` instead of `assertRaises`.
* In `tests/framework/base/ThemeTest.php`, the `setUp` method is now `protected void` instead of `protected`.
* In `tests/framework/base/ViewTest.php`, the `setUp` and `tearDown` methods are now `protected void` instead of `protected`.
* In `tests/framework/base/WidgetTest.php`, the `tearDown` method is now `protected void` instead of `protected`.
* In `tests/framework/behaviors/AttributeBehaviorTest.php`, the `setUp` and `tearDown` methods are now `protected void` instead of `protected`.
* In `tests/framework/behaviors/AttributeTypecastBehaviorTest.php`, the `setUp` and `tearDown` methods are now `protected void` instead of `protected`.
* In `tests/framework/behaviors/AttributesBehaviorTest.php`, the `setUp` and `tearDown` methods are now `protected void` instead of `protected`.
* In `tests/framework/behaviors/BlameableBehaviorConsoleTest.php`, the `setUp` and `tearDown` methods are now `protected void` instead of `protected`.
* In `tests/framework/behaviors/BlameableBehaviorTest.php`, the `setUp` and `tearDown` methods are now `protected void` instead of `protected`.
* In `tests/framework/behaviors/CacheableWidgetBehaviorTest.php`, the `setUp` method is now `protected void` instead of `protected`.
* In `tests/framework/behaviors/ContentNegotiatorTest.php`, the `setUp` and `tearDown` methods are now `protected void` instead of `protected`.
* In `tests/framework/behaviors/ControllerBehaviorTest.php`, the `setUp` and `tearDown` methods are now `protected void` instead of `protected`.
* In `tests/framework/behaviors/TimestampBehaviorTest.php`, the `setUp` and `tearDown` methods are now `protected void` instead of `protected`.
* In `tests/framework/behaviors/TrimAttributesBehaviorTest.php`, the `setUp` and `tearDown` methods are now `protected void` instead of `protected`.
* In `tests/framework/behaviors/UpdateAttributesBehaviorTest.php`, the `setUp` and `tearDown` methods are now `protected void` instead of `protected`.
* In `tests/framework/cache/AbstractDependencyTestTrait.php`, the `setUp` and `tearDown` methods are now `protected void` instead of `protected`.
* In `tests/framework/cache/CacheTest.php`, the `tearDown` method is now `protected void` instead of `protected`.
* In `tests/framework/cache/DbCacheTest.php`, the `tearDown` method is now `protected void` instead of `protected`.
* In `tests/framework/cache/FileCacheTest.php`, the `tearDown` method is now `protected void` instead of `protected`.
* In `tests/framework/cache/MemCacheTest.php`, the `tearDown` method is now `protected void` instead of `protected`.
* In `tests/framework/cache/MultiLevelCacheTest.php`, the `setUp` and `tearDown` methods are now `protected void` instead of `protected`.
* In `tests/framework/cache/RedisCacheTest.php`, the `tearDown` method is now `protected void` instead of `protected`.
* In `tests/framework/cache/WinCacheTest.php`, the `setUp` and `tearDown` methods are now `protected void` instead of `protected`.
* In `tests/framework/db/ActiveQueryTest.php`, the `setUp` method is now `protected void` instead of `protected`.
* In `tests/framework/db/ActiveRecordTest.php`, the `tearDown` method is now `protected void` instead of `protected`.
* In `tests/framework/db/QueryScalarTest.php`, the `setUp` method is now `protected void` instead of `protected`.
* In `tests/framework/http/CacheTest.php`, the `tearDown` method is now `protected void` instead of `protected`.
* In `tests/framework/http/RequestTest.php`, the `setUp` and `tearDown` methods are now `protected void` instead of `protected`.
* In `tests/framework/http/ServerRequestTest.php`, the `tearDown` method is now `protected void` instead of `protected`.
* In `tests/framework/i18n/FallbackMessageSourceTest.php`, the `setUp` method is now `protected void` instead of `protected`.
* In `tests/framework/i18n/GettextMessageSourceTest.php`, the `setUp` method is now `protected void` instead of `protected`.
* In `tests/framework/i18n/I18NTest.php`, the `setUp` method is now `protected void` instead of `protected`.
* In `tests/framework/i18n/MessageTest.php`, the `tearDown` method is now `protected void` instead of `protected`.
* In `tests/framework/i18n/PhpMessageSourceTest.php`, the `setUp` method is now `protected void` instead of `protected`.
* In `tests/framework/i18n/SimpleMessageSourceTest.php`, the `tearDown` method is now `protected void` instead of `protected`.
* In `tests/framework/mailer/BaseMailerTest.php`, the `tearDown` method is now `protected void` instead of `protected`.
* In `tests/framework/validators/CompareValidatorTest.php`, the `setUp` and `tearDown` methods are now `protected void` instead of `protected`.
* In `tests/framework/validators/DefaultValueValidatorTest.php`, the `setUp` and `tearDown` methods are now `protected void` instead of `protected`.
* In `tests/framework/validators/EmailValidatorTest.php`, the `tearDown` method is now `protected void` instead of `protected`.
* In `tests/framework/validators/FileValidatorTest.php`, the `setUp` method is now `protected void` instead of `protected`.
* In `tests/framework/validators/ImageValidatorTest.php`, the `tearDown` method is now `protected void` instead of `protected`.
* In `tests/framework/validators/NumberValidatorTest.php`, the `setUp` method is now `protected void` instead of `protected`.
* In `tests/framework/validators/RequiredValidatorTest.php`, the `tearDown` method is now `protected void` instead of `protected`.
* In `tests/framework/validators/SafeValidatorTest.php`, the `setUp` method is now `protected void` instead of `protected`.
* In `tests/framework/validators/StringValidatorTest.php`, the `tearDown` method is now `protected void` instead of `protected`.
* In `tests/framework/web/AppTest.php`, the `setUp` method is now `protected void` instead of `protected`.
* In `tests/framework/web/AssetConverterTest.php`, the `setUp` method is now `protected void` instead of `protected`.
* In `tests/framework/web/AssetManagerTest.php`, the `tearDown` method is now `protected void` instead of `protected`.
* In `tests/framework/web/AssetRequestTest.php`, the `setUp` and `tearDown` methods are now `protected void` instead of `protected`.
* In `tests/framework/web/CacheTest.php`, the `tearDown` method is now `protected void` instead of `protected`.
* In `tests/framework/web/ControllerTest.php`, the `setUp` and `tearDown` methods are now `protected void` instead of `protected`.
* In `tests/framework/web/ErrorHandlerTest.php`, the `setUp` and `tearDown` methods are now `protected void` instead of `protected`.
* In `tests/framework/web/ForbiddenHttpExceptionTest.php`, the `setUp` method is now `protected void` instead of `protected`.
* In `tests/framework/web/ForbiddenHttpExceptionTest.php`, the `tearDown` method is now `protected void` instead of `protected`.
* In `tests/framework/web/IdentityInterfaceTest.php`, the `tearDown` method is now `protected void` instead of `protected`.
* In `tests/framework/web/JavascriptTest.php`, the `setUp` method is now `protected void` instead of `protected`.
* In `tests/framework/web/MethodNotAllowedHttpExceptionTest.php`, the `setUp` method is now `protected void` instead of `protected`.
* In `tests/framework/web/MethodNotAllowedHttpExceptionTest.php`, the `tearDown` method is now `protected void` instead of `protected`.
* In `tests/framework/web/NotFoundHttpExceptionTest.php`, the `setUp` method is now `protected void` instead of `protected`.
* In `tests/framework/web/NotFoundHttpExceptionTest.php`, the `tearDown` method is now `protected void` instead of `protected`.
* In `tests/framework/web/RequestTest.php`, the `setUp` and `tearDown` methods are now `protected void` instead of `protected`.
* In `tests/framework/web/ResponseTest.php`, the `setUp` method is now `protected void` instead of `protected`.
* In `tests/framework/web/ServerErrorHttpExceptionTest.php`, the `setUp` method is now `protected void` instead of `protected`.
* In `tests/framework/web/ServerErrorHttpExceptionTest.php`, the `tearDown` method is now `protected void` instead of `protected`.
* In `tests/framework/web/ServiceUnavailableHttpExceptionTest.php`, the `setUp` method is now `protected void` instead of `protected`.
* In `tests/framework/web/ServiceUnavailableHttpExceptionTest.php`, the `tearDown` method is now `protected void` instead of `protected`.
* In `tests/framework/web/TooManyRequestsHttpExceptionTest.php`, the `setUp` method is now `protected void` instead of `protected`.
* In `tests/framework/web/TooManyRequestsHttpExceptionTest.php`, the `tearDown` method is now `protected void` instead of `protected`.
* In `tests/framework/web/UploadedFileTest.php`, the `tearDown` method is now `protected void` instead of `protected`.
* In `tests/framework/web/UserTest.php`, the `tearDown` method is now `protected void` instead of `protected`.
* In `tests/httpclient/ClientTestTrait.php`, the `tearDown` method is now `protected void` instead of `protected`.
* In `tests/httpclient/ErrorEventTest.php`, the `tearDown` method is now `protected void` instead of `protected`.
* In `tests/httpclient/FormDataTraitTest.php`, the `tearDown` method is now `protected void` instead of `protected`.
* In `tests/httpclient/XmlParserTest.php`, the `tearDown` method is now `protected void` instead of `protected`.
* In `tests/httpclient/YiisoftSoapClientTest.php`, the `tearDown` method is now `protected void` instead of `protected`.
  • In tests/framework/behaviors/OptimisticLockBehaviorTest.php:
  • The setUpBeforeClass method was changed to return type void
  • The setUp method was changed to return type void
  • The tearDown method was changed to return type void
  • The testUpdateRecord method:
    • The assertContains method was changed to assertStringContainsString
  • The testDeleteRecord method:
    • The assertContains method was changed to assertStringContainsString
  • In tests/framework/behaviors/SluggableBehaviorTest.php:
  • The setUpBeforeClass method was changed to return type void
  • The setUp method was changed to return type void
  • The tearDown method was changed to return type void
  • In tests/framework/behaviors/TimestampBehaviorTest.php:
  • The setUpBeforeClass method was changed to return type void
  • The setUp method was changed to return type void
  • The tearDown method was changed to return type void
  • In tests/framework/caching/CacheTestCase.php:
  • The setUp method was changed to return type void
  • The tearDown method was changed to return type void
  • In tests/framework/caching/DbCacheTest.php:
  • The setUp method was changed to return type void
  • In tests/framework/caching/DbDependencyTest.php:
  • The setUp method was changed to return type void
  • In tests/framework/caching/DbQueryDependencyTest.php:
  • The setUp method was changed to return type void
  • In tests/framework/caching/FileCacheTest.php:
  • The setUp method was changed to return type void
  • In tests/framework/caching/MssqlCacheTest.php:
  • The setUp method was changed to return type void
  • In tests/framework/caching/PgSQLCacheTest.php:
  • The setUp method was changed to return type void
  • In tests/framework/console/ControllerTest.php:
  • The setUp method was changed to return type void
  • The testHelpOption method:
    • The assertContains method was changed to assertStringContainsString
  • In tests/framework/console/UnknownCommandExceptionTest.php:
  • The setUp method was changed to return type void
  • In tests/framework/console/controllers/AssetControllerTest.php:
  • The setUp method was changed to return type void
  • The tearDown method was changed to return type void
  • The testActionTemplate method:
    • The assertInternalType method was changed to assertIsArray
  • The testActionCompress method:
    • The assertInternalType method was changed to assertIsArray
    • The assertContains method was changed to assertStringContainsString
    • The assertContains method was changed to assertStringContainsString
  • In tests/framework/console/controllers/BaseMessageControllerTest.php:
  • The setUp method was changed to return type void
  • The tearDown method was changed to return type void
  • In tests/framework/console/controllers/CacheControllerTest.php:
  • The setUp method was changed to return type void
  • The tearDown method was changed to return type void
  • The testNothingToFlushException method:
    • The exception type was changed to \yii\console\Exception
  • In tests/framework/console/controllers/DbMessageControllerTest.php:
  • The setUpBeforeClass method was changed to return type void
  • The tearDownAfterClass method was changed to return type void
  • The tearDown method was changed to return type void
  • In tests/framework/console/controllers/FixtureControllerTest.php:
  • The setUp method was changed to return type void
  • The tearDown method was changed to return type void
  • The testNoFixturesWereFoundInLoad method:
    • The exception type was changed to \yii\console\Exception
  • The testNoFixturesWereFoundInUnload method:
    • The exception type was changed to \yii\console\Exception
  • In the file tests/framework/console/controllers/HelpControllerTest.php, several assertions using the method assertContains were replaced with the method assertStringContainsString. This change was done to fix deprecated warnings and improve compatibility (#21170).
  • In the file tests/framework/console/controllers/MigrateControllerTest.php, several assertions using the method assertContains were replaced with the method assertStringContainsString. This change was done to fix deprecated warnings and improve compatibility (#21170).
  • In the file tests/framework/console/controllers/MigrateControllerTestTrait.php, several assertions using the method assertContains were replaced with the method assertStringContainsString. This change was done to fix deprecated warnings and improve compatibility (#21170).
  • In the file tests/framework/console/controllers/PHPMessageControllerTest.php, the assertFileNotExists assertion was replaced with assertFileDoesNotExist. This change was done to fix deprecated warnings and improve compatibility (#21170).
  • In the file tests/framework/data/ActiveDataFilterTest.php, the assertFileContains assertion was replaced with assertStringContainsString. This change was done to fix deprecated warnings and improve compatibility (#21170).
  • In the file tests/framework/data/ActiveDataProviderTest.php, the assertInternalType assertion was replaced with assertIsArray. This change was done to fix deprecated warnings and improve compatibility (#21170).
  • In the file tests/framework/data/ArrayDataProviderTest.php, no changes were made.
  • In the file tests/framework/data/DataFilterTest.php, no changes were made.
  • In the file tests/framework/data/PaginationTest.php, no changes were made.
  • In the file tests/framework/data/SortTest.php, no changes were made.
  • In the file tests/framework/db/ActiveQueryModelConnectionTest.php, no changes were made.
  • In the file tests/framework/db/ActiveQueryTest.php, no changes were made.
  • In the file tests/framework/db/ActiveRecordTest.php, several assertions using the method assertInternalType were replaced with the method assertIsArray. This change was done to fix deprecated warnings and improve compatibility (#21170).
  • In the file tests/framework/db/BatchQueryResultTest.php, no changes were made.
* In the `CommandTest.php` file:
- In line 198, the value of `$floatCol` was changed from `1.23` to `1.230`.
- In line 282, the assertion method `assertInternalType` was changed to `assertIsObject`.
- In lines 317-337, the code was modified to use a generator function and a call to `assertIsResource` was changed to `assertIsResource`.
- In lines 637-639, the assertion method `assertEmpty` was changed to `assertMatchesRegularExpression`.
- In lines 636-641, the code was modified to use an anonymous function instead of including a separate file.
* In the `ConnectionTest.php` file:
- In line 229, the assertion was modified to use the method `expectException` instead of the annotation `@expectedException`.
* In the `DatabaseTestCase.php` file:
- In lines 27-31, the method signatures `setUp` and `tearDown` were changed to `protected function setUp(): void` and `protected function tearDown(): void` respectively.
* In the `QueryTest.php` file:
- In line 337, the assertion method `assertContains` was changed to `assertEquals` and the values in the assertion were changed.
* In the `SchemaTest.php` file:
- In line 532, the assertion method `assertInternalType` was changed to `assertIsObject`.
- In lines 786-788, the assertion method `assertMatchesRegularExpression` was added.
* In the `CommandTest.php` (mssql) file:
- In line 58, the value of `$floatCol` was changed from `1.23` to `1.230`.
- In line 117, the assertion method `assertRegExp` was changed to `assertMatchesRegularExpression`.
* In the `QueryTest.php` (mysql) file:
- In line 45, the assertion methods `assertContains` were changed to `assertEquals` and the values in the assertions were changed.
* In the `DeadLockTest.php` (mysql) file:
- In line 72, the assertion was modified to use the method `expectException` instead of the annotation `@expectedException`.
* In the `ArrayParserTest.php` (pgsql) file:
- In line 30, the method signature `setUp` was changed to `protected function setUp(): void`.
* In the `ConnectionTest.php` (pgsql) file:
- In line 22, the method signature `setUp` was changed to `protected function setUp(): void`.
* In the `InstanceTest.php` file:
- In line 78, the annotation `@expectedExceptionMessageRegExp` was changed to a call to `expectException` without a message, since the message is different in each test case.
- In line 90, the annotation `@expectedExceptionMessageRegExp` was changed to a call to `expectException` without a message, since the message is different in each test case.
- In line 175, the annotation `@expectedExceptionMessageRegExp` was changed to a call to `expectException` without a message, since the message is different in each test case.
- In lines 191-193, the methods `testVariadicConstructor` and `testVariadicCallable` were removed, which are related to PHP 5.6 and HHVM, which are not supported in the new version.
- In line 286, the assertion method `assertInternalType` was changed to `assertIsArray`.
* In the `AccessRuleTest.php` file:
- In line 26, the method signature `setUp` was changed to `protected function setUp(): void`.
* In the `ContentNegotiatorTest.php` file:
- In line 63, the annotation `@expectedException` was changed to a call to `expectException`.
- In line 68, the annotation `@expectedException` was changed to a call to `expectException`.
* In the `HostControlTest.php` file:
- In line 21, the method signature `setUp` was changed to `protected function setUp(): void`.
* In the `HttpCacheTest.php` file:
- In line 17, the method signature `setUp` was changed to `protected function setUp(): void`.
* In the `PageCacheTest.php` file:
- In line 29, the method signature `setUp` was changed to `protected function setUp(): void`.
* In the `RateLimiterTest.php` file:
- In line 21, the method signature `setUp` was changed to `protected function setUp(): void`.
* In the `AuthMethodTest.php` file:
- In line 16, the method signature `setUp` was changed to `protected function setUp(): void`.
* In the `AuthTest.php` file:
- In line 25, the method signature `setUp` was changed to `protected function setUp(): void`.
* In the `CompositeAuthTest.php` file:
- In line 107, the method signature `setUp` was changed to `protected function setUp(): void`.
* In the `ActionColumnTest.php` file, the `assertContains` method was replaced with `assertStringContainsString` method on lines 72, 78, 84, 94, 100.
* In the `CheckboxColumnTest.php` file, the `setUp` method was changed to `setUp(): void` on line 24, and the `assertContains` method was replaced with `assertStringContainsString` method on lines 83, 88, 92, 97, 102, 108, 113.
* In the `GridViewTest.php` file, the `setUp` method was changed to `setUp(): void` on line 20.
* In the `RadiobuttonColumnTest.php` file, the testException method was changed to use `expectException` on line 31, and the `assertContains` method was replaced with `assertStringContainsString` method on lines 70, 73.
* In the `ArrayHelperTest.php` file, the `setUp` method was changed to `setUp(): void` on line 22, and the `assertContains` method was replaced with `assertStringContainsString` method on line 826.
* In the `BaseConsoleTest.php` file, the `setUp` method was changed to `setUp(): void` on line 14.
* In the `ConsoleTest.php` file, the `setUp` method was changed to `setUp(): void` on line 14.
* In the `FileHelperTest.php` file, the `setUp` method was changed to `setUp(): void` on line 20, and the `assertFileNotExists` method was replaced with `assertFileDoesNotExist` method on lines 338, 416.
* In the `FormatConverterTest.php` file, the `setUp` method was changed to `setUp(): void` on line 20, and the `assertRegExp` method was replaced with `assertMatchesRegularExpression` method on line 358.
* In the `HtmlTest.php` file, the `setUp` method was changed to `setUp(): void` on line 19, the `assertContains` method was replaced with `assertStringContainsString` method on lines 1994, 2160, 2150, 2026, 2121, and a new `getInputIdDataProvider` method was added starting on line 2200.
* In the `InflectorTest.php` file, the `setUp` method was changed to `setUp(): void` on line 15.
* In the `IpHelperTest.php` file, the `testIpv6ExpandingWithInvalidValue` method was changed to use `expectException` on line 56.
* In the `JsonTest.php` file, the `setUp` method was changed to `setUp(): void` on line 19, and the `expectException` method was replaced with `expectExceptionMessage` on line 208.
* In the `MarkdownTest.php` file, the `setUp` method was changed to `setUp(): void` on line 18, and the `expectException` method was replaced with `expectExceptionMessage` on line 46.
* In the `StringHelperTest.php` file, the `setUp` method was changed to `setUp(): void` on line 17.
  • In the UrlTest.php file:
  • The setUp method was changed to setUp(): void.
  • The tearDown method was changed to tearDown(): void.
  • The testToWithSuffix method had assertRegExp changed to assertMatchesRegularExpression.
  • In the VarDumperTest.php file:
  • The setUp method was changed to setUp(): void.
  • The testDumpIncompleteObject method had assertContains changed to assertStringContainsString.
  • The testExportIncompleteObject method had assertContains changed to assertStringContainsString.
  • The testDumpObject method had assertContains changed to assertStringContainsString.
  • The testDumpClassWithCustomDebugInfo method had assertContains changed to assertStringContainsString and assertNotContains changed to assertStringNotContainsString.
  • In the DbMessageSourceTest.php file:
  • The setUpBeforeClass method was changed to setUpBeforeClass(): void.
  • The tearDownAfterClass method was changed to tearDownAfterClass(): void.
  • In the FormatterDateTest.php file:
  • The setUp method was changed to setUp(): void.
  • The tearDown method was changed to tearDown(): void.
  • The testIntlAsDatetime method had assertRegExp changed to assertMatchesRegularExpression.
  • The testAsDatetime method had assertRegExp changed to assertMatchesRegularExpression.
  • The testIntlCustomPattern method had assertRegExp changed to assertMatchesRegularExpression.
  • In the FormatterNumberTest.php file:
  • The setUp method was changed to setUp(): void.
  • The tearDown method was changed to tearDown(): void.
  • In the FormatterTest.php file:
  • The setUp method was changed to setUp(): void.
  • The tearDown method was changed to tearDown(): void.
  • In the GettextPoFileTest.php file:
  • The setUp method was changed to setUp(): void.
  • In the I18NTest.php file:
  • The setUp method was changed to setUp(): void.
  • In the LocaleTest.php file:
  • The setUp method was changed to setUp(): void.
  • The tearDown method was changed to tearDown(): void.
  • In the DbTargetTest.php file:
  • The setUp method was changed to setUp(): void.
  • The tearDown method was changed to tearDown(): void.
  • In the DispatcherTest.php file:
  • The setUp method was changed to setUp(): void.
  • In the EmailTargetTest.php file:
  • The setUp method was changed to setUp(): void.
  • The testInitWithoutOptionTo method had an exception thrown (InvalidConfigException - The "to" option must be set for EmailTarget::message).
  • In the FileTargetTest.php file:
  • The setUp method was changed to setUp(): void.
  • The testInit method had assertFileNotExists changed to assertFileDoesNotExist.
  • The testRotate method had assertFileNotExists changed to assertFileDoesNotExist.
  • In the LoggerTest.php file:
  • The setUp method was changed to setUp(): void.
  • In the SyslogTargetTest.php file:
  • The setUp method was changed to setUp(): void.
  • In the TargetTest.php file:
  • The testGetContextMessage method had assertContains changed to assertStringContainsString and assertNotContains changed to assertStringNotContainsString.
  • In the BaseMailerTest.php file:
  • The setUp method was changed to setUp(): void.
  • The tearDown method was changed to tearDown(): void.
  • In the BaseMessageTest.php file:
  • The setUp method was changed to setUp(): void.
  • In the FileMutexTest.php file:
  • The testDeleteLockFile method had assertFileNotExists changed to assertFileDoesNotExist.
  • In the MysqlMutexTest.php file:
  • The setUp method was changed to setUp(): void.
  • In the PgsqlMutexTest.php file:
  • The setUp method was changed to setUp(): void.
    Each file had changes made to the setUp and tearDown methods, as well as some test methods having their assertions replaced with updated ones. Additionally, there was an exception thrown in the EmailTargetTest.php file.
  • Added a new test method testGetAssignmentsByRole() in the file tests/framework/rbac/DbManagerTestCase.php. This test method asserts the expected results of calling getUserIdsByRole() method in the DbManager class.
  • Made changes to the method signatures in the file tests/framework/rbac/DbManagerTestCase.php. The setUpBeforeClass(), setUp(), and tearDown() methods now have a return type void.
  • Made changes to the assertion method in the file tests/framework/rbac/DbManagerTestCase.php. Replaced assertContains() method with assertStringContainsString() method in the assertSingleQueryToAssignmentsTable() method.
  • Made changes to the method signatures in the file tests/framework/rbac/PhpManagerTest.php. The setUp() and tearDown() methods now have a return type void.
  • Added a new test method testOverwriteName() in the file tests/framework/rbac/PhpManagerTest.php. This test method tests if you can overwrite the name of a permission and throws an InvalidParamException if the name is already used.
  • Added a new test method testSaveAssignments() in the file tests/framework/rbac/PhpManagerTest.php. This test method adds and updates roles and asserts the expected content in a file.
  • Made changes to the method signature in the file tests/framework/rest/IndexActionTest.php. The setUp() method now has a return type void.
  • Made changes to the method signature in the file tests/framework/rest/SerializerTest.php. The setUp() method now has a return type void.
  • Made changes to the method signature in the file tests/framework/rest/UrlRuleTest.php. The setUp() method now has a return type void.
  • Renamed the testGetCreateUrlStatusProvider() method to getCreateUrlStatusProvider() in the file tests/framework/rest/UrlRuleTest.php.
  • Made changes to the assertion method in the file tests/framework/rest/UrlRuleTest.php. Replaced assertContains() method with assertStringContainsString() method in the testGetCreateUrlStatus() method.
  • Made changes to the method signatures in the file tests/framework/test/ActiveFixtureTest.php. The setUp() and tearDown() methods now have a return type void.
  • Made changes to the method signature in the file tests/framework/test/ArrayFixtureTest.php. The setUp() method now has a return type void.
  • Added a new test method testWrongDataFileException() in the file tests/framework/test/ArrayFixtureTest.php. This test method sets a wrong data file path and expects an InvalidConfigException to be thrown.
  • Made changes to the method signatures in the file tests/framework/validators/BooleanValidatorTest.php. The setUp() method now has a return type void.
  • Made changes to the method signatures in the file tests/framework/validators/CompareValidatorTest.php. The setUp() method now has a return type void.
  • Made changes to the method signatures in the file tests/framework/validators/DateValidatorTest.php. The setUp() method now has a return type void.
  • Made changes to the method signatures in the file tests/framework/validators/DefaultValueValidatorTest.php. The setUp() method now has a return type void.
  • Made changes to the method signatures in the file tests/framework/validators/EachValidatorTest.php. The setUp() method now has a return type void.
  • Made changes to the method signatures in the file tests/framework/validators/EmailValidatorTest.php. The setUp() method now has a return type void.
  • Made changes to the method signatures in the file tests/framework/validators/ExistValidatorTest.php. The setUp() method now has a return type void.
  • Made changes to the method signatures in the file tests/framework/validators/FileValidatorTest.php. The setUp() method now has a return type void.
  • Made changes to the assertion method in the file tests/framework/validators/FileValidatorTest.php. Replaced assertFileNotExists() method with assertFileDoesNotExist() method in the testSourcesPublish_AssetManagerBeforeCopy() and testSourcesPublish_AssetBeforeCopy() methods.
  • Made changes to the method signatures in the file tests/framework/validators/FilterValidatorTest.php. The setUp() method now has a return type void.
  • Made changes to the method signatures in the file tests/framework/validators/IpValidatorTest.php. The setUp() method now has a return type void.
  • Made changes to the method signatures in the file tests/framework/validators/NumberValidatorTest.php. The setUp() method now has a return type void.
  • Made changes to the assertion method in the file tests/framework/validators/NumberValidatorTest.php. Replaced assertRegExp() method with assertMatchesRegularExpression() method in the testClientValidateComparison() method.
  • Made changes to the method signatures in the file tests/framework/validators/RangeValidatorTest.php. The setUp() method now has a return type void.
  • Made changes to the method signature in the file tests/framework/validators/RegularExpressionValidatorTest.php. The setUp() method now has a return type void.
  • Made changes to the method signatures in the file tests/framework/validators/RequiredValidatorTest.php. The setUp() method now has a return type void.
  • Made changes to the method signatures in the file tests/framework/validators/StringValidatorTest.php. The setUp() method now has a return type void.
  • Made changes to the assertion method in the file tests/framework/validators/StringValidatorTest.php. Replaced assertInternalType() method with assertIsString() method in the testEnsureMessagesOnInit() method.
  • Made changes to the method signatures in the file tests/framework/validators/UniqueValidatorTest.php. The setUp() method now has a return type void.
  • Made changes to the assertion method in the file tests/framework/validators/UniqueValidatorTest.php. Replaced assertInternalType() method with assertIsString() method in the testAssureMessageSetOnInit() method.
  • Made changes to the method signatures in the file tests/framework/validators/UrlValidatorTest.php. The setUp() method now has a return type void.
  • Made changes to the method signatures in the file tests/framework/validators/ValidatorTest.php. The setUp() method now has a return type void.
  • Made changes to the method signatures in the file tests/framework/web/AssetBundleTest.php. The setUp() method now has a return type void.
  • Made changes to the assertion method in the file tests/framework/web/AssetBundleTest.php. Replaced assertFileNotExists() method with assertFileDoesNotExist() method.
  • Made changes to the method signatures in the file tests/framework/web/JqueryAssetTest.php. The setUp() method now has a return type void.
  • Made changes to the method signatures in the file tests/framework/web/JqueryAssetTest.php. The setUp() method now has a return type void.
  • Made changes to the method signatures in the file tests/framework/yii/helpers/BaseJsonTest.php. The setUp() method now has a return type void.
* In `tests/framework/web/AssetConverterTest.php`, the `setUp` and `tearDown` methods are changed to include the return type declaration `: void`.
* In `tests/framework/web/ControllerTest.php`, the `setUp` method is changed to include the return type declaration `: void`.
* In `tests/framework/web/ErrorActionTest.php`, the `setUp` method is changed to include the return type declaration `: void`. The `testDefaultView` and `testLayout` methods are also modified to use the `$this->expectException()` method instead of the `$this->expectExceptionMessageRegExp()` method.
* In `tests/framework/web/ErrorHandlerTest.php`, the `setUp` method is changed to include the return type declaration `: void`. The `testClearAssetFilesInErrorActionView` and `testRenderCallStackItem` methods are modified to use the `$this->assertStringNotContainsString()` method instead of the `$this->assertNotContains()` method.
* In `tests/framework/web/FormatterTest.php`, the `setUp` method is changed to include the return type declaration `: void`.
* In `tests/framework/web/GroupUrlRuleTest.php`, the `setUp` method is changed to include the return type declaration `: void`.
* In `tests/framework/web/RequestTest.php`, the `testCsrfTokenContainsASCIIOnly`, `testSetHostInfo`, `testGetScriptFileWithEmptyServer`, and `testGetScriptUrlWithEmptyServer` methods are modified to use the `$this->assertMatchesRegularExpression()` method instead of the `$this->assertRegExp()` method.
* In `tests/framework/web/ResponseTest.php`, the `setUp` method is changed to include the return type declaration `: void`.
* In `tests/framework/web/UploadedFileTest.php`, the `setUp` method is changed to include the return type declaration `: void`.
* In `tests/framework/web/UrlManagerParseUrlTest.php`, the `tearDown` method is changed to include the return type declaration `: void`.
* In `tests/framework/web/UrlNormalizerTest.php`, the `setUp` method is changed to include the return type declaration `: void`.
* In `tests/framework/web/UrlRuleTest.php`, the `setUp` method is changed to include the return type declaration `: void`. The `testGetCreateUrlStatus` and `getCreateUrlStatusProvider` methods are modified to use the `$this->expectException()` method instead of the `$this->expectExceptionMessageRegExp()` method.
* In `tests/framework/web/UserTest.php`, the `tearDown` method is changed to include the return type declaration `: void`.
* In `tests/framework/web/session/AbstractDbSessionTest.php`, the `setUp` and `tearDown` methods are changed to include the return type declaration `: void`.
* In `tests/framework/web/session/CacheSessionTest.php`, the `setUp` method is changed to include the return type declaration `: void`.
* In `tests/framework/web/session/mssql/DbSessionTest.php`, the `setUp` method is changed to include the return type declaration `: void`.
* In `tests/framework/web/session/mysql/DbSessionTest.php`, the `setUp` method is changed to include the return type declaration `: void`.
* In `tests/framework/web/session/pgsql/DbSessionTest.php`, the `setUp` method is changed to include the return type declaration `: void`.
* In `tests/framework/web/session/sqlite/DbSessionTest.php`, the `setUp` method is changed to include the return type declaration `: void`.
* In `tests/framework/widgets/ActiveFieldTest.php`, the `setUp` method is changed to include the return type declaration `: void`. The `testInputOptionsTransferToWidget` method is modified to use the `$this->assertStringContainsString()` method instead of the `$this->assertContains()` method.
* In `tests/framework/widgets/ActiveFormTest.php`, the `setUp` method is changed to include the return type declaration `: void`.
* In `tests/framework/widgets/BlockTest.php`, the `setUp` method is changed to include the return type declaration `: void`.
* In `tests/framework/widgets/BreadcrumbsTest.php`, the `setUp` method is changed to include the return type declaration `: void`.
* In `tests/framework/widgets/ContentDecoratorTest.php`, the `setUp` method is changed to include the return type declaration `: void`.
* In `tests/framework/widgets/DetailViewTest.php`, the `setUp` method is changed to include the return type declaration `: void`.
* In `tests/framework/widgets/FragmentCacheTest.php`, the `setUp` method is changed to include the return type declaration `: void`.
* In `tests/framework/widgets/LinkPagerTest.php`, the `setUp` method is changed to include the return type declaration `: void`. The `testFirstLastPageLabels`, `testDisabledPageElementOptions`, `testOptionsWithTagOption`, `testLinkWrapOptions`, and `testDisableCurrentPageButton` methods are modified to use the `$this->assertStringContainsString()` and `$this->assertStringNotContainsString()` methods instead of the `$this->assertContains()` and `$this->assertNotContains()` methods.
* In `tests/framework/widgets/LinkSorterTest.php`, the `setUp` method is changed to include the return type declaration `: void`.
* In `tests/framework/widgets/ListViewTest.php`, the `setUp` method is changed to include the return type declaration `: void`.
* In `tests/framework/widgets/MenuTest.php`, the `setUp` method is changed to include the return type declaration `: void`.
* In `tests/framework/widgets/PjaxTest.php`, the `setUp` method is changed to include the return type declaration `: void`.
* In `tests/framework/widgets/ListViewTest.php`, the `setUp` method is changed to include the return type declaration `: void`.
* In `tests/framework/widgets/MenuTest.php`, the `setUp` method is changed to include the return type declaration `: void`.
* In `tests/framework/widgets/PjaxTest.php`, the `setUp` method is changed to include the return type declaration `: void`.


@terabytesoftw
Copy link
Member Author

terabytesoftw commented Jul 4, 2023

This is a preliminary version, some comments:

  • The version of PHPUNIT was increased to 9.6.
  • Compatibility patches have been removed.
  • The db tests were moved from build to each db ci, so they won't be tested twice and they will run faster.
  • The code was not touched, and only changed in tests, deprecated assertions.
  • Added tests for each db drivers, for 8.0, 8.1, 8.2.
  • The tests for PHP 8.0 for some reason keep getting the segment fault error, so the ci has continue-error: true, but the tests all run correctly.
  • The Object::class was renamed to ObjectDeprecated::class to avoid the error when executing the tests.
  • Add codecov, which merges the code coverage of all ci tests, into one, which will allow updating code_coverage, with all tests.

@samdark samdark added this to the 2.2.0 milestone Jul 5, 2023
@samdark
Copy link
Member

samdark commented Jul 5, 2023

The tests for PHP 8.0 for some reason keep getting the segment fault error, so the ci has continue-error: true, but the tests all run correctly.

I think we can skip 8.0 and go with 8.1 as minimal version.

The version of PHPUNIT was increased to 9.6.

Should it be 10?

@terabytesoftw terabytesoftw changed the title Draft PHP 8.0 min. Draft PHP 8.1 min. Jul 5, 2023
@codecov
Copy link

codecov bot commented Jul 5, 2023

Codecov Report

Patch coverage: 50.00% and project coverage change: +16.20 🎉

Comparison is base (b9e5a87) 48.83% compared to head (43e0fa8) 65.04%.

Additional details and impacted files
@@              Coverage Diff              @@
##                2.2   #19879       +/-   ##
=============================================
+ Coverage     48.83%   65.04%   +16.20%     
- Complexity        0    11342    +11342     
=============================================
  Files           445      429       -16     
  Lines         42755    35941     -6814     
=============================================
+ Hits          20881    23377     +2496     
+ Misses        21874    12564     -9310     
Impacted Files Coverage Δ
framework/classes.php 0.00% <ø> (ø)
framework/db/Schema.php 87.81% <50.00%> (+0.76%) ⬆️

... and 377 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@terabytesoftw
Copy link
Member Author

terabytesoftw commented Jul 5, 2023

image

  • Code coverage went up a bit, you have to improve the tests and increase it, but it will be in another PR.
  • Now all the tests are green, to add Jquery 3.7 you must first fix the tests.
  • It will be uploaded later to phpunit10, the tests must be improved, so they don't break, the change from 9.6 to 10 is very big.

@terabytesoftw terabytesoftw marked this pull request as ready for review July 6, 2023 08:57
@samdark samdark changed the base branch from master to 2.2.0 July 10, 2023 02:49
tests/framework/di/InstanceTest.php Outdated Show resolved Hide resolved
tests/framework/di/InstanceTest.php Outdated Show resolved Hide resolved
tests/framework/web/ErrorActionTest.php Outdated Show resolved Hide resolved
tests/framework/web/ErrorActionTest.php Outdated Show resolved Hide resolved
@samdark samdark merged commit 2e37b5c into yiisoft:2.2 Jul 10, 2023
30 checks passed
@samdark
Copy link
Member

samdark commented Jul 10, 2023

👍

@terabytesoftw terabytesoftw deleted the draft-php-80-min branch July 10, 2023 14:20
@rhertogh
Copy link
Contributor

Nice 👍

@jiaweipan
Copy link

Amazing👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants