18 use Prophecy\Argument;
23 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
40 'foreign_table_where' =>
'AND {#tt_content}.{#CType} IN (\'text\',\'textpic\',\'textmedia\') ORDER BY {#tt_content}.{#CType} ASC',
41 'MM_table_where' =>
'AND {#uid_local} = ###REC_FIELD_category###',
43 'andWhere' =>
'{#CType}=\'text\' OR {#CType}=\'textpic\' OR {#CType}=\'textmedia\' AND {#title}=\'foo\'',
56 'foreign_table_where' =>
'AND `tt_content`.`CType` IN (\'text\',\'textpic\',\'textmedia\') ORDER BY `tt_content`.`CType` ASC',
57 'MM_table_where' =>
'AND `uid_local` = ###REC_FIELD_category###',
59 'andWhere' =>
'`CType`=\'text\' OR `CType`=\'textpic\' OR `CType`=\'textmedia\' AND `title`=\'foo\'',
76 $connection = $this->prophesize(Connection::class);
77 $connection->quoteIdentifier(
'tt_content')->willReturn(
'`tt_content`');
78 $connection->quoteIdentifier(
'CType')->willReturn(
'`CType`');
79 $connection->quoteIdentifier(
'uid_local')->willReturn(
'`uid_local`');
80 $connection->quoteIdentifier(
'title')->willReturn(
'`title`');
81 $connectionPool = $this->prophesize(ConnectionPool::class);
82 $connectionPool->getConnectionForTable(Argument::any())->willReturn($connection->reveal());
83 GeneralUtility::addInstance(ConnectionPool::class, $connectionPool->reveal());
85 $this->assertEquals($expected, $subject->prepare($input));