Passed
Pull Request — master (#249)
by Wilmer
02:50
created

TestCase::getInaccessibleProperty()   A

Complexity

Conditions 3
Paths 4

Size

Total Lines 19
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 3
eloc 9
nc 4
nop 3
dl 0
loc 19
rs 9.9666
c 2
b 0
f 0
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