2 declare(strict_types = 1);
18 use Doctrine\DBAL\Driver\Statement;
19 use Prophecy\Prophecy\ObjectProphecy;
26 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
31 'tableName' =>
'sys_redirect',
51 'tableName' =>
'tt_content',
54 $siteFinderProphecy = $this->prophesize(SiteFinder::class);
55 $siteFinderProphecy->getAllSites()->willReturn([]);
57 $actualResult = $valuePickerItemDataProvider->addData($result);
58 self::assertSame($result, $actualResult);
67 $statementProphecy->fetchAll()->willReturn(
69 [
'domainName' =>
'bar.test'],
70 [
'domainName' =>
'foo.test'],
74 $siteFinderProphecy = $this->prophesize(SiteFinder::class);
75 $siteFinderProphecy->getAllSites()->willReturn([]);
77 $actualResult = $valuePickerItemDataProvider->addData($this->sysRedirectResultSet);
79 $expected[
'processedTca'][
'columns'][
'source_host'][
'config'][
'valuePicker'][
'items'] = [
80 [
'bar.test',
'bar.test'],
81 [
'foo.test',
'foo.test'],
83 self::assertSame($expected, $actualResult);
92 $statementProphecy->fetchAll()->willReturn([]);
93 $siteFinderProphecy = $this->prophesize(SiteFinder::class);
94 $siteFinderProphecy->getAllSites()->willReturn([]);
96 $actualResult = $valuePickerItemDataProvider->addData($this->sysRedirectResultSet);
98 self::assertSame($this->sysRedirectResultSet, $actualResult);
106 $queryBuilderProphecy = $this->prophesize(QueryBuilder::class);
107 $connectionPoolProphecy = $this->prophesize(ConnectionPool::class);
108 $connectionPoolProphecy->getQueryBuilderForTable(
'sys_domain')->willReturn($queryBuilderProphecy->reveal());
109 $queryRestrictionContainerProphecy = $this->prophesize(QueryRestrictionContainerInterface::class);
110 $queryBuilderProphecy->getRestrictions()->willReturn($queryRestrictionContainerProphecy->reveal());
111 $queryBuilderProphecy->select(
'domainName')->willReturn($queryBuilderProphecy->reveal());
112 $queryBuilderProphecy->from(
'sys_domain')->willReturn($queryBuilderProphecy->reveal());
113 $statementProphecy = $this->prophesize(Statement::class);
114 $queryBuilderProphecy->execute()->willReturn($statementProphecy->reveal());
115 GeneralUtility::addInstance(ConnectionPool::class, $connectionPoolProphecy->reveal());
116 return $statementProphecy;