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

FindObjectsFromRawSqlQueryFactoryTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testGetSubQueryColumnDescriptors() 0 5 1
A testGetMagicSqlSubQuery() 0 5 1
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