/** * @return void */ public function setUp() { $this->testingFramework = new \Tx_Phpunit_Framework('fe_users'); $pageUid = $this->testingFramework->createFrontEndPage(); $this->testingFramework->createTemplate($pageUid, array('include_static_file' => 'EXT:sf_register/Configuration/TypoScript/maximal/')); $this->testingFramework->createFakeFrontEnd($pageUid); $this->fixture = $this->getAccessibleMock('Evoweb\\SfRegister\\Domain\\Validator\\EqualCurrentPasswordValidator', array('dummy')); }
/** * @return void */ public function setUp() { $this->testingFramework = new \Tx_Phpunit_Framework('fe_users'); $pageUid = $this->testingFramework->createFrontEndPage(); $this->testingFramework->createTemplate($pageUid, array('include_static_file' => 'EXT:sf_register/Configuration/TypoScript/')); $this->testingFramework->createFakeFrontEnd($pageUid); /** @var \Evoweb\SfRegister\Validation\Validator\UniqueValidator $fixture */ $this->fixture = $this->getAccessibleMock('Evoweb\\SfRegister\\Validation\\Validator\\UniqueValidator', array('dummy'), array('global' => FALSE)); }
/** * @return void */ public function setUp() { $this->testingFramework = new \Tx_Phpunit_Framework('fe_users'); $pageUid = $this->testingFramework->createFrontEndPage(); $this->testingFramework->createTemplate($pageUid, array('include_static_file' => 'EXT:sf_register/Configuration/TypoScript/maximal/')); $this->testingFramework->createFakeFrontEnd($pageUid); /** @var \Evoweb\SfRegister\Validation\Validator\BadWordValidator|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface $fixture */ $fixture = $this->getAccessibleMock('Evoweb\\SfRegister\\Validation\\Validator\\BadWordValidator', array('dummy')); $fixture->_set('settings', $GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_sfregister.']['settings.']); $this->fixture = $fixture; }
/** * Test if records are not returned on pages recursively where they not should be shown * * @test * @return void */ public function findRecordsForSpecialExcludeRecursivePageUidTest() { /** @var \DERHANSEN\SfBanners\Domain\Model\BannerDemand $demand */ $demand = $this->objectManager->get('DERHANSEN\\SfBanners\\Domain\\Model\\BannerDemand'); $pid = 96; /* Create some pages */ $pid1 = $this->testingFramework->createFrontEndPage(0, array('title' => 'Testpage7')); $pid2 = $this->testingFramework->createFrontEndPage($pid1, array('title' => 'Testpage8')); $pid3 = $this->testingFramework->createFrontEndPage($pid2, array('title' => 'Testpage9')); $pid4 = $this->testingFramework->createFrontEndPage(0, array('title' => 'Testpage10')); /* Create some banners with recursive option */ $banner1 = $this->testingFramework->createRecord('tx_sfbanners_domain_model_banner', array('pid' => $pid, 'recursive' => 1)); $banner2 = $this->testingFramework->createRecord('tx_sfbanners_domain_model_banner', array('pid' => $pid, 'recursive' => 1)); $banner3 = $this->testingFramework->createRecord('tx_sfbanners_domain_model_banner', array('pid' => $pid, 'recursive' => 1)); /* Create relations */ $this->testingFramework->createRelationAndUpdateCounter('tx_sfbanners_domain_model_banner', $banner1, $pid1, 'excludepages'); $this->testingFramework->createRelationAndUpdateCounter('tx_sfbanners_domain_model_banner', $banner1, $pid4, 'excludepages'); $this->testingFramework->createRelationAndUpdateCounter('tx_sfbanners_domain_model_banner', $banner2, $pid2, 'excludepages'); $this->testingFramework->createRelationAndUpdateCounter('tx_sfbanners_domain_model_banner', $banner3, $pid3, 'excludepages'); /* Set starting point */ $demand->setStartingPoint($pid); /* All banners, which not should be shown on the page with $pid1 */ $demand->setCurrentPageUid($pid1); $this->assertEquals(2, (int) $this->fixture->findDemanded($demand)->count()); /* All banners, which not should be shown on page with $pid2 */ $demand->setCurrentPageUid($pid2); $this->assertEquals(1, (int) $this->fixture->findDemanded($demand)->count()); /* All banners, which not should be shown on page with $pid3 */ $demand->setCurrentPageUid($pid3); $this->assertEquals(0, (int) $this->fixture->findDemanded($demand)->count()); /* All banners, which not should be shown on page with $pid4 */ $demand->setCurrentPageUid($pid4); $this->assertEquals(2, (int) $this->fixture->findDemanded($demand)->count()); }
/** * @return void */ public function setUp() { $this->testingFramework = new \Tx_Phpunit_Framework('fe_users'); $pageUid = $this->testingFramework->createFrontEndPage(); $this->testingFramework->createTemplate($pageUid, array('include_static_file' => 'EXT:sf_register/Configuration/TypoScript/')); $this->testingFramework->createFakeFrontEnd($pageUid); $extensionName = 'SfRegister'; $pluginName = 'Form'; $extensionSettings = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['extbase']['extensions'][$extensionName]; $extensionSettings['modules'][$pluginName]['controllers']['FeuserCreate'] = array('actions' => array('form', 'preview', 'proxy', 'save', 'confirm', 'removeImage'), 'nonCacheableActions' => array('form', 'preview', 'proxy', 'save', 'confirm', 'removeImage')); $bootstrap = new \TYPO3\CMS\Extbase\Core\Bootstrap(); $bootstrap->run('', array('userFunc' => '\\TYPO3\\CMS\\Extbase\\Core\\Bootstrap->run', 'extensionName' => $extensionName, 'pluginName' => $pluginName)); /** @var \TYPO3\CMS\Extbase\Object\ObjectManager $objectManager */ $objectManager = GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Object\ObjectManager::class); $this->fixture = new \Evoweb\SfRegister\Domain\Repository\FrontendUserRepository($objectManager); }
/** * @test */ public function createAndLogInFrontEndUserWithFrontEndUserGroupLogsInFrontEndUser() { $this->subject->createFrontEndPage(); $this->subject->createFakeFrontEnd(); $frontEndUserGroupUid = $this->subject->createFrontEndUserGroup(); $this->subject->createAndLogInFrontEndUser($frontEndUserGroupUid); self::assertTrue($this->subject->isLoggedIn()); }
/** * @test */ public function createFakeFrontEndUsesProvidedPageUidAsFrontEndId() { $pageUid = $this->fixture->createFrontEndPage(); $this->fixture->createFakeFrontEnd($pageUid); $this->assertSame($pageUid, $GLOBALS['TSFE']->id); }