Do not introduce typo3 db legacy dependency

Instead return expected object type.
This commit is contained in:
Daniel Siepmann 2019-05-05 10:13:48 +02:00
parent 5779cb911d
commit 274844dbba
Signed by: Daniel Siepmann
GPG key ID: 33D6629915560EF4

View file

@ -25,7 +25,7 @@ use Codappix\SearchCore\Domain\Index\TcaIndexer\RelationResolver;
use Codappix\SearchCore\Domain\Index\TcaIndexer\TcaTableService76;
use Codappix\SearchCore\Domain\Index\TcaIndexer\TcaTableService;
use Codappix\SearchCore\Tests\Unit\AbstractUnitTestCase;
use TYPO3\CMS\Typo3DbLegacy\Database\DatabaseConnection;
use TYPO3\CMS\Core\Database\ConnectionPool;
class TcaTableServiceTest extends AbstractUnitTestCase
{
@ -40,16 +40,16 @@ class TcaTableServiceTest extends AbstractUnitTestCase
protected $configuration;
/**
* @var DatabaseConnection
* @var ConnectionPool
*/
protected $databaseConnection;
protected $connectionPool;
public function setUp()
{
parent::setUp();
$this->configuration = $this->getMockBuilder(ConfigurationContainerInterface::class)->getMock();
$this->databaseConnection = $this->getMockBuilder(DatabaseConnection::class)->getMock();
$this->connectionPool = $this->getMockBuilder(ConnectionPool::class)->getMock();
$className = TcaTableService::class;
if ($this->isLegacyVersion()) {
@ -61,7 +61,7 @@ class TcaTableServiceTest extends AbstractUnitTestCase
->getMock();
$this->subject->expects($this->any())
->method('getConnection')
->willReturn($this->databaseConnection);
->willReturn($this->connectionPool);
$this->inject($this->subject, 'configuration', $this->configuration);
$this->inject($this->subject, 'logger', $this->getMockedLogger());