Skip to content

Commit ed2b689

Browse files
committed
Fixing unit tests
1 parent 9811eb9 commit ed2b689

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

tests/QueryFactory/FindObjectsFromRawSqlQueryFactoryTest.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,22 @@
33
namespace TheCodingMachine\TDBM\QueryFactory;
44

55
use Doctrine\DBAL\Schema\Schema;
6-
use PHPUnit\Framework\TestCase;
76
use TheCodingMachine\TDBM\TDBMAbstractServiceTest;
87
use TheCodingMachine\TDBM\TDBMException;
98

109
class FindObjectsFromRawSqlQueryFactoryTest extends TDBMAbstractServiceTest
1110
{
1211

13-
public function testGetSubQueryColumnDescriptors()
12+
public function testGetSubQueryColumnDescriptors(): void
1413
{
15-
$queryFactory = new FindObjectsFromRawSqlQueryFactory($this->tdbmService, $this->createMock(Schema::class), 'foo', 'bar');
14+
$queryFactory = new FindObjectsFromRawSqlQueryFactory($this->tdbmService, $this->tdbmService->getConnection()->getSchemaManager()->createSchema(), 'country', 'SELECT country.* FROM country');
1615
$this->expectException(TDBMException::class);
1716
$queryFactory->getSubQueryColumnDescriptors();
1817
}
1918

20-
public function testGetMagicSqlSubQuery()
19+
public function testGetMagicSqlSubQuery(): void
2120
{
22-
$queryFactory = new FindObjectsFromRawSqlQueryFactory($this->tdbmService, $this->createMock(Schema::class), 'foo', 'bar');
21+
$queryFactory = new FindObjectsFromRawSqlQueryFactory($this->tdbmService, $this->tdbmService->getConnection()->getSchemaManager()->createSchema(), 'country', 'SELECT country.* FROM country');
2322
$this->expectException(TDBMException::class);
2423
$queryFactory->getMagicSqlSubQuery();
2524

0 commit comments

Comments
 (0)