Passed
Pull Request — master (#161)
by David
02:42
created

testGetSubQueryColumnDescriptors()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 3
c 2
b 0
f 0
dl 0
loc 5
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace TheCodingMachine\TDBM\QueryFactory;
4
5
use Doctrine\DBAL\Schema\Schema;
6
use TheCodingMachine\TDBM\TDBMAbstractServiceTest;
7
use TheCodingMachine\TDBM\TDBMException;
8
9
class FindObjectsFromRawSqlQueryFactoryTest extends TDBMAbstractServiceTest
10
{
11
12
    public function testGetSubQueryColumnDescriptors(): void
13
    {
14
        $queryFactory = new FindObjectsFromRawSqlQueryFactory($this->tdbmService, $this->tdbmService->getConnection()->getSchemaManager()->createSchema(), 'country', 'SELECT country.* FROM country');
15
        $this->expectException(TDBMException::class);
16
        $queryFactory->getSubQueryColumnDescriptors();
17
    }
18
19
    public function testGetMagicSqlSubQuery(): void
20
    {
21
        $queryFactory = new FindObjectsFromRawSqlQueryFactory($this->tdbmService, $this->tdbmService->getConnection()->getSchemaManager()->createSchema(), 'country', 'SELECT country.* FROM country');
22
        $this->expectException(TDBMException::class);
23
        $queryFactory->getMagicSqlSubQuery();
24
25
    }
26
}
27