Files
steiermark/public/typo3conf/ext/off/Classes/Controller/WettbewerbeController.php
T
2026-10-06 19:40:28 +02:00

226 lines
7.0 KiB
PHP

<?php
namespace HermannTelser\Zuladungsliste\Controller;
/***************************************************************
* Copyright notice
*
* (c) 2016 Hermann Telser <hermann.telser@gmail.com>, Hermann Telser
*
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
use TYPO3\CMS\Extbase\Annotation\Inject;
/**
* Test case for class \HermannTelser\Zuladungsliste\Domain\Model\Architekten.
*
* @copyright Copyright belongs to the respective authors
* @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3 or later
* @author Hermann Telser <hermann.telser@gmail.com>
*/
class WettbewerbeController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController
{
/**
* @var \HermannTelser\Zuladungsliste\Domain\Model\Architekten
*/
protected $subject = NULL;
/**
* wettbewerbeRepository
*
* @var \HermannTelser\Zuladungsliste\Domain\Repository\WettbewerbeRepository
* @TYPO3\CMS\Extbase\Annotation\Inject
*/
protected $wettbewerbeRepository = NULL;
public function setUp()
{
$this->subject = new \HermannTelser\Zuladungsliste\Domain\Model\Architekten();
}
public function tearDown()
{
unset($this->subject);
}
/**
* @test
*/
public function getInlisteReturnsInitialValueForBool()
{
$this->assertSame(FALSE, $this->subject->getInliste());
}
/**
* @test
*/
public function setInlisteForBoolSetsInliste()
{
$this->subject->setInliste(TRUE);
$this->assertAttributeEquals(TRUE, 'inliste', $this->subject);
}
/**
* @test
*/
public function getVereidigungReturnsInitialValueForDateTime()
{
$this->assertEquals(NULL, $this->subject->getVereidigung());
}
/**
* @test
*/
public function setVereidigungForDateTimeSetsVereidigung()
{
$dateTimeFixture = new \DateTime();
$this->subject->setVereidigung($dateTimeFixture);
$this->assertAttributeEquals($dateTimeFixture, 'vereidigung', $this->subject);
}
/**
* @test
*/
public function getGeburtsdatumReturnsInitialValueForDateTime()
{
$this->assertEquals(NULL, $this->subject->getGeburtsdatum());
}
/**
* @test
*/
public function setGeburtsdatumForDateTimeSetsGeburtsdatum()
{
$dateTimeFixture = new \DateTime();
$this->subject->setGeburtsdatum($dateTimeFixture);
$this->assertAttributeEquals($dateTimeFixture, 'geburtsdatum', $this->subject);
}
/**
* @test
*/
public function getfrauenfoerderpunktReturnsInitialValueForBool()
{
$this->assertSame(FALSE, $this->subject->getfrauenfoerderpunkt());
}
/**
* @test
*/
public function setfrauenfoerderpunktForBoolSetsfrauenfoerderpunkt()
{
$this->subject->setfrauenfoerderpunkt(TRUE);
$this->assertAttributeEquals(TRUE, 'frauenfoerderpunkt', $this->subject);
}
/**
* action list
*
* @return void
*/
public function listAction()
{
$wettbewerbes = $this->wettbewerbeRepository->findAll();
$this->view->assign('wettbewerbes', $wettbewerbes);
}
/**
* action show
*
* @param \HermannTelser\Zuladungsliste\Domain\Model\Wettbewerbe $wettbewerbe
* @return void
*/
public function showAction(\HermannTelser\Zuladungsliste\Domain\Model\Wettbewerbe $wettbewerbe)
{
$this->view->assign('wettbewerbe', $wettbewerbe);
}
/**
* action new
*
* @return void
*/
public function newAction()
{
//// top.TYPO3.Backend.NavigationContainer.PageTree.select(38);
echo '<script>
if (top && top.TYPO3.Backend.NavigationContainer.PageTree) {
top.TYPO3.ModuleMenu.App.showModule("web_list");
}
window.open("http://'.$_SERVER["SERVER_NAME"].'/index.php?id=34","_blank");
</script>';
exit();
}
/**
* action create
*
* @param \HermannTelser\Zuladungsliste\Domain\Model\Wettbewerbe $newWettbewerbe
* @return void
*/
public function createAction(\HermannTelser\Zuladungsliste\Domain\Model\Wettbewerbe $newWettbewerbe)
{
$this->addFlashMessage('The object was created. Please be aware that this action is publicly accessible unless you implement an access check. See http://wiki.typo3.org/T3Doc/Extension_Builder/Using_the_Extension_Builder#1._Model_the_domain', '', \TYPO3\CMS\Core\Messaging\AbstractMessage::ERROR);
$this->wettbewerbeRepository->add($newWettbewerbe);
$this->redirect('list');
}
/**
* action edit
*
* @param \HermannTelser\Zuladungsliste\Domain\Model\Wettbewerbe $wettbewerbe
* @TYPO3\CMS\Extbase\Annotation\IgnoreValidation $wettbewerbe
* @return void
*/
public function editAction(\HermannTelser\Zuladungsliste\Domain\Model\Wettbewerbe $wettbewerbe)
{
$this->view->assign('wettbewerbe', $wettbewerbe);
}
/**
* action update
*
* @param \HermannTelser\Zuladungsliste\Domain\Model\Wettbewerbe $wettbewerbe
* @return void
*/
public function updateAction(\HermannTelser\Zuladungsliste\Domain\Model\Wettbewerbe $wettbewerbe)
{
$this->addFlashMessage('The object was updated. Please be aware that this action is publicly accessible unless you implement an access check. See http://wiki.typo3.org/T3Doc/Extension_Builder/Using_the_Extension_Builder#1._Model_the_domain', '', \TYPO3\CMS\Core\Messaging\AbstractMessage::ERROR);
$this->wettbewerbeRepository->update($wettbewerbe);
$this->redirect('list');
}
/**
* action delete
*
* @param \HermannTelser\Zuladungsliste\Domain\Model\Wettbewerbe $wettbewerbe
* @return void
*/
public function deleteAction(\HermannTelser\Zuladungsliste\Domain\Model\Wettbewerbe $wettbewerbe)
{
$this->addFlashMessage('The object was deleted. Please be aware that this action is publicly accessible unless you implement an access check. See http://wiki.typo3.org/T3Doc/Extension_Builder/Using_the_Extension_Builder#1._Model_the_domain', '', \TYPO3\CMS\Core\Messaging\AbstractMessage::ERROR);
$this->wettbewerbeRepository->remove($wettbewerbe);
$this->redirect('list');
}
}