Add void return to method in tests. (#20602)

This commit is contained in:
Wilmer Arambula
2025-10-14 06:37:35 -03:00
committed by GitHub
parent 30824c5dcf
commit d71f7309ae
249 changed files with 2749 additions and 2538 deletions

View File

@@ -8,6 +8,7 @@
namespace yiiunit\framework\db\pgsql;
use PDO;
use yii\db\Expression;
use yiiunit\data\ar\ActiveRecord;
use yiiunit\data\ar\EnumTypeInCustomSchema;
@@ -163,7 +164,7 @@ class SchemaTest extends \yiiunit\framework\db\SchemaTest
return $columns;
}
public function testCompositeFk()
public function testCompositeFk(): void
{
$schema = $this->getConnection()->schema;
@@ -176,18 +177,18 @@ class SchemaTest extends \yiiunit\framework\db\SchemaTest
$this->assertEquals('item_id', $table->foreignKeys['fk_composite_fk_order_item']['item_id']);
}
public function testGetPDOType()
public function testGetPDOType(): void
{
$values = [
[null, \PDO::PARAM_NULL],
['', \PDO::PARAM_STR],
['hello', \PDO::PARAM_STR],
[0, \PDO::PARAM_INT],
[1, \PDO::PARAM_INT],
[1337, \PDO::PARAM_INT],
[true, \PDO::PARAM_BOOL],
[false, \PDO::PARAM_BOOL],
[$fp = fopen(__FILE__, 'rb'), \PDO::PARAM_LOB],
[null, PDO::PARAM_NULL],
['', PDO::PARAM_STR],
['hello', PDO::PARAM_STR],
[0, PDO::PARAM_INT],
[1, PDO::PARAM_INT],
[1337, PDO::PARAM_INT],
[true, PDO::PARAM_BOOL],
[false, PDO::PARAM_BOOL],
[$fp = fopen(__FILE__, 'rb'), PDO::PARAM_LOB],
];
$schema = $this->getConnection()->schema;
@@ -198,7 +199,7 @@ class SchemaTest extends \yiiunit\framework\db\SchemaTest
fclose($fp);
}
public function testBooleanDefaultValues()
public function testBooleanDefaultValues(): void
{
$schema = $this->getConnection()->schema;
@@ -207,7 +208,7 @@ class SchemaTest extends \yiiunit\framework\db\SchemaTest
$this->assertFalse($table->getColumn('default_false')->defaultValue);
}
public function testSequenceName()
public function testSequenceName(): void
{
$connection = $this->getConnection();
@@ -223,7 +224,7 @@ class SchemaTest extends \yiiunit\framework\db\SchemaTest
$this->assertEquals($sequenceName, $connection->schema->getTableSchema('item')->sequenceName);
}
public function testGeneratedValues()
public function testGeneratedValues(): void
{
if (version_compare($this->getConnection(false)->getServerVersion(), '12.0', '<')) {
$this->markTestSkipped('PostgreSQL < 12.0 does not support GENERATED AS IDENTITY columns.');
@@ -240,7 +241,7 @@ class SchemaTest extends \yiiunit\framework\db\SchemaTest
$this->assertTrue($table->getColumn('id_default')->autoIncrement);
}
public function testPartitionedTable()
public function testPartitionedTable(): void
{
if (version_compare($this->getConnection(false)->getServerVersion(), '10.0', '<')) {
$this->markTestSkipped('PostgreSQL < 10.0 does not support PARTITION BY clause.');
@@ -253,7 +254,7 @@ class SchemaTest extends \yiiunit\framework\db\SchemaTest
$this->assertNotNull($this->getConnection(false)->schema->getTableSchema('partitioned'));
}
public function testFindSchemaNames()
public function testFindSchemaNames(): void
{
$schema = $this->getConnection()->schema;
@@ -277,7 +278,7 @@ class SchemaTest extends \yiiunit\framework\db\SchemaTest
* @dataProvider bigintValueProvider
* @param int $bigint
*/
public function testBigintValue($bigint)
public function testBigintValue($bigint): void
{
$this->mockApplication();
ActiveRecord::$db = $this->getConnection();
@@ -299,7 +300,7 @@ class SchemaTest extends \yiiunit\framework\db\SchemaTest
/**
* @see https://github.com/yiisoft/yii2/issues/12483
*/
public function testParenthesisDefaultValue()
public function testParenthesisDefaultValue(): void
{
$db = $this->getConnection(false);
if ($db->schema->getTableSchema('test_default_parenthesis') !== null) {
@@ -324,7 +325,7 @@ class SchemaTest extends \yiiunit\framework\db\SchemaTest
/**
* @see https://github.com/yiisoft/yii2/issues/14192
*/
public function testTimestampNullDefaultValue()
public function testTimestampNullDefaultValue(): void
{
$db = $this->getConnection(false);
if ($db->schema->getTableSchema('test_timestamp_default_null') !== null) {
@@ -344,7 +345,7 @@ class SchemaTest extends \yiiunit\framework\db\SchemaTest
/**
* @see https://github.com/yiisoft/yii2/issues/20329
*/
public function testTimestampUtcNowDefaultValue()
public function testTimestampUtcNowDefaultValue(): void
{
$db = $this->getConnection(false);
if ($db->schema->getTableSchema('test_timestamp_utc_now_default') !== null) {
@@ -364,7 +365,7 @@ class SchemaTest extends \yiiunit\framework\db\SchemaTest
/**
* @see https://github.com/yiisoft/yii2/issues/20329
*/
public function testTimestampNowDefaultValue()
public function testTimestampNowDefaultValue(): void
{
$db = $this->getConnection(false);
if ($db->schema->getTableSchema('test_timestamp_now_default') !== null) {
@@ -384,7 +385,7 @@ class SchemaTest extends \yiiunit\framework\db\SchemaTest
/**
* @see https://github.com/yiisoft/yii2/issues/20329
*/
public function testTimestampUtcStringDefaultValue()
public function testTimestampUtcStringDefaultValue(): void
{
$db = $this->getConnection(false);
if ($db->schema->getTableSchema('test_timestamp_utc_string_default') !== null) {
@@ -411,7 +412,7 @@ class SchemaTest extends \yiiunit\framework\db\SchemaTest
return $result;
}
public function testCustomTypeInNonDefaultSchema()
public function testCustomTypeInNonDefaultSchema(): void
{
$connection = $this->getConnection();
ActiveRecord::$db = $this->getConnection();