diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 33e1c867a..3c1d4c92d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,6 +1,26 @@ -name: build +on: + pull_request: + paths-ignore: + - 'docs/**' + - 'README.md' + - 'CHANGELOG.md' + - '.gitignore' + - '.gitattributes' + - 'infection.json.dist' + - 'psalm.xml' + + push: + branches: ['master'] + paths-ignore: + - 'docs/**' + - 'README.md' + - 'CHANGELOG.md' + - '.gitignore' + - '.gitattributes' + - 'infection.json.dist' + - 'psalm.xml' -on: [push, pull_request] +name: build env: DEFAULT_COMPOSER_FLAGS: "--prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi" @@ -18,7 +38,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - php: ['7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1'] + php: ['7.3', '7.4', '8.0', '8.1', '8.2', '8.3'] mongo: ['3'] mongoext: ['1.8.2', '1.9.0'] diff --git a/composer.json b/composer.json index 58b45ebed..ca912e3a9 100644 --- a/composer.json +++ b/composer.json @@ -18,13 +18,12 @@ } ], "require": { - "yiisoft/yii2": "~2.0.39", + "php": ">=7.3", "ext-mongodb": ">=1.0.0", - "paragonie/random_compat": ">=1" + "yiisoft/yii2": "~2.0.39" }, "require-dev": { - "cweagans/composer-patches": "^1.7", - "phpunit/phpunit": "4.8.34" + "phpunit/phpunit": "^9.6" }, "repositories": [ { @@ -38,22 +37,10 @@ "extra": { "branch-alias": { "dev-master": "2.1.x-dev" - }, - "composer-exit-on-patch-failure": true, - "patches": { - "phpunit/phpunit-mock-objects": { - "Fix PHP 7 and 8 compatibility": "https://yiisoft.github.io/phpunit-patches/phpunit_mock_objects.patch" - }, - "phpunit/phpunit": { - "Fix PHP 7 compatibility": "https://yiisoft.github.io/phpunit-patches/phpunit_php7.patch", - "Fix PHP 8 compatibility": "https://yiisoft.github.io/phpunit-patches/phpunit_php8.patch", - "Fix PHP 8.1 compatibility": "https://yiisoft.github.io/phpunit-patches/phpunit_php81.patch" - } } }, "config": { "allow-plugins": { - "cweagans/composer-patches": true, "yiisoft/yii2-composer": true } } diff --git a/tests/ActiveDataProviderTest.php b/tests/ActiveDataProviderTest.php index 4d4579641..d7f083a56 100644 --- a/tests/ActiveDataProviderTest.php +++ b/tests/ActiveDataProviderTest.php @@ -10,7 +10,7 @@ class ActiveDataProviderTest extends TestCase { - protected function setUp() + protected function setUp(): void { parent::setUp(); $this->mockApplication(); @@ -18,7 +18,7 @@ protected function setUp() $this->setUpTestRows(); } - protected function tearDown() + protected function tearDown(): void { $this->dropCollection(Customer::collectionName()); parent::tearDown(); diff --git a/tests/ActiveFixtureTest.php b/tests/ActiveFixtureTest.php index b7b58bd74..bbb48771b 100644 --- a/tests/ActiveFixtureTest.php +++ b/tests/ActiveFixtureTest.php @@ -10,13 +10,13 @@ class ActiveFixtureTest extends TestCase { - protected function setUp() + protected function setUp(): void { parent::setUp(); $this->mockApplication(); } - protected function tearDown() + protected function tearDown(): void { $this->dropCollection(Customer::collectionName()); FileHelper::removeDirectory(Yii::getAlias('@runtime/fixtures')); @@ -163,4 +163,4 @@ class {$className} extends \yii\mongodb\ActiveFixture $rows = $this->findAll($this->getConnection()->getCollection(Customer::collectionName())); $this->assertCount(3, $rows); } -} \ No newline at end of file +} diff --git a/tests/ActiveRecordTest.php b/tests/ActiveRecordTest.php index 7c259d6ed..8a3376f33 100644 --- a/tests/ActiveRecordTest.php +++ b/tests/ActiveRecordTest.php @@ -19,14 +19,14 @@ class ActiveRecordTest extends TestCase */ protected $testRows = []; - protected function setUp() + protected function setUp(): void { parent::setUp(); ActiveRecord::$db = $this->getConnection(); $this->setUpTestRows(); } - protected function tearDown() + protected function tearDown(): void { $this->dropCollection(Customer::collectionName()); parent::tearDown(); @@ -518,4 +518,4 @@ public function testEmulateExecution() ->distinct('name'); $this->assertSame([], $values); } -} \ No newline at end of file +} diff --git a/tests/ActiveRelationTest.php b/tests/ActiveRelationTest.php index 0f2cd9748..446eba457 100644 --- a/tests/ActiveRelationTest.php +++ b/tests/ActiveRelationTest.php @@ -9,14 +9,14 @@ class ActiveRelationTest extends TestCase { - protected function setUp() + protected function setUp(): void { parent::setUp(); ActiveRecord::$db = $this->getConnection(); $this->setUpTestRows(); } - protected function tearDown() + protected function tearDown(): void { $this->dropCollection(Customer::collectionName()); $this->dropCollection(CustomerOrder::collectionName()); diff --git a/tests/BatchQueryResultTest.php b/tests/BatchQueryResultTest.php index af04a3813..18545ba3f 100644 --- a/tests/BatchQueryResultTest.php +++ b/tests/BatchQueryResultTest.php @@ -10,14 +10,14 @@ class BatchQueryResultTest extends TestCase { - protected function setUp() + protected function setUp(): void { parent::setUp(); ActiveRecord::$db = $this->getConnection(); $this->setUpTestRows(); } - protected function tearDown() + protected function tearDown(): void { $this->dropCollection(Customer::collectionName()); $this->dropCollection(CustomerOrder::collectionName()); @@ -177,4 +177,4 @@ public function testActiveQuery() $this->assertEquals(2, count($customers[1]->orders)); $this->assertEquals(2, count($customers[2]->orders)); } -} \ No newline at end of file +} diff --git a/tests/CacheTest.php b/tests/CacheTest.php index 16050d511..986d76cf3 100644 --- a/tests/CacheTest.php +++ b/tests/CacheTest.php @@ -12,7 +12,7 @@ class CacheTest extends TestCase */ protected static $cacheCollection = '_test_cache'; - protected function tearDown() + protected function tearDown(): void { $this->dropCollection(static::$cacheCollection); parent::tearDown(); diff --git a/tests/CollectionTest.php b/tests/CollectionTest.php index fd1df344d..e4437b2e7 100644 --- a/tests/CollectionTest.php +++ b/tests/CollectionTest.php @@ -7,7 +7,7 @@ class CollectionTest extends TestCase { - protected function tearDown() + protected function tearDown(): void { $this->dropCollection('customer'); $this->dropCollection('mapReduceOut'); diff --git a/tests/CommandTest.php b/tests/CommandTest.php index d7660d155..3706b5748 100644 --- a/tests/CommandTest.php +++ b/tests/CommandTest.php @@ -8,7 +8,7 @@ class CommandTest extends TestCase { - protected function tearDown() + protected function tearDown(): void { $this->dropCollection('customer'); parent::tearDown(); @@ -343,7 +343,7 @@ public function testListCollections() $collections = $connection->createCommand()->listCollections(); $collectionNames = ArrayHelper::getColumn($collections, 'name'); - $this->assertContains('customer', $collectionNames); + $this->assertStringContainsString('customer', $collectionNames); } /** @@ -372,4 +372,4 @@ public function testUpdateUpsert() $this->assertEquals(1, $result->getUpsertedCount()); $this->assertEquals(2, $connection->createCommand()->count('customer')); } -} \ No newline at end of file +} diff --git a/tests/DatabaseTest.php b/tests/DatabaseTest.php index 35700bb29..e881ead9b 100644 --- a/tests/DatabaseTest.php +++ b/tests/DatabaseTest.php @@ -8,7 +8,7 @@ class DatabaseTest extends TestCase { - protected function tearDown() + protected function tearDown(): void { $this->dropCollection('customer'); $this->dropFileCollection('testfs'); diff --git a/tests/MigrationTest.php b/tests/MigrationTest.php index a14a8fb51..8f3e7a734 100644 --- a/tests/MigrationTest.php +++ b/tests/MigrationTest.php @@ -6,7 +6,7 @@ class MigrationTest extends TestCase { - protected function tearDown() + protected function tearDown(): void { $this->dropCollection('customer'); parent::tearDown(); @@ -132,4 +132,4 @@ protected function log($string) { $this->logs[] = $string; } -} \ No newline at end of file +} diff --git a/tests/QueryRunTest.php b/tests/QueryRunTest.php index c3a97616f..fe5321651 100644 --- a/tests/QueryRunTest.php +++ b/tests/QueryRunTest.php @@ -7,13 +7,13 @@ class QueryRunTest extends TestCase { - protected function setUp() + protected function setUp(): void { parent::setUp(); $this->setUpTestRows(); } - protected function tearDown() + protected function tearDown(): void { $this->dropCollection('customer'); parent::tearDown(); @@ -671,4 +671,4 @@ public function testAggregationShortcuts() ->average('status', $db); $this->assertEquals(6, $max); } -} \ No newline at end of file +} diff --git a/tests/SessionTest.php b/tests/SessionTest.php index 4f1baba0c..46849adda 100755 --- a/tests/SessionTest.php +++ b/tests/SessionTest.php @@ -13,7 +13,7 @@ class SessionTest extends TestCase */ protected static $sessionCollection = '_test_session'; - protected function tearDown() + protected function tearDown(): void { $this->dropCollection(static::$sessionCollection); parent::tearDown(); diff --git a/tests/TestCase.php b/tests/TestCase.php index 7c876e453..1a164d181 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -24,7 +24,7 @@ abstract class TestCase extends \PHPUnit\Framework\TestCase */ protected $mongodb; - protected function setUp() + protected function setUp(): void { parent::setUp(); if (!extension_loaded('mongodb')) { @@ -37,7 +37,7 @@ protected function setUp() //$this->mockApplication(); } - protected function tearDown() + protected function tearDown(): void { if ($this->mongodb) { $this->mongodb->close(); @@ -213,4 +213,4 @@ protected function invokeMethod($object, $method, $args = []) $method->setAccessible(true); return $method->invokeArgs($object, $args); } -} \ No newline at end of file +} diff --git a/tests/bootstrap.php b/tests/bootstrap.php index df1932c10..641cad685 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -14,5 +14,3 @@ Yii::setAlias('@yiiunit/extensions/mongodb', __DIR__); Yii::setAlias('@yii/mongodb', dirname(__DIR__) . '/src'); - -require_once(__DIR__ . '/compatibility.php'); \ No newline at end of file diff --git a/tests/compatibility.php b/tests/compatibility.php deleted file mode 100644 index 95e4cd1bc..000000000 --- a/tests/compatibility.php +++ /dev/null @@ -1,50 +0,0 @@ -setExpectedException($exception); - } - - /** - * @param string $message - */ - public function expectExceptionMessage($message) - { - $parentClassMethods = get_class_methods('PHPUnit_Framework_TestCase'); - if (in_array('expectExceptionMessage', $parentClassMethods)) { - parent::expectExceptionMessage($message); - return; - } - $this->setExpectedException($this->getExpectedException(), $message); - } - - /** - * @param string $messageRegExp - */ - public function expectExceptionMessageRegExp($messageRegExp) - { - $parentClassMethods = get_class_methods('PHPUnit_Framework_TestCase'); - if (in_array('expectExceptionMessageRegExp', $parentClassMethods)) { - parent::expectExceptionMessageRegExp($messageRegExp); - return; - } - $this->setExpectedExceptionRegExp($this->getExpectedException(), $messageRegExp); - } - } - } -} diff --git a/tests/console/controllers/MigrateControllerTest.php b/tests/console/controllers/MigrateControllerTest.php index 44b821c2e..bcbd92dbd 100644 --- a/tests/console/controllers/MigrateControllerTest.php +++ b/tests/console/controllers/MigrateControllerTest.php @@ -37,7 +37,7 @@ class MigrateControllerTest extends TestCase protected $migrationNamespace; - public function setUp() + public function setUp(): void { $this->migrateControllerClass = EchoMigrateController::className(); $this->migrationBaseClass = Migration::className(); @@ -232,7 +232,7 @@ public function testCreate() $this->runMigrateControllerAction('create', [$migrationName]); $files = FileHelper::findFiles($this->migrationPath); $this->assertCount(1, $files, 'Unable to create new migration!'); - $this->assertContains($migrationName, basename($files[0]), 'Wrong migration name!'); + $this->assertStringContainsString($migrationName, basename($files[0]), 'Wrong migration name!'); } public function testUp() @@ -292,15 +292,15 @@ public function testDownAll() public function testHistory() { $output = $this->runMigrateControllerAction('history'); - $this->assertContains('No migration', $output); + $this->assertStringContainsString('No migration', $output); $this->createMigration('test1'); $this->createMigration('test2'); $this->runMigrateControllerAction('up'); $output = $this->runMigrateControllerAction('history'); - $this->assertContains('_test1', $output); - $this->assertContains('_test2', $output); + $this->assertStringContainsString('_test1', $output); + $this->assertStringContainsString('_test2', $output); } /** @@ -311,12 +311,12 @@ public function testNew() $this->createMigration('test1'); $output = $this->runMigrateControllerAction('new'); - $this->assertContains('_test1', $output); + $this->assertStringContainsString('_test1', $output); $this->runMigrateControllerAction('up'); $output = $this->runMigrateControllerAction('new'); - $this->assertNotContains('_test1', $output); + $this->assertStringNotContainsString('_test1', $output); } public function testMark() @@ -367,7 +367,7 @@ public function testNamespaceCreate() ]); $files = FileHelper::findFiles($this->migrationPath); $fileContent = file_get_contents($files[0]); - $this->assertContains("namespace {$this->migrationNamespace};", $fileContent); + $this->assertStringContainsString("namespace {$this->migrationNamespace};", $fileContent); $this->assertRegExp('/class M[0-9]{12}' . ucfirst($migrationName) . '/s', $fileContent); unlink($files[0]); @@ -379,7 +379,7 @@ public function testNamespaceCreate() ]); $files = FileHelper::findFiles($this->migrationPath); $fileContent = file_get_contents($files[0]); - $this->assertContains("namespace {$this->migrationNamespace};", $fileContent); + $this->assertStringContainsString("namespace {$this->migrationNamespace};", $fileContent); unlink($files[0]); // no namespace: @@ -390,7 +390,7 @@ public function testNamespaceCreate() ]); $files = FileHelper::findFiles($this->migrationPath); $fileContent = file_get_contents($files[0]); - $this->assertNotContains("namespace {$this->migrationNamespace};", $fileContent); + $this->assertStringNotContainsString("namespace {$this->migrationNamespace};", $fileContent); } /** @@ -447,7 +447,7 @@ public function testNamespaceHistory() ]; $output = $this->runMigrateControllerAction('history', [], $controllerConfig); - $this->assertContains('No migration', $output); + $this->assertStringContainsString('No migration', $output); $this->createNamespaceMigration('history1'); $this->createNamespaceMigration('history2'); @@ -582,9 +582,9 @@ public function testRefreshMigration() $result = $this->runMigrateControllerAction('fresh'); - $this->assertContains('Collection hall_of_fame dropped.', $result); - $this->assertContains('No new migrations found. Your system is up-to-date.', $result); + $this->assertStringContainsString('Collection hall_of_fame dropped.', $result); + $this->assertStringContainsString('No new migrations found. Your system is up-to-date.', $result); $this->assertEmpty($connection->getDatabase()->listCollections(['name' => $collection->name])); } -} \ No newline at end of file +} diff --git a/tests/file/ActiveRecordTest.php b/tests/file/ActiveRecordTest.php index 1b9b6249e..f63445493 100644 --- a/tests/file/ActiveRecordTest.php +++ b/tests/file/ActiveRecordTest.php @@ -20,7 +20,7 @@ class ActiveRecordTest extends TestCase */ protected $testRows = []; - protected function setUp() + protected function setUp(): void { parent::setUp(); ActiveRecord::$db = $this->getConnection(); @@ -32,7 +32,7 @@ protected function setUp() } } - protected function tearDown() + protected function tearDown(): void { $filePath = $this->getTestFilePath(); if (file_exists($filePath)) { diff --git a/tests/file/ActiveRelationTest.php b/tests/file/ActiveRelationTest.php index 9c5eb47ed..be0ffe3ae 100644 --- a/tests/file/ActiveRelationTest.php +++ b/tests/file/ActiveRelationTest.php @@ -11,7 +11,7 @@ */ class ActiveRelationTest extends TestCase { - protected function setUp() + protected function setUp(): void { parent::setUp(); \yiiunit\extensions\mongodb\data\ar\ActiveRecord::$db = $this->getConnection(); @@ -19,7 +19,7 @@ protected function setUp() $this->setUpTestRows(); } - protected function tearDown() + protected function tearDown(): void { $this->dropCollection(Customer::collectionName()); $this->dropCollection(CustomerFile::collectionName()); @@ -82,4 +82,4 @@ public function testFindEager() $this->assertTrue($customers[1]->file instanceof CustomerFile); $this->assertEquals((string) $customers[1]->file->_id, (string) $customers[1]->file_id); } -} \ No newline at end of file +} diff --git a/tests/file/CollectionTest.php b/tests/file/CollectionTest.php index 07c4350d2..baa8b8d3c 100644 --- a/tests/file/CollectionTest.php +++ b/tests/file/CollectionTest.php @@ -12,7 +12,7 @@ */ class CollectionTest extends TestCase { - protected function tearDown() + protected function tearDown(): void { $this->dropFileCollection('fs'); parent::tearDown(); diff --git a/tests/file/DownloadTest.php b/tests/file/DownloadTest.php index 0fb3dd037..3ae91b363 100644 --- a/tests/file/DownloadTest.php +++ b/tests/file/DownloadTest.php @@ -9,7 +9,7 @@ */ class DownloadTest extends TestCase { - protected function tearDown() + protected function tearDown(): void { $this->dropFileCollection('fs'); parent::tearDown(); @@ -67,4 +67,4 @@ public function testSubstr() $this->assertEquals('2345678', $download->substr(-8, 7), 'Unable to use negative start'); $this->assertEquals('234567', $download->substr(22, -2), 'Unable to use negative length'); } -} \ No newline at end of file +} diff --git a/tests/file/QueryTest.php b/tests/file/QueryTest.php index 46b2a564c..49d30694c 100644 --- a/tests/file/QueryTest.php +++ b/tests/file/QueryTest.php @@ -11,13 +11,13 @@ */ class QueryTest extends TestCase { - protected function setUp() + protected function setUp(): void { parent::setUp(); $this->setUpTestRows(); } - protected function tearDown() + protected function tearDown(): void { $this->dropFileCollection(); parent::tearDown(); diff --git a/tests/file/StreamWrapperTest.php b/tests/file/StreamWrapperTest.php index ac82c14dc..86a6f5eb3 100644 --- a/tests/file/StreamWrapperTest.php +++ b/tests/file/StreamWrapperTest.php @@ -6,7 +6,7 @@ class StreamWrapperTest extends TestCase { - protected function tearDown() + protected function tearDown(): void { $connection = $this->getConnection(); if (in_array($connection->fileStreamProtocol, stream_get_wrappers())) { @@ -80,7 +80,7 @@ public function testReadResource() $this->assertEquals('test content', stream_get_contents($resource)); } - + public function testSeek() { $connection = $this->getConnection(); @@ -97,21 +97,21 @@ public function testSeek() $resource = fopen($url, 'w'); fwrite($resource, 'begin end'); fclose($resource); - + $url = "gridfs://{$databaseName}.fs?filename=test.txt"; $resource = fopen($url, 'r'); $data = fgets($resource); - + fseek($resource, 0); $position = ftell($resource); $this->assertEquals(0, $position); - + fseek($resource, 2, SEEK_CUR); $position = ftell($resource); $this->assertEquals(2, $position); - + fseek($resource, 0, SEEK_END); $position = ftell($resource); $this->assertEquals(9, $position); } -} \ No newline at end of file +} diff --git a/tests/file/UploadTest.php b/tests/file/UploadTest.php index 95983d4e8..20f266c7f 100644 --- a/tests/file/UploadTest.php +++ b/tests/file/UploadTest.php @@ -10,7 +10,7 @@ */ class UploadTest extends TestCase { - protected function tearDown() + protected function tearDown(): void { $this->dropFileCollection('fs'); parent::tearDown(); @@ -114,4 +114,4 @@ public function testCustomId() $document = $upload->addContent('object ID')->complete(); $this->assertSame($id, $document['_id']); } -} \ No newline at end of file +} diff --git a/tests/i18n/MongoDbMessageSourceTest.php b/tests/i18n/MongoDbMessageSourceTest.php index d2f7273a9..7c49e9ee7 100644 --- a/tests/i18n/MongoDbMessageSourceTest.php +++ b/tests/i18n/MongoDbMessageSourceTest.php @@ -14,7 +14,7 @@ class MongoDbMessageSourceTest extends TestCase public $i18n; - protected function setUp() + protected function setUp(): void { $this->mockApplication(); parent::setUp(); @@ -22,7 +22,7 @@ protected function setUp() $this->setupI18N(); } - protected function tearDown() + protected function tearDown(): void { $this->dropCollection('message'); parent::tearDown(); @@ -138,4 +138,4 @@ public function testTranslatePriority() // Ensure fallback entry does not override main one: $this->assertEquals('Здравствуй Мир! (ru-RU)', $this->i18n->translate('test', 'Hello world!', [], 'ru-RU')); } -} \ No newline at end of file +} diff --git a/tests/log/MongoDbTargetTest.php b/tests/log/MongoDbTargetTest.php index 2c9847f19..a3717271b 100644 --- a/tests/log/MongoDbTargetTest.php +++ b/tests/log/MongoDbTargetTest.php @@ -8,7 +8,7 @@ class MongoDbTargetTest extends TestCase { - protected function tearDown() + protected function tearDown(): void { $this->dropCollection('log'); parent::tearDown(); @@ -60,4 +60,4 @@ public function testExport() $this->assertEquals($target->messages[1][2], $rows[1]['category']); $this->assertEquals($target->messages[1][3], $rows[1]['log_time']); } -} \ No newline at end of file +} diff --git a/tests/rbac/MongoDbManagerTest.php b/tests/rbac/MongoDbManagerTest.php index 5800aef55..c3b497456 100644 --- a/tests/rbac/MongoDbManagerTest.php +++ b/tests/rbac/MongoDbManagerTest.php @@ -20,13 +20,13 @@ class MongoDbManagerTest extends TestCase protected $auth; - protected function setUp() + protected function setUp(): void { parent::setUp(); $this->auth = $this->createManager(); } - protected function tearDown() + protected function tearDown(): void { $this->dropCollection('auth_item'); $this->dropCollection('auth_assignment'); @@ -160,8 +160,8 @@ public function testGetRules() $ruleNames[] = $rule->name; } - $this->assertContains('isReallyReallyAuthor', $ruleNames); - $this->assertContains('isAuthor', $ruleNames); + $this->assertStringContainsString('isReallyReallyAuthor', $ruleNames); + $this->assertStringContainsString('isAuthor', $ruleNames); } public function testRemoveRule() @@ -362,8 +362,8 @@ public function testAssignMultipleRoles() $roleNames[] = $role->name; } - $this->assertContains('reader', $roleNames, 'Roles should contain reader. Currently it has: ' . implode(', ', $roleNames)); - $this->assertContains('author', $roleNames, 'Roles should contain author. Currently it has: ' . implode(', ', $roleNames)); + $this->assertStringContainsString('reader', $roleNames, 'Roles should contain reader. Currently it has: ' . implode(', ', $roleNames)); + $this->assertStringContainsString('author', $roleNames, 'Roles should contain author. Currently it has: ' . implode(', ', $roleNames)); } public function testAssignmentsToIntegerId() @@ -521,4 +521,4 @@ public function testInvalidateCache() $this->assertFalse($auth->cache->exists($auth->cacheKey)); } -} \ No newline at end of file +} diff --git a/tests/validators/MongoDateValidatorTest.php b/tests/validators/MongoDateValidatorTest.php index 32faf0efe..a296cfda2 100644 --- a/tests/validators/MongoDateValidatorTest.php +++ b/tests/validators/MongoDateValidatorTest.php @@ -9,7 +9,7 @@ class MongoDateValidatorTest extends TestCase { - protected function setUp() + protected function setUp(): void { parent::setUp(); $this->mockApplication(); @@ -59,4 +59,4 @@ public function rules() ['date', MongoDateValidator::className(), 'format' => 'MM/dd/yyyy', 'mongoDateAttribute' => 'mongoDate'] ]; } -} \ No newline at end of file +} diff --git a/tests/validators/MongoIdValidatorTest.php b/tests/validators/MongoIdValidatorTest.php index 6c8208163..37fa946fb 100644 --- a/tests/validators/MongoIdValidatorTest.php +++ b/tests/validators/MongoIdValidatorTest.php @@ -9,7 +9,7 @@ class MongoIdValidatorTest extends TestCase { - protected function setUp() + protected function setUp(): void { parent::setUp(); $this->mockApplication(); @@ -69,4 +69,4 @@ public function testConvertValue() class MongoIdTestModel extends Model { public $id; -} \ No newline at end of file +}