17 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
34 protected function setUp()
36 $this->mockObjectManager = $this->getMockBuilder(\
TYPO3\CMS\
Extbase\Object\ObjectManagerInterface::class)->getMock();
38 $this->subject = $this->getMockBuilder(\
TYPO3\CMS\Extensionmanager\Domain\Repository\RepositoryRepository::class)
39 ->setMethods([
'findAll'])
40 ->setConstructorArgs([$this->mockObjectManager])
50 ->expects($this->once())
52 ->will($this->returnValue([]));
54 $this->assertNull($this->subject->findOneTypo3OrgRepository());
62 $mockModelOne = $this->getMockBuilder(\
TYPO3\CMS\Extensionmanager\Domain\Model\Repository::class)->getMock();
64 ->expects($this->once())
66 ->will($this->returnValue(
'foo'));
67 $mockModelTwo = $this->getMockBuilder(\
TYPO3\CMS\Extensionmanager\Domain\Model\Repository::class)->getMock();
69 ->expects($this->once())
71 ->will($this->returnValue(
'TYPO3.org Main Repository'));
74 ->expects($this->once())
76 ->will($this->returnValue([$mockModelOne, $mockModelTwo]));
78 $this->assertSame($mockModelTwo, $this->subject->findOneTypo3OrgRepository());