Passed
Pull Request — master (#372)
by Wilmer
03:26
created

AbstractIndexConstraintTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A testGetSchemaIndexes() 0 11 2
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\IndexConstraint;
9
10
abstract class AbstractIndexConstraintTest extends TestCase
11
{
12
    public function testGetSchemaIndexes(): void
13
    {
14
        $db = $this->getConnection();
0 ignored issues
show
Bug introduced by
The method getConnection() does not exist on Yiisoft\Db\Tests\AbstractIndexConstraintTest. ( 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
        $tableIndexes = $db->getSchema()->getSchemaIndexes();
17
18
        $this->assertIsArray($tableIndexes);
19
20
        foreach ($tableIndexes as $indexes) {
21
            $this->assertIsArray($indexes);
22
            $this->assertContainsOnlyInstancesOf(IndexConstraint::class, $indexes);
23
        }
24
    }
25
}
26