/** * Load specific areas of RFC through builder * * @param bool $loadDetails * @param bool $loadChangeLog * @param bool $loadVotes */ private function loadRfc($loadDetails, $loadChangeLog, $loadVotes) { $this->rfcBuilder->loadName(); if ($loadDetails) { $this->rfcBuilder->loadDetails(); } if ($loadChangeLog) { $this->rfcBuilder->loadChangeLog(); } if ($loadVotes) { $this->rfcBuilder->loadVotes(); } }
/** * @param $details * @param $changeLog * @param $votes * * @dataProvider getRfcTestsDataProvider */ public function testGetRfcFromStorageCorrectlyBuildsRfc($details, $changeLog, $votes) { $rfc = new Rfc(); $this->rfcBuilderMock->expects($this->once())->method('loadFromStorage')->with('generator-delegation'); $this->rfcBuilderMock->expects($this->once())->method('loadName'); if ($details) { $this->rfcBuilderMock->expects($this->once())->method('loadDetails'); } if ($changeLog) { $this->rfcBuilderMock->expects($this->once())->method('loadChangeLog'); } if ($votes) { $this->rfcBuilderMock->expects($this->once())->method('loadVotes'); } $this->rfcBuilderMock->expects($this->once())->method('getRfc')->will($this->returnValue($rfc)); $this->assertSame($rfc, $this->rfcService->getRfcFromStorage('generator-delegation', $details, $changeLog, $votes)); }