TestCase   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 24
Bugs 3 Features 1
Metric Value
wmc 3
eloc 7
c 24
b 3
f 1
dl 0
loc 13
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A checkFixture() 0 9 3
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\ActiveRecord\Tests;
6
7
use Yiisoft\ActiveRecord\Tests\Support\DbHelper;
8
use Yiisoft\Db\Connection\ConnectionInterface;
9
10
class TestCase extends \PHPUnit\Framework\TestCase
11
{
12
    protected ConnectionInterface $db;
13
14
    protected function checkFixture(ConnectionInterface $db, string $tablename, bool $reset = false): void
15
    {
16
        $schema = $db->getSchema();
17
        $tableSchema = $schema->getTableSchema($tablename, true);
18
19
        if ($tableSchema === null || $reset) {
20
            DbHelper::loadFixture($db);
21
22
            $schema->refresh();
23
        }
24
    }
25
}
26