143 lines
4.7 KiB
PHP
143 lines
4.7 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!
|
|
***************************************************************/
|
|
|
|
/**
|
|
* Test case for class HermannTelser\Zuladungsliste\Controller\ExtrasperrungController.
|
|
*
|
|
* @author Hermann Telser <hermann.telser@gmail.com>
|
|
*/
|
|
class KriterienController extends \TYPO3\CMS\Core\Tests\UnitTestCase
|
|
{
|
|
|
|
/**
|
|
* @var \HermannTelser\Zuladungsliste\Controller\ExtrasperrungController
|
|
*/
|
|
protected $subject = NULL;
|
|
|
|
/**
|
|
* kriterienRepository
|
|
*
|
|
* @var \HermannTelser\Zuladungsliste\Domain\Repository\KriterienRepository
|
|
* @TYPO3CMSExtbaseAnnotationInject
|
|
*/
|
|
protected $kriterienRepository = NULL;
|
|
|
|
public function setUp()
|
|
{
|
|
$this->subject = $this->getMock('HermannTelser\Zuladungsliste\Controller\ExtrasperrungController', array('redirect', 'forward', 'addFlashMessage'), array(), '', FALSE);
|
|
}
|
|
|
|
public function tearDown()
|
|
{
|
|
unset($this->subject);
|
|
}
|
|
|
|
/**
|
|
* action list
|
|
*
|
|
* @return void
|
|
*/
|
|
public function listAction()
|
|
{
|
|
$kriteriens = $this->kriterienRepository->findAll();
|
|
$this->view->assign('kriteriens', $kriteriens);
|
|
}
|
|
|
|
/**
|
|
* action show
|
|
*
|
|
* @param \HermannTelser\Zuladungsliste\Domain\Model\Kriterien $kriterien
|
|
* @return void
|
|
*/
|
|
public function showAction(\HermannTelser\Zuladungsliste\Domain\Model\Kriterien $kriterien)
|
|
{
|
|
$this->view->assign('kriterien', $kriterien);
|
|
}
|
|
|
|
/**
|
|
* action new
|
|
*
|
|
* @return void
|
|
*/
|
|
public function newAction()
|
|
{
|
|
|
|
}
|
|
|
|
/**
|
|
* action create
|
|
*
|
|
* @param \HermannTelser\Zuladungsliste\Domain\Model\Kriterien $newKriterien
|
|
* @return void
|
|
*/
|
|
public function createAction(\HermannTelser\Zuladungsliste\Domain\Model\Kriterien $newKriterien)
|
|
{
|
|
$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->kriterienRepository->add($newKriterien);
|
|
$this->redirect('list');
|
|
}
|
|
|
|
/**
|
|
* action edit
|
|
*
|
|
* @param \HermannTelser\Zuladungsliste\Domain\Model\Kriterien $kriterien
|
|
* @TYPO3CMS\Extbase\Annotation\IgnoreValidation $kriterien
|
|
* @return void
|
|
*/
|
|
public function editAction(\HermannTelser\Zuladungsliste\Domain\Model\Kriterien $kriterien)
|
|
{
|
|
$this->view->assign('kriterien', $kriterien);
|
|
}
|
|
|
|
/**
|
|
* action update
|
|
*
|
|
* @param \HermannTelser\Zuladungsliste\Domain\Model\Kriterien $kriterien
|
|
* @return void
|
|
*/
|
|
public function updateAction(\HermannTelser\Zuladungsliste\Domain\Model\Kriterien $kriterien)
|
|
{
|
|
$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->kriterienRepository->update($kriterien);
|
|
$this->redirect('list');
|
|
}
|
|
|
|
/**
|
|
* action delete
|
|
*
|
|
* @param \HermannTelser\Zuladungsliste\Domain\Model\Kriterien $kriterien
|
|
* @return void
|
|
*/
|
|
public function deleteAction(\HermannTelser\Zuladungsliste\Domain\Model\Kriterien $kriterien)
|
|
{
|
|
$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->kriterienRepository->remove($kriterien);
|
|
$this->redirect('list');
|
|
}
|
|
|
|
}
|