Passed
Pull Request — master (#372)
by Wilmer
03:17 queued 44s
created

testGetSchemaDefaultValues()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 11
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 6
c 1
b 0
f 0
nc 2
nop 0
dl 0
loc 11
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Db\Tests;
6
7
use PHPUnit\Framework\TestCase;
8
use Yiisoft\Db\Constraint\DefaultValueConstraint;
9
10
abstract class AbstractDefaultValueConstraintTest extends TestCase
11
{
12
    public function testGetSchemaDefaultValues(): void
13
    {
14
        $db = $this->getConnection();
0 ignored issues
show
Bug introduced by
The method getConnection() does not exist on Yiisoft\Db\Tests\Abstrac...aultValueConstraintTest. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

14
        /** @scrutinizer ignore-call */ 
15
        $db = $this->getConnection();

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
15
16
        $tableDefaultValues = $db->getSchema()->getSchemaDefaultValues();
17
18
        $this->assertIsArray($tableDefaultValues);
19
20
        foreach ($tableDefaultValues as $defaultValues) {
21
            $this->assertIsArray($defaultValues);
22
            $this->assertContainsOnlyInstancesOf(DefaultValueConstraint::class, $defaultValues);
23
        }
24
    }
25
}
26