/**
  * Get starting page uid
  *      current pid or given pid from Page TSConfig
  *
  * @return int
  */
 protected function getStartPid()
 {
     $tsConfiguration = BackendUtility::getPagesTSconfig(BackendUtility::getPidFromBackendPage());
     $startPid = 0;
     if (!empty($tsConfiguration['tx_powermail.']['flexForm.']['formSelection'])) {
         $startPid = $tsConfiguration['tx_powermail.']['flexForm.']['formSelection'];
         if ($startPid === 'current') {
             $startPid = BackendUtility::getPidFromBackendPage();
         }
     }
     return (int) $startPid;
 }
 /**
  * Get commaseparated list of PID under a starting Page
  *
  * @param int|string $startPid Integer or "current"
  * @return string
  */
 protected function getPidListFromStartingPoint($startPid = 0)
 {
     /** @var \TYPO3\CMS\Core\Database\QueryGenerator $queryGenerator */
     $queryGenerator = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Database\\QueryGenerator');
     if ($startPid === 'current') {
         $startPid = BackendUtility::getPidFromBackendPage();
     }
     $list = $queryGenerator->getTreeList($startPid, 10, 0, 1);
     return $list;
 }
 /**
  * getPidFromBackendPage Test
  *
  * @param string $returnUrl
  * @param int $expectedResult
  * @dataProvider getPidFromBackendPageReturnsIntDataProvider
  * @return void
  * @test
  */
 public function getPidFromBackendPageReturnsInt($returnUrl, $expectedResult)
 {
     $this->assertSame($expectedResult, BackendUtility::getPidFromBackendPage($returnUrl));
 }