mirror of
https://github.com/werkraum-media/events.git
synced 2024-11-14 04:56:11 +01:00
Add CI
* Add first basic CI with defaults. * Add ecs for coding guideline. * Fix invalid xliff files.
This commit is contained in:
parent
27e5bb129a
commit
cbe4eda380
49 changed files with 287 additions and 2075 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1,3 +1,3 @@
|
||||||
/composer.lock
|
/composer.lock
|
||||||
/public/
|
/.Build/
|
||||||
/vendor/
|
/vendor/
|
||||||
|
|
44
.gitlab-ci.yml
Normal file
44
.gitlab-ci.yml
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
stages:
|
||||||
|
- test
|
||||||
|
|
||||||
|
before_script:
|
||||||
|
- apk add zip
|
||||||
|
- php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
|
||||||
|
- php composer-setup.php --filename composer --install-dir /bin
|
||||||
|
- php -r "unlink('composer-setup.php');"
|
||||||
|
|
||||||
|
test:composer:
|
||||||
|
image: php:7.4-alpine
|
||||||
|
stage: test
|
||||||
|
script:
|
||||||
|
- composer validate --no-check-publish --strict
|
||||||
|
|
||||||
|
test:php:7.4:
|
||||||
|
image: php:7.4-alpine
|
||||||
|
stage: test
|
||||||
|
script:
|
||||||
|
- find *.php Classes Configuration -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l
|
||||||
|
|
||||||
|
test:php:7.3:
|
||||||
|
image: php:7.3-alpine
|
||||||
|
stage: test
|
||||||
|
script:
|
||||||
|
- find *.php Classes Configuration -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l
|
||||||
|
|
||||||
|
test:xml:
|
||||||
|
image: php:7.3-alpine
|
||||||
|
stage: test
|
||||||
|
before_script:
|
||||||
|
script:
|
||||||
|
- apk add libxml2-utils wget
|
||||||
|
- composer install --prefer-dist --no-progress
|
||||||
|
- wget https://docs.oasis-open.org/xliff/v1.2/os/xliff-core-1.2-strict.xsd --output-document=.Build/xliff-core-1.2-strict.xsd
|
||||||
|
- xmllint --schema .Build/xliff-core-1.2-strict.xsd --noout $(find Resources -name '*.xlf')
|
||||||
|
|
||||||
|
test:cgl:
|
||||||
|
image: php:7.3-alpine
|
||||||
|
stage: test
|
||||||
|
before_script:
|
||||||
|
script:
|
||||||
|
- composer install --prefer-dist --no-progress
|
||||||
|
- ./vendor/bin/ecs check --no-progress-bar --clear-cache --fix
|
|
@ -13,7 +13,6 @@ use Wrm\Events\Service\DestinationDataImportService;
|
||||||
|
|
||||||
class DestinationDataImportCommand extends Command
|
class DestinationDataImportCommand extends Command
|
||||||
{
|
{
|
||||||
|
|
||||||
public function configure()
|
public function configure()
|
||||||
{
|
{
|
||||||
$this->setDescription('Import Destination Data Events');
|
$this->setDescription('Import Destination Data Events');
|
||||||
|
|
|
@ -18,7 +18,6 @@ use Wrm\Events\Service\DataProcessingForModels;
|
||||||
*/
|
*/
|
||||||
class DateController extends AbstractController
|
class DateController extends AbstractController
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var dateRepository
|
* @var dateRepository
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -9,7 +9,6 @@ use TYPO3\CMS\Extbase\DomainObject\AbstractEntity;
|
||||||
*/
|
*/
|
||||||
class Date extends AbstractEntity
|
class Date extends AbstractEntity
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var \DateTime
|
* @var \DateTime
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -6,7 +6,6 @@ use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||||
|
|
||||||
class DateDemand
|
class DateDemand
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -4,7 +4,6 @@ namespace Wrm\Events\Domain\Model\Dto;
|
||||||
|
|
||||||
class EventDemand
|
class EventDemand
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
namespace Wrm\Events\Domain\Model;
|
namespace Wrm\Events\Domain\Model;
|
||||||
|
|
||||||
use TYPO3\CMS\Extbase\Annotation as Extbase;
|
use TYPO3\CMS\Extbase\Annotation as Extbase;
|
||||||
use TYPO3\CMS\Extbase\DomainObject\AbstractEntity;
|
|
||||||
use TYPO3\CMS\Extbase\Domain\Model\FileReference;
|
use TYPO3\CMS\Extbase\Domain\Model\FileReference;
|
||||||
|
use TYPO3\CMS\Extbase\DomainObject\AbstractEntity;
|
||||||
use TYPO3\CMS\Extbase\Object\ObjectManager;
|
use TYPO3\CMS\Extbase\Object\ObjectManager;
|
||||||
use TYPO3\CMS\Extbase\Persistence\ObjectStorage;
|
use TYPO3\CMS\Extbase\Persistence\ObjectStorage;
|
||||||
use Wrm\Events\Domain\Repository\DateRepository;
|
use Wrm\Events\Domain\Repository\DateRepository;
|
||||||
|
@ -15,7 +15,6 @@ use Wrm\Events\Service\DataProcessingForModels;
|
||||||
*/
|
*/
|
||||||
class Event extends AbstractEntity
|
class Event extends AbstractEntity
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* title
|
* title
|
||||||
*
|
*
|
||||||
|
|
|
@ -20,7 +20,6 @@ use TYPO3\CMS\Extbase\DomainObject\AbstractEntity;
|
||||||
*/
|
*/
|
||||||
class Organizer extends AbstractEntity
|
class Organizer extends AbstractEntity
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* name
|
* name
|
||||||
*
|
*
|
||||||
|
|
|
@ -21,8 +21,8 @@ namespace Wrm\Events\Domain\Model;
|
||||||
* 02110-1301, USA.
|
* 02110-1301, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use TYPO3\CMS\Extbase\DomainObject\AbstractEntity;
|
|
||||||
use TYPO3\CMS\Extbase\Domain\Model\FileReference;
|
use TYPO3\CMS\Extbase\Domain\Model\FileReference;
|
||||||
|
use TYPO3\CMS\Extbase\DomainObject\AbstractEntity;
|
||||||
use TYPO3\CMS\Extbase\Persistence\ObjectStorage;
|
use TYPO3\CMS\Extbase\Persistence\ObjectStorage;
|
||||||
|
|
||||||
class Partner extends AbstractEntity
|
class Partner extends AbstractEntity
|
||||||
|
|
|
@ -20,7 +20,6 @@ use TYPO3\CMS\Extbase\DomainObject\AbstractEntity;
|
||||||
*/
|
*/
|
||||||
class Region extends AbstractEntity
|
class Region extends AbstractEntity
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* title
|
* title
|
||||||
*
|
*
|
||||||
|
|
|
@ -13,7 +13,6 @@ use Wrm\Events\Service\CategoryService;
|
||||||
|
|
||||||
class DateRepository extends Repository
|
class DateRepository extends Repository
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Find all dates based on selected uids
|
* Find all dates based on selected uids
|
||||||
* @param string $uids
|
* @param string $uids
|
||||||
|
@ -164,7 +163,6 @@ class DateRepository extends Repository
|
||||||
*/
|
*/
|
||||||
public function findSearchWord($search)
|
public function findSearchWord($search)
|
||||||
{
|
{
|
||||||
|
|
||||||
$connection = GeneralUtility::makeInstance(ConnectionPool::class)
|
$connection = GeneralUtility::makeInstance(ConnectionPool::class)
|
||||||
->getConnectionForTable('tx_events_domain_model_date');
|
->getConnectionForTable('tx_events_domain_model_date');
|
||||||
|
|
||||||
|
|
|
@ -19,5 +19,4 @@ use TYPO3\CMS\Extbase\Persistence\Repository;
|
||||||
|
|
||||||
class OrganizerRepository extends Repository
|
class OrganizerRepository extends Repository
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,5 +19,4 @@ use TYPO3\CMS\Extbase\Persistence\Repository;
|
||||||
|
|
||||||
class RegionRepository extends Repository
|
class RegionRepository extends Repository
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,6 @@ use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||||
|
|
||||||
class CategoryService
|
class CategoryService
|
||||||
{
|
{
|
||||||
|
|
||||||
/** @var TimeTracker */
|
/** @var TimeTracker */
|
||||||
protected $timeTracker;
|
protected $timeTracker;
|
||||||
|
|
||||||
|
|
|
@ -28,9 +28,9 @@ use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||||
|
|
||||||
class Database
|
class Database
|
||||||
{
|
{
|
||||||
const DATE_TABLE = 'tx_events_domain_model_date';
|
public const DATE_TABLE = 'tx_events_domain_model_date';
|
||||||
const EVENT_TABLE = 'tx_events_domain_model_event';
|
public const EVENT_TABLE = 'tx_events_domain_model_event';
|
||||||
const ORGANIZER_TABLE = 'tx_events_domain_model_organizer';
|
public const ORGANIZER_TABLE = 'tx_events_domain_model_organizer';
|
||||||
|
|
||||||
public function truncateTables(string ...$tableNames): void
|
public function truncateTables(string ...$tableNames): void
|
||||||
{
|
{
|
||||||
|
|
|
@ -63,7 +63,7 @@ class Files
|
||||||
$uidsToRemove[] = $fileToDelete['uid'];
|
$uidsToRemove[] = $fileToDelete['uid'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->deleteFromDb(... $uidsToRemove);
|
$this->deleteFromDb(...$uidsToRemove);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function getFilesFromDb(callable $whereGenerator = null): array
|
private function getFilesFromDb(callable $whereGenerator = null): array
|
||||||
|
|
|
@ -27,14 +27,14 @@ class CleanupService
|
||||||
|
|
||||||
public function deleteAllData()
|
public function deleteAllData()
|
||||||
{
|
{
|
||||||
$this->database->truncateTables(... [Database::DATE_TABLE, Database::ORGANIZER_TABLE]);
|
$this->database->truncateTables(...[Database::DATE_TABLE, Database::ORGANIZER_TABLE]);
|
||||||
$this->removeViaDataHandler($this->database->getDeletionStructureForEvents());
|
$this->removeViaDataHandler($this->database->getDeletionStructureForEvents());
|
||||||
$this->files->deleteAll();
|
$this->files->deleteAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function deletePastData()
|
public function deletePastData()
|
||||||
{
|
{
|
||||||
$this->database->deleteDates(... $this->database->getPastDates());
|
$this->database->deleteDates(...$this->database->getPastDates());
|
||||||
$this->removeViaDataHandler($this->database->getDeletionStructureForEventsWithoutDates());
|
$this->removeViaDataHandler($this->database->getDeletionStructureForEventsWithoutDates());
|
||||||
$this->files->deleteDangling();
|
$this->files->deleteDangling();
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,9 +3,9 @@
|
||||||
namespace Wrm\Events\Service;
|
namespace Wrm\Events\Service;
|
||||||
|
|
||||||
use TYPO3\CMS\Core\Core\Environment;
|
use TYPO3\CMS\Core\Core\Environment;
|
||||||
|
use TYPO3\CMS\Core\Database\ConnectionPool;
|
||||||
use TYPO3\CMS\Core\DataHandling\DataHandler;
|
use TYPO3\CMS\Core\DataHandling\DataHandler;
|
||||||
use TYPO3\CMS\Core\DataHandling\SlugHelper;
|
use TYPO3\CMS\Core\DataHandling\SlugHelper;
|
||||||
use TYPO3\CMS\Core\Database\ConnectionPool;
|
|
||||||
use TYPO3\CMS\Core\Log\LogManager;
|
use TYPO3\CMS\Core\Log\LogManager;
|
||||||
use TYPO3\CMS\Core\Resource\Exception\FolderDoesNotExistException;
|
use TYPO3\CMS\Core\Resource\Exception\FolderDoesNotExistException;
|
||||||
use TYPO3\CMS\Core\Resource\FileRepository;
|
use TYPO3\CMS\Core\Resource\FileRepository;
|
||||||
|
@ -29,7 +29,6 @@ use Wrm\Events\Domain\Repository\RegionRepository;
|
||||||
|
|
||||||
class DestinationDataImportService
|
class DestinationDataImportService
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var
|
* @var
|
||||||
*/
|
*/
|
||||||
|
@ -172,18 +171,18 @@ class DestinationDataImportService
|
||||||
ObjectManager $objectManager,
|
ObjectManager $objectManager,
|
||||||
Environment $environment
|
Environment $environment
|
||||||
) {
|
) {
|
||||||
$this->eventRepository = $eventRepository;
|
$this->eventRepository = $eventRepository;
|
||||||
$this->regionRepository = $regionRepository;
|
$this->regionRepository = $regionRepository;
|
||||||
$this->organizerRepository = $organizerRepository;
|
$this->organizerRepository = $organizerRepository;
|
||||||
$this->dateRepository = $dateRepository;
|
$this->dateRepository = $dateRepository;
|
||||||
$this->sysCategoriesRepository = $sysCategoriesRepository;
|
$this->sysCategoriesRepository = $sysCategoriesRepository;
|
||||||
$this->fileRepository = $fileRepository;
|
$this->fileRepository = $fileRepository;
|
||||||
$this->metaDataRepository = $metaDataRepository;
|
$this->metaDataRepository = $metaDataRepository;
|
||||||
$this->configurationManager = $configurationManager;
|
$this->configurationManager = $configurationManager;
|
||||||
$this->persistenceManager = $persistenceManager;
|
$this->persistenceManager = $persistenceManager;
|
||||||
$this->resourceFactory = $resourceFactory;
|
$this->resourceFactory = $resourceFactory;
|
||||||
$this->objectManager = $objectManager;
|
$this->objectManager = $objectManager;
|
||||||
$this->environment = $environment;
|
$this->environment = $environment;
|
||||||
|
|
||||||
// Get Typoscript Settings
|
// Get Typoscript Settings
|
||||||
$this->settings = $this->configurationManager->getConfiguration(
|
$this->settings = $this->configurationManager->getConfiguration(
|
||||||
|
@ -193,13 +192,13 @@ class DestinationDataImportService
|
||||||
);
|
);
|
||||||
|
|
||||||
// Set properties
|
// Set properties
|
||||||
$this->restUrl = $this->settings['destinationData']['restUrl'];
|
$this->restUrl = $this->settings['destinationData']['restUrl'];
|
||||||
$this->restLicenseKey = $this->settings['destinationData']['license'];
|
$this->restLicenseKey = $this->settings['destinationData']['license'];
|
||||||
$this->restType = $this->settings['destinationData']['restType'];
|
$this->restType = $this->settings['destinationData']['restType'];
|
||||||
$this->restLimit = $this->settings['destinationData']['restLimit'];
|
$this->restLimit = $this->settings['destinationData']['restLimit'];
|
||||||
$this->restMode = $this->settings['destinationData']['restMode'];
|
$this->restMode = $this->settings['destinationData']['restMode'];
|
||||||
$this->restTemplate = $this->settings['destinationData']['restTemplate'];
|
$this->restTemplate = $this->settings['destinationData']['restTemplate'];
|
||||||
$this->sysCategoriesPid = $this->settings['destinationData']['categoriesPid'];
|
$this->sysCategoriesPid = $this->settings['destinationData']['categoriesPid'];
|
||||||
$this->categoryParentUid = $this->settings['destinationData']['categoryParentUid'];
|
$this->categoryParentUid = $this->settings['destinationData']['categoryParentUid'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -211,7 +210,6 @@ class DestinationDataImportService
|
||||||
*/
|
*/
|
||||||
public function import($restExperience, $storagePid, $regionUid, $filesFolder)
|
public function import($restExperience, $storagePid, $regionUid, $filesFolder)
|
||||||
{
|
{
|
||||||
|
|
||||||
$this->restExperience = $restExperience;
|
$this->restExperience = $restExperience;
|
||||||
$this->storagePid = $storagePid;
|
$this->storagePid = $storagePid;
|
||||||
$this->regionUid = $regionUid;
|
$this->regionUid = $regionUid;
|
||||||
|
@ -252,7 +250,6 @@ class DestinationDataImportService
|
||||||
*/
|
*/
|
||||||
public function processData($data)
|
public function processData($data)
|
||||||
{
|
{
|
||||||
|
|
||||||
$this->logger->info('Processing json ' . count($data['items']));
|
$this->logger->info('Processing json ' . count($data['items']));
|
||||||
|
|
||||||
// Get selected region
|
// Get selected region
|
||||||
|
@ -546,7 +543,6 @@ class DestinationDataImportService
|
||||||
*/
|
*/
|
||||||
protected function multi_array_key_exists($needle, $haystack)
|
protected function multi_array_key_exists($needle, $haystack)
|
||||||
{
|
{
|
||||||
|
|
||||||
foreach ($haystack as $key => $value) {
|
foreach ($haystack as $key => $value) {
|
||||||
if ($needle == $key) {
|
if ($needle == $key) {
|
||||||
return true;
|
return true;
|
||||||
|
@ -596,7 +592,6 @@ class DestinationDataImportService
|
||||||
*/
|
*/
|
||||||
protected function getOrCreateEvent(string $globalId, string $title)
|
protected function getOrCreateEvent(string $globalId, string $title)
|
||||||
{
|
{
|
||||||
|
|
||||||
$event = $this->eventRepository->findOneByGlobalId($globalId);
|
$event = $this->eventRepository->findOneByGlobalId($globalId);
|
||||||
|
|
||||||
if ($event) {
|
if ($event) {
|
||||||
|
@ -614,7 +609,7 @@ class DestinationDataImportService
|
||||||
$event->setCategories(new ObjectStorage());
|
$event->setCategories(new ObjectStorage());
|
||||||
$this->eventRepository->add($event);
|
$this->eventRepository->add($event);
|
||||||
$this->persistenceManager->persistAll();
|
$this->persistenceManager->persistAll();
|
||||||
$this->logger->info('Not found "' . substr($title, 0, 20) . '..." with global id ' . $globalId . ' in database. Created new one.');
|
$this->logger->info('Not found "' . substr($title, 0, 20) . '..." with global id ' . $globalId . ' in database. Created new one.');
|
||||||
return $event;
|
return $event;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -623,7 +618,6 @@ class DestinationDataImportService
|
||||||
*/
|
*/
|
||||||
protected function setAssets(array $assets)
|
protected function setAssets(array $assets)
|
||||||
{
|
{
|
||||||
|
|
||||||
$this->logger->info("Set assets");
|
$this->logger->info("Set assets");
|
||||||
|
|
||||||
$error = false;
|
$error = false;
|
||||||
|
@ -673,7 +667,7 @@ class DestinationDataImportService
|
||||||
if ($error !== true) {
|
if ($error !== true) {
|
||||||
if ($this->tmpCurrentEvent->getImages()->count() > 0) {
|
if ($this->tmpCurrentEvent->getImages()->count() > 0) {
|
||||||
$this->logger->info('Relation found');
|
$this->logger->info('Relation found');
|
||||||
// TODO: How to delete file references?
|
// TODO: How to delete file references?
|
||||||
} else {
|
} else {
|
||||||
$this->logger->info('No relation found');
|
$this->logger->info('No relation found');
|
||||||
$file = $this->storage->getFile($this->filesFolder . $orgFileNameSanitized);
|
$file = $this->storage->getFile($this->filesFolder . $orgFileNameSanitized);
|
||||||
|
@ -716,7 +710,6 @@ class DestinationDataImportService
|
||||||
*/
|
*/
|
||||||
protected function createFileRelations($uid_local, $tablenames, $uid_foreign, $fieldname, $storagePid)
|
protected function createFileRelations($uid_local, $tablenames, $uid_foreign, $fieldname, $storagePid)
|
||||||
{
|
{
|
||||||
|
|
||||||
$newId = 'NEW1234';
|
$newId = 'NEW1234';
|
||||||
|
|
||||||
$data = array();
|
$data = array();
|
||||||
|
|
|
@ -68,5 +68,4 @@ call_user_func(function () {
|
||||||
'events_selected',
|
'events_selected',
|
||||||
'FILE:EXT:events/Configuration/FlexForms/Selected.xml'
|
'FILE:EXT:events/Configuration/FlexForms/Selected.xml'
|
||||||
);
|
);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -210,7 +210,7 @@ return [
|
||||||
'size' => 1,
|
'size' => 1,
|
||||||
'minitems' => 0,
|
'minitems' => 0,
|
||||||
'maxitems' => 1,
|
'maxitems' => 1,
|
||||||
'readOnly' =>1,
|
'readOnly' => 1,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'ctrl' => [
|
'ctrl' => [
|
||||||
'title' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_organizer.xlf:tx_events_domain_model_organizer',
|
'title' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_organizer.xlf:tx_events_domain_model_organizer',
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'ctrl' => [
|
'ctrl' => [
|
||||||
'title' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_region.xlf:tx_events_domain_model_region',
|
'title' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_region.xlf:tx_events_domain_model_region',
|
||||||
|
|
|
@ -1,32 +1,32 @@
|
||||||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<xliff version="1.0">
|
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
|
||||||
<file source-language="en" datatype="plaintext" original="messages" date="2019-04-03T12:11:11Z" product-name="tx_events">
|
<file source-language="en" target-language="de" datatype="plaintext" original="messages" date="2021-09-07T09:15:42Z" product-name="Events">
|
||||||
<header/>
|
<header/>
|
||||||
<body>
|
<body>
|
||||||
<trans-unit id="tx_events.searchform">
|
<trans-unit id="tx_events.searchform">
|
||||||
<source>Search form</source>
|
<source>Search form</source>
|
||||||
<target>Suchformular</target>
|
<target>Suchformular</target>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="tx_events.searchform.searchword">
|
<trans-unit id="tx_events.searchform.searchword">
|
||||||
<source>Search word</source>
|
<source>Search word</source>
|
||||||
<target>Suchwort</target>
|
<target>Suchwort</target>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="tx_events.searchform.date_from">
|
<trans-unit id="tx_events.searchform.date_from">
|
||||||
<source>Date from</source>
|
<source>Date from</source>
|
||||||
<target>Datum von</target>
|
<target>Datum von</target>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="tx_events.searchform.date_to">
|
<trans-unit id="tx_events.searchform.date_to">
|
||||||
<source>Date to</source>
|
<source>Date to</source>
|
||||||
<target>Date bis</target>
|
<target>Date bis</target>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="tx_events.searchform.regions">
|
<trans-unit id="tx_events.searchform.regions">
|
||||||
<source>All regions</source>
|
<source>All regions</source>
|
||||||
<target>Alle Städte</target>
|
<target>Alle Städte</target>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="tx_events.searchform.search">
|
<trans-unit id="tx_events.searchform.search">
|
||||||
<source>Search</source>
|
<source>Search</source>
|
||||||
<target>Suchen</target>
|
<target>Suchen</target>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
</body>
|
</body>
|
||||||
</file>
|
</file>
|
||||||
</xliff>
|
</xliff>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<xliff version="1.0">
|
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
|
||||||
<file source-language="en" datatype="plaintext" original="messages" date="2019-04-03T12:11:11Z" product-name="tx_events">
|
<file source-language="en" target-language="de" datatype="plaintext" original="messages" date="2021-09-07T09:15:42Z" product-name="Events">
|
||||||
<header/>
|
<header/>
|
||||||
<body>
|
<body>
|
||||||
<trans-unit id="tx_events_domain_model_date">
|
<trans-unit id="tx_events_domain_model_date">
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<xliff version="1.0">
|
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
|
||||||
<file source-language="en" datatype="plaintext" original="messages" date="2019-04-03T12:11:11Z" product-name="tx_events">
|
<file source-language="en" target-language="de" datatype="plaintext" original="messages" date="2021-09-07T09:15:42Z" product-name="Events">
|
||||||
<header/>
|
<header/>
|
||||||
<body>
|
<body>
|
||||||
<trans-unit id="tx_events.name">
|
<trans-unit id="tx_events.name">
|
||||||
|
|
|
@ -1,44 +1,44 @@
|
||||||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<xliff version="1.0">
|
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
|
||||||
<file source-language="en" datatype="plaintext" original="messages" date="2019-04-03T12:11:11Z" product-name="tx_events">
|
<file source-language="en" target-language="de" datatype="plaintext" original="messages" date="2021-09-07T09:15:42Z" product-name="Events">
|
||||||
<header/>
|
<header/>
|
||||||
<body>
|
<body>
|
||||||
<trans-unit id="tx_events_domain_model_organizer">
|
<trans-unit id="tx_events_domain_model_organizer">
|
||||||
<source>Organizer</source>
|
<source>Organizer</source>
|
||||||
<target>Organisator</target>
|
<target>Organisator</target>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="tx_events_domain_model_organizer.name">
|
<trans-unit id="tx_events_domain_model_organizer.name">
|
||||||
<source>Name</source>
|
<source>Name</source>
|
||||||
<target>Name</target>
|
<target>Name</target>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="tx_events_domain_model_organizer.street">
|
<trans-unit id="tx_events_domain_model_organizer.street">
|
||||||
<source>Street</source>
|
<source>Street</source>
|
||||||
<target>Straße</target>
|
<target>Straße</target>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="tx_events_domain_model_organizer.district">
|
<trans-unit id="tx_events_domain_model_organizer.district">
|
||||||
<source>District</source>
|
<source>District</source>
|
||||||
<target>Bundesland</target>
|
<target>Bundesland</target>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="tx_events_domain_model_organizer.city">
|
<trans-unit id="tx_events_domain_model_organizer.city">
|
||||||
<source>City</source>
|
<source>City</source>
|
||||||
<target>Stadt</target>
|
<target>Stadt</target>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="tx_events_domain_model_organizer.zip">
|
<trans-unit id="tx_events_domain_model_organizer.zip">
|
||||||
<source>Zip</source>
|
<source>Zip</source>
|
||||||
<target>Postleitzahl</target>
|
<target>Postleitzahl</target>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="tx_events_domain_model_organizer.phone">
|
<trans-unit id="tx_events_domain_model_organizer.phone">
|
||||||
<source>Phone</source>
|
<source>Phone</source>
|
||||||
<target>Telefon</target>
|
<target>Telefon</target>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="tx_events_domain_model_organizer.web">
|
<trans-unit id="tx_events_domain_model_organizer.web">
|
||||||
<source>Web</source>
|
<source>Web</source>
|
||||||
<target>Internet</target>
|
<target>Internet</target>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="tx_events_domain_model_organizer.email">
|
<trans-unit id="tx_events_domain_model_organizer.email">
|
||||||
<source>E-Mail</source>
|
<source>E-Mail</source>
|
||||||
<target>E-Mail</target>
|
<target>E-Mail</target>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
</body>
|
</body>
|
||||||
</file>
|
</file>
|
||||||
</xliff>
|
</xliff>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<xliff version="1.0">
|
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
|
||||||
<file source-language="en" datatype="plaintext" original="messages" date="2019-04-03T12:11:11Z" product-name="tx_events">
|
<file source-language="en" target-language="de" datatype="plaintext" original="messages" date="2021-09-07T09:15:42Z" product-name="Events">
|
||||||
<header/>
|
<header/>
|
||||||
<body>
|
<body>
|
||||||
<trans-unit id="tx_events_domain_model_partner">
|
<trans-unit id="tx_events_domain_model_partner">
|
||||||
|
|
|
@ -1,16 +1,16 @@
|
||||||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<xliff version="1.0">
|
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
|
||||||
<file source-language="en" datatype="plaintext" original="messages" date="2019-04-03T12:11:11Z" product-name="tx_events">
|
<file source-language="en" target-language="de" datatype="plaintext" original="messages" date="2021-09-07T09:15:42Z" product-name="Events">
|
||||||
<header/>
|
<header/>
|
||||||
<body>
|
<body>
|
||||||
<trans-unit id="tx_events_domain_model_region">
|
<trans-unit id="tx_events_domain_model_region">
|
||||||
<source>Region</source>
|
<source>Region</source>
|
||||||
<target>Region</target>
|
<target>Region</target>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="tx_events_domain_model_region.title">
|
<trans-unit id="tx_events_domain_model_region.title">
|
||||||
<source>Title</source>
|
<source>Title</source>
|
||||||
<target>Titel</target>
|
<target>Titel</target>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
</body>
|
</body>
|
||||||
</file>
|
</file>
|
||||||
</xliff>
|
</xliff>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<xliff version="1.0">
|
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
|
||||||
<file source-language="en" datatype="plaintext" original="messages" date="2019-04-03T12:11:11Z" product-name="tx_events">
|
<file source-language="en" target-language="de" datatype="plaintext" original="messages" date="2021-09-07T09:15:42Z" product-name="Events">
|
||||||
<header/>
|
<header/>
|
||||||
<body>
|
<body>
|
||||||
<trans-unit id="tx_events.name">
|
<trans-unit id="tx_events.name">
|
||||||
|
|
|
@ -1,26 +1,26 @@
|
||||||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<xliff version="1.0">
|
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
|
||||||
<file source-language="en" datatype="plaintext" original="messages" date="2019-04-03T12:11:11Z" product-name="tx_events">
|
<file source-language="en" datatype="plaintext" original="messages" date="2021-09-07T09:15:42Z" product-name="Events">
|
||||||
<header/>
|
<header/>
|
||||||
<body>
|
<body>
|
||||||
<trans-unit id="tx_events.searchform">
|
<trans-unit id="tx_events.searchform">
|
||||||
<source>Search form</source>
|
<source>Search form</source>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="tx_events.searchform.searchword">
|
<trans-unit id="tx_events.searchform.searchword">
|
||||||
<source>Search word</source>
|
<source>Search word</source>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="tx_events.searchform.date_from">
|
<trans-unit id="tx_events.searchform.date_from">
|
||||||
<source>Date from</source>
|
<source>Date from</source>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="tx_events.searchform.date_to">
|
<trans-unit id="tx_events.searchform.date_to">
|
||||||
<source>Date to</source>
|
<source>Date to</source>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="tx_events.searchform.regions">
|
<trans-unit id="tx_events.searchform.regions">
|
||||||
<source>All regions</source>
|
<source>All regions</source>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="tx_events.searchform.search">
|
<trans-unit id="tx_events.searchform.search">
|
||||||
<source>Search</source>
|
<source>Search</source>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
</body>
|
</body>
|
||||||
</file>
|
</file>
|
||||||
</xliff>
|
</xliff>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<xliff version="1.0">
|
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
|
||||||
<file source-language="en" datatype="plaintext" original="messages" date="2019-04-03T12:11:11Z" product-name="tx_events">
|
<file source-language="en" datatype="plaintext" original="messages" date="2021-09-07T09:15:42Z" product-name="Events">
|
||||||
<header/>
|
<header/>
|
||||||
<body>
|
<body>
|
||||||
<trans-unit id="tx_events_domain_model_date">
|
<trans-unit id="tx_events_domain_model_date">
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<xliff version="1.0">
|
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
|
||||||
<file source-language="en" datatype="plaintext" original="messages" date="2019-04-03T12:11:11Z" product-name="tx_events">
|
<file source-language="en" datatype="plaintext" original="messages" date="2021-09-07T09:15:42Z" product-name="Events">
|
||||||
<header/>
|
<header/>
|
||||||
<body>
|
<body>
|
||||||
<trans-unit id="tx_events.name">
|
<trans-unit id="tx_events.name">
|
||||||
|
|
|
@ -1,35 +1,35 @@
|
||||||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<xliff version="1.0">
|
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
|
||||||
<file source-language="en" datatype="plaintext" original="messages" date="2019-04-03T12:11:11Z" product-name="tx_events">
|
<file source-language="en" datatype="plaintext" original="messages" date="2021-09-07T09:15:42Z" product-name="Events">
|
||||||
<header/>
|
<header/>
|
||||||
<body>
|
<body>
|
||||||
<trans-unit id="tx_events_domain_model_organizer">
|
<trans-unit id="tx_events_domain_model_organizer">
|
||||||
<source>Organizer</source>
|
<source>Organizer</source>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="tx_events_domain_model_organizer.name">
|
<trans-unit id="tx_events_domain_model_organizer.name">
|
||||||
<source>Name</source>
|
<source>Name</source>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="tx_events_domain_model_organizer.street">
|
<trans-unit id="tx_events_domain_model_organizer.street">
|
||||||
<source>Street</source>
|
<source>Street</source>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="tx_events_domain_model_organizer.district">
|
<trans-unit id="tx_events_domain_model_organizer.district">
|
||||||
<source>District</source>
|
<source>District</source>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="tx_events_domain_model_organizer.city">
|
<trans-unit id="tx_events_domain_model_organizer.city">
|
||||||
<source>City</source>
|
<source>City</source>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="tx_events_domain_model_organizer.zip">
|
<trans-unit id="tx_events_domain_model_organizer.zip">
|
||||||
<source>Zip</source>
|
<source>Zip</source>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="tx_events_domain_model_organizer.phone">
|
<trans-unit id="tx_events_domain_model_organizer.phone">
|
||||||
<source>Phone</source>
|
<source>Phone</source>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="tx_events_domain_model_organizer.web">
|
<trans-unit id="tx_events_domain_model_organizer.web">
|
||||||
<source>Web</source>
|
<source>Web</source>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="tx_events_domain_model_organizer.email">
|
<trans-unit id="tx_events_domain_model_organizer.email">
|
||||||
<source>E-Mail</source>
|
<source>E-Mail</source>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
</body>
|
</body>
|
||||||
</file>
|
</file>
|
||||||
</xliff>
|
</xliff>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<xliff version="1.0">
|
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
|
||||||
<file source-language="en" datatype="plaintext" original="messages" date="2019-04-03T12:11:11Z" product-name="tx_events">
|
<file source-language="en" datatype="plaintext" original="messages" date="2021-09-07T09:15:42Z" product-name="Events">
|
||||||
<header/>
|
<header/>
|
||||||
<body>
|
<body>
|
||||||
<trans-unit id="tx_events_domain_model_partner">
|
<trans-unit id="tx_events_domain_model_partner">
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<xliff version="1.0">
|
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
|
||||||
<file source-language="en" datatype="plaintext" original="messages" date="2019-04-03T12:11:11Z" product-name="tx_events">
|
<file source-language="en" datatype="plaintext" original="messages" date="2021-09-07T09:15:42Z" product-name="Events">
|
||||||
<header/>
|
<header/>
|
||||||
<body>
|
<body>
|
||||||
<trans-unit id="tx_events_domain_model_region">
|
<trans-unit id="tx_events_domain_model_region">
|
||||||
<source>Region</source>
|
<source>Region</source>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="tx_events_domain_model_region.title">
|
<trans-unit id="tx_events_domain_model_region.title">
|
||||||
<source>Title</source>
|
<source>Title</source>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
</body>
|
</body>
|
||||||
</file>
|
</file>
|
||||||
</xliff>
|
</xliff>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
||||||
<xliff version="1.0">
|
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
|
||||||
<file source-language="en" datatype="plaintext" original="messages" date="2019-04-03T12:11:11Z" product-name="tx_events">
|
<file source-language="en" datatype="plaintext" original="messages" date="2019-04-03T12:11:11Z" product-name="Events">
|
||||||
<header/>
|
<header/>
|
||||||
<body>
|
<body>
|
||||||
<trans-unit id="tx_events.name">
|
<trans-unit id="tx_events.name">
|
||||||
|
|
|
@ -1,63 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace Wrm\Events\Tests\Unit\Controller;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Test case.
|
|
||||||
*
|
|
||||||
* @author Dirk Koritnik <koritnik@werkraum-media.de>
|
|
||||||
*/
|
|
||||||
class DateControllerTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* @var \Wrm\Events\Controller\DateController
|
|
||||||
*/
|
|
||||||
protected $subject = null;
|
|
||||||
|
|
||||||
protected function setUp(): void
|
|
||||||
{
|
|
||||||
parent::setUp();
|
|
||||||
$this->subject = $this->getMockBuilder(\Wrm\Events\Controller\DateController::class)
|
|
||||||
->setMethods(['redirect', 'forward', 'addFlashMessage'])
|
|
||||||
->disableOriginalConstructor()
|
|
||||||
->getMock();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function listActionFetchesAllDatesFromRepositoryAndAssignsThemToView()
|
|
||||||
{
|
|
||||||
|
|
||||||
$allDates = $this->getMockBuilder(\TYPO3\CMS\Extbase\Persistence\ObjectStorage::class)
|
|
||||||
->disableOriginalConstructor()
|
|
||||||
->getMock();
|
|
||||||
|
|
||||||
// $dateRepository = $this->getMockBuilder(\::class)
|
|
||||||
// ->setMethods(['findAll'])
|
|
||||||
// ->disableOriginalConstructor()
|
|
||||||
// ->getMock();
|
|
||||||
$dateRepository->expects(self::once())->method('findAll')->will(self::returnValue($allDates));
|
|
||||||
$this->inject($this->subject, 'dateRepository', $dateRepository);
|
|
||||||
|
|
||||||
$view = $this->getMockBuilder(\TYPO3\CMS\Extbase\Mvc\View\ViewInterface::class)->getMock();
|
|
||||||
$view->expects(self::once())->method('assign')->with('dates', $allDates);
|
|
||||||
$this->inject($this->subject, 'view', $view);
|
|
||||||
|
|
||||||
$this->subject->listAction();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function showActionAssignsTheGivenDateToView()
|
|
||||||
{
|
|
||||||
$date = new \Wrm\Events\Domain\Model\Date();
|
|
||||||
|
|
||||||
$view = $this->getMockBuilder(\TYPO3\CMS\Extbase\Mvc\View\ViewInterface::class)->getMock();
|
|
||||||
$this->inject($this->subject, 'view', $view);
|
|
||||||
$view->expects(self::once())->method('assign')->with('date', $date);
|
|
||||||
|
|
||||||
$this->subject->showAction($date);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,63 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace Wrm\Events\Tests\Unit\Controller;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Test case.
|
|
||||||
*
|
|
||||||
* @author Dirk Koritnik <koritnik@werkraum-media.de>
|
|
||||||
*/
|
|
||||||
class EventControllerTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* @var \Wrm\Events\Controller\EventController
|
|
||||||
*/
|
|
||||||
protected $subject = null;
|
|
||||||
|
|
||||||
protected function setUp(): void
|
|
||||||
{
|
|
||||||
parent::setUp();
|
|
||||||
$this->subject = $this->getMockBuilder(\Wrm\Events\Controller\EventController::class)
|
|
||||||
->setMethods(['redirect', 'forward', 'addFlashMessage'])
|
|
||||||
->disableOriginalConstructor()
|
|
||||||
->getMock();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function listActionFetchesAllEventsFromRepositoryAndAssignsThemToView()
|
|
||||||
{
|
|
||||||
|
|
||||||
$allEvents = $this->getMockBuilder(\TYPO3\CMS\Extbase\Persistence\ObjectStorage::class)
|
|
||||||
->disableOriginalConstructor()
|
|
||||||
->getMock();
|
|
||||||
|
|
||||||
// $eventRepository = $this->getMockBuilder(\::class)
|
|
||||||
// ->setMethods(['findAll'])
|
|
||||||
// ->disableOriginalConstructor()
|
|
||||||
// ->getMock();
|
|
||||||
$eventRepository->expects(self::once())->method('findAll')->will(self::returnValue($allEvents));
|
|
||||||
$this->inject($this->subject, 'eventRepository', $eventRepository);
|
|
||||||
|
|
||||||
$view = $this->getMockBuilder(\TYPO3\CMS\Extbase\Mvc\View\ViewInterface::class)->getMock();
|
|
||||||
$view->expects(self::once())->method('assign')->with('events', $allEvents);
|
|
||||||
$this->inject($this->subject, 'view', $view);
|
|
||||||
|
|
||||||
$this->subject->listAction();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function showActionAssignsTheGivenEventToView()
|
|
||||||
{
|
|
||||||
$event = new \Wrm\Events\Domain\Model\Event();
|
|
||||||
|
|
||||||
$view = $this->getMockBuilder(\TYPO3\CMS\Extbase\Mvc\View\ViewInterface::class)->getMock();
|
|
||||||
$this->inject($this->subject, 'view', $view);
|
|
||||||
$view->expects(self::once())->method('assign')->with('event', $event);
|
|
||||||
|
|
||||||
$this->subject->showAction($event);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,63 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace Wrm\Events\Tests\Unit\Controller;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Test case.
|
|
||||||
*
|
|
||||||
* @author Dirk Koritnik <koritnik@werkraum-media.de>
|
|
||||||
*/
|
|
||||||
class EventsControllerTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* @var \Wrm\Events\Controller\EventsController
|
|
||||||
*/
|
|
||||||
protected $subject = null;
|
|
||||||
|
|
||||||
protected function setUp(): void
|
|
||||||
{
|
|
||||||
parent::setUp();
|
|
||||||
$this->subject = $this->getMockBuilder(\Wrm\Events\Controller\EventsController::class)
|
|
||||||
->setMethods(['redirect', 'forward', 'addFlashMessage'])
|
|
||||||
->disableOriginalConstructor()
|
|
||||||
->getMock();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function listActionFetchesAllEventssFromRepositoryAndAssignsThemToView()
|
|
||||||
{
|
|
||||||
|
|
||||||
$allEventss = $this->getMockBuilder(\TYPO3\CMS\Extbase\Persistence\ObjectStorage::class)
|
|
||||||
->disableOriginalConstructor()
|
|
||||||
->getMock();
|
|
||||||
|
|
||||||
// $eventsRepository = $this->getMockBuilder(\::class)
|
|
||||||
// ->setMethods(['findAll'])
|
|
||||||
// ->disableOriginalConstructor()
|
|
||||||
// ->getMock();
|
|
||||||
$eventsRepository->expects(self::once())->method('findAll')->will(self::returnValue($allEventss));
|
|
||||||
$this->inject($this->subject, 'eventsRepository', $eventsRepository);
|
|
||||||
|
|
||||||
$view = $this->getMockBuilder(\TYPO3\CMS\Extbase\Mvc\View\ViewInterface::class)->getMock();
|
|
||||||
$view->expects(self::once())->method('assign')->with('eventss', $allEventss);
|
|
||||||
$this->inject($this->subject, 'view', $view);
|
|
||||||
|
|
||||||
$this->subject->listAction();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function showActionAssignsTheGivenEventsToView()
|
|
||||||
{
|
|
||||||
$events = new \Wrm\Events\Domain\Model\Events();
|
|
||||||
|
|
||||||
$view = $this->getMockBuilder(\TYPO3\CMS\Extbase\Mvc\View\ViewInterface::class)->getMock();
|
|
||||||
$this->inject($this->subject, 'view', $view);
|
|
||||||
$view->expects(self::once())->method('assign')->with('events', $events);
|
|
||||||
|
|
||||||
$this->subject->showAction($events);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,74 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace Wrm\Events\Tests\Unit\Domain\Model;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Test case.
|
|
||||||
*
|
|
||||||
* @author Dirk Koritnik <koritnik@werkraum-media.de>
|
|
||||||
*/
|
|
||||||
class DateTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* @var \Wrm\Events\Domain\Model\Date
|
|
||||||
*/
|
|
||||||
protected $subject = null;
|
|
||||||
|
|
||||||
protected function setUp(): void
|
|
||||||
{
|
|
||||||
parent::setUp();
|
|
||||||
$this->subject = new \Wrm\Events\Domain\Model\Date();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function getStartReturnsInitialValueForDateTime()
|
|
||||||
{
|
|
||||||
self::assertEquals(
|
|
||||||
null,
|
|
||||||
$this->subject->getStart()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function setStartForDateTimeSetsStart()
|
|
||||||
{
|
|
||||||
$dateTimeFixture = new \DateTime();
|
|
||||||
$this->subject->setStart($dateTimeFixture);
|
|
||||||
|
|
||||||
self::assertAttributeEquals(
|
|
||||||
$dateTimeFixture,
|
|
||||||
'start',
|
|
||||||
$this->subject
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function getEndReturnsInitialValueForDateTime()
|
|
||||||
{
|
|
||||||
self::assertEquals(
|
|
||||||
null,
|
|
||||||
$this->subject->getEnd()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function setEndForDateTimeSetsEnd()
|
|
||||||
{
|
|
||||||
$dateTimeFixture = new \DateTime();
|
|
||||||
$this->subject->setEnd($dateTimeFixture);
|
|
||||||
|
|
||||||
self::assertAttributeEquals(
|
|
||||||
$dateTimeFixture,
|
|
||||||
'end',
|
|
||||||
$this->subject
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,663 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace Wrm\Events\Tests\Unit\Domain\Model;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Test case.
|
|
||||||
*
|
|
||||||
* @author Dirk Koritnik <koritnik@werkraum-media.de>
|
|
||||||
*/
|
|
||||||
class EventTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* @var \Wrm\Events\Domain\Model\Event
|
|
||||||
*/
|
|
||||||
protected $subject = null;
|
|
||||||
|
|
||||||
protected function setUp(): void
|
|
||||||
{
|
|
||||||
parent::setUp();
|
|
||||||
$this->subject = new \Wrm\Events\Domain\Model\Event();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function getTitleReturnsInitialValueForString()
|
|
||||||
{
|
|
||||||
self::assertSame(
|
|
||||||
'',
|
|
||||||
$this->subject->getTitle()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function setTitleForStringSetsTitle()
|
|
||||||
{
|
|
||||||
$this->subject->setTitle('Conceived at T3CON10');
|
|
||||||
|
|
||||||
self::assertAttributeEquals(
|
|
||||||
'Conceived at T3CON10',
|
|
||||||
'title',
|
|
||||||
$this->subject
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function getGlobalIdReturnsInitialValueForString()
|
|
||||||
{
|
|
||||||
self::assertSame(
|
|
||||||
'',
|
|
||||||
$this->subject->getGlobalId()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function setGlobalIdForStringSetsGlobalId()
|
|
||||||
{
|
|
||||||
$this->subject->setGlobalId('Conceived at T3CON10');
|
|
||||||
|
|
||||||
self::assertAttributeEquals(
|
|
||||||
'Conceived at T3CON10',
|
|
||||||
'globalId',
|
|
||||||
$this->subject
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function getSlugReturnsInitialValueForString()
|
|
||||||
{
|
|
||||||
self::assertSame(
|
|
||||||
'',
|
|
||||||
$this->subject->getSlug()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function setSlugForStringSetsSlug()
|
|
||||||
{
|
|
||||||
$this->subject->setSlug('Conceived at T3CON10');
|
|
||||||
|
|
||||||
self::assertAttributeEquals(
|
|
||||||
'Conceived at T3CON10',
|
|
||||||
'slug',
|
|
||||||
$this->subject
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function getHighlightReturnsInitialValueForBool()
|
|
||||||
{
|
|
||||||
self::assertSame(
|
|
||||||
false,
|
|
||||||
$this->subject->getHighlight()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function setHighlightForBoolSetsHighlight()
|
|
||||||
{
|
|
||||||
$this->subject->setHighlight(true);
|
|
||||||
|
|
||||||
self::assertAttributeEquals(
|
|
||||||
true,
|
|
||||||
'highlight',
|
|
||||||
$this->subject
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function getTeaserReturnsInitialValueForString()
|
|
||||||
{
|
|
||||||
self::assertSame(
|
|
||||||
'',
|
|
||||||
$this->subject->getTeaser()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function setTeaserForStringSetsTeaser()
|
|
||||||
{
|
|
||||||
$this->subject->setTeaser('Conceived at T3CON10');
|
|
||||||
|
|
||||||
self::assertAttributeEquals(
|
|
||||||
'Conceived at T3CON10',
|
|
||||||
'teaser',
|
|
||||||
$this->subject
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function getDetailsReturnsInitialValueForString()
|
|
||||||
{
|
|
||||||
self::assertSame(
|
|
||||||
'',
|
|
||||||
$this->subject->getDetails()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function setDetailsForStringSetsDetails()
|
|
||||||
{
|
|
||||||
$this->subject->setDetails('Conceived at T3CON10');
|
|
||||||
|
|
||||||
self::assertAttributeEquals(
|
|
||||||
'Conceived at T3CON10',
|
|
||||||
'details',
|
|
||||||
$this->subject
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function getPriceInfoReturnsInitialValueForString()
|
|
||||||
{
|
|
||||||
self::assertSame(
|
|
||||||
'',
|
|
||||||
$this->subject->getPriceInfo()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function setPriceInfoForStringSetsPriceInfo()
|
|
||||||
{
|
|
||||||
$this->subject->setPriceInfo('Conceived at T3CON10');
|
|
||||||
|
|
||||||
self::assertAttributeEquals(
|
|
||||||
'Conceived at T3CON10',
|
|
||||||
'priceInfo',
|
|
||||||
$this->subject
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function getStreetReturnsInitialValueForString()
|
|
||||||
{
|
|
||||||
self::assertSame(
|
|
||||||
'',
|
|
||||||
$this->subject->getStreet()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function setStreetForStringSetsStreet()
|
|
||||||
{
|
|
||||||
$this->subject->setStreet('Conceived at T3CON10');
|
|
||||||
|
|
||||||
self::assertAttributeEquals(
|
|
||||||
'Conceived at T3CON10',
|
|
||||||
'street',
|
|
||||||
$this->subject
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function getDistrictReturnsInitialValueForString()
|
|
||||||
{
|
|
||||||
self::assertSame(
|
|
||||||
'',
|
|
||||||
$this->subject->getDistrict()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function setDistrictForStringSetsDistrict()
|
|
||||||
{
|
|
||||||
$this->subject->setDistrict('Conceived at T3CON10');
|
|
||||||
|
|
||||||
self::assertAttributeEquals(
|
|
||||||
'Conceived at T3CON10',
|
|
||||||
'district',
|
|
||||||
$this->subject
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function getCityReturnsInitialValueForString()
|
|
||||||
{
|
|
||||||
self::assertSame(
|
|
||||||
'',
|
|
||||||
$this->subject->getCity()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function setCityForStringSetsCity()
|
|
||||||
{
|
|
||||||
$this->subject->setCity('Conceived at T3CON10');
|
|
||||||
|
|
||||||
self::assertAttributeEquals(
|
|
||||||
'Conceived at T3CON10',
|
|
||||||
'city',
|
|
||||||
$this->subject
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function getZipReturnsInitialValueForString()
|
|
||||||
{
|
|
||||||
self::assertSame(
|
|
||||||
'',
|
|
||||||
$this->subject->getZip()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function setZipForStringSetsZip()
|
|
||||||
{
|
|
||||||
$this->subject->setZip('Conceived at T3CON10');
|
|
||||||
|
|
||||||
self::assertAttributeEquals(
|
|
||||||
'Conceived at T3CON10',
|
|
||||||
'zip',
|
|
||||||
$this->subject
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function getCountryReturnsInitialValueForString()
|
|
||||||
{
|
|
||||||
self::assertSame(
|
|
||||||
'',
|
|
||||||
$this->subject->getCountry()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function setCountryForStringSetsCountry()
|
|
||||||
{
|
|
||||||
$this->subject->setCountry('Conceived at T3CON10');
|
|
||||||
|
|
||||||
self::assertAttributeEquals(
|
|
||||||
'Conceived at T3CON10',
|
|
||||||
'country',
|
|
||||||
$this->subject
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function getWebReturnsInitialValueForString()
|
|
||||||
{
|
|
||||||
self::assertSame(
|
|
||||||
'',
|
|
||||||
$this->subject->getWeb()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function setWebForStringSetsWeb()
|
|
||||||
{
|
|
||||||
$this->subject->setWeb('Conceived at T3CON10');
|
|
||||||
|
|
||||||
self::assertAttributeEquals(
|
|
||||||
'Conceived at T3CON10',
|
|
||||||
'web',
|
|
||||||
$this->subject
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function getBookingReturnsInitialValueForString()
|
|
||||||
{
|
|
||||||
self::assertSame(
|
|
||||||
'',
|
|
||||||
$this->subject->getBooking()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function setBookingForStringSetsBooking()
|
|
||||||
{
|
|
||||||
$this->subject->setBooking('Conceived at T3CON10');
|
|
||||||
|
|
||||||
self::assertAttributeEquals(
|
|
||||||
'Conceived at T3CON10',
|
|
||||||
'booking',
|
|
||||||
$this->subject
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function getTicketReturnsInitialValueForString()
|
|
||||||
{
|
|
||||||
self::assertSame(
|
|
||||||
'',
|
|
||||||
$this->subject->getTicket()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function setTicketForStringSetsTicket()
|
|
||||||
{
|
|
||||||
$this->subject->setTicket('Conceived at T3CON10');
|
|
||||||
|
|
||||||
self::assertAttributeEquals(
|
|
||||||
'Conceived at T3CON10',
|
|
||||||
'ticket',
|
|
||||||
$this->subject
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function getFacebookReturnsInitialValueForString()
|
|
||||||
{
|
|
||||||
self::assertSame(
|
|
||||||
'',
|
|
||||||
$this->subject->getFacebook()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function setFacebookForStringSetsFacebook()
|
|
||||||
{
|
|
||||||
$this->subject->setFacebook('Conceived at T3CON10');
|
|
||||||
|
|
||||||
self::assertAttributeEquals(
|
|
||||||
'Conceived at T3CON10',
|
|
||||||
'facebook',
|
|
||||||
$this->subject
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function getYoutubeReturnsInitialValueForString()
|
|
||||||
{
|
|
||||||
self::assertSame(
|
|
||||||
'',
|
|
||||||
$this->subject->getYoutube()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function setYoutubeForStringSetsYoutube()
|
|
||||||
{
|
|
||||||
$this->subject->setYoutube('Conceived at T3CON10');
|
|
||||||
|
|
||||||
self::assertAttributeEquals(
|
|
||||||
'Conceived at T3CON10',
|
|
||||||
'youtube',
|
|
||||||
$this->subject
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function getLatitudeReturnsInitialValueForString()
|
|
||||||
{
|
|
||||||
self::assertSame(
|
|
||||||
'',
|
|
||||||
$this->subject->getLatitude()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function setLatitudeForStringSetsLatitude()
|
|
||||||
{
|
|
||||||
$this->subject->setLatitude('Conceived at T3CON10');
|
|
||||||
|
|
||||||
self::assertAttributeEquals(
|
|
||||||
'Conceived at T3CON10',
|
|
||||||
'latitude',
|
|
||||||
$this->subject
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function getLongitudeReturnsInitialValueForString()
|
|
||||||
{
|
|
||||||
self::assertSame(
|
|
||||||
'',
|
|
||||||
$this->subject->getLongitude()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function setLongitudeForStringSetsLongitude()
|
|
||||||
{
|
|
||||||
$this->subject->setLongitude('Conceived at T3CON10');
|
|
||||||
|
|
||||||
self::assertAttributeEquals(
|
|
||||||
'Conceived at T3CON10',
|
|
||||||
'longitude',
|
|
||||||
$this->subject
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function getImagesReturnsInitialValueForFileReference()
|
|
||||||
{
|
|
||||||
self::assertEquals(
|
|
||||||
null,
|
|
||||||
$this->subject->getImages()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function setImagesForFileReferenceSetsImages()
|
|
||||||
{
|
|
||||||
$fileReferenceFixture = new \TYPO3\CMS\Extbase\Domain\Model\FileReference();
|
|
||||||
$this->subject->setImages($fileReferenceFixture);
|
|
||||||
|
|
||||||
self::assertAttributeEquals(
|
|
||||||
$fileReferenceFixture,
|
|
||||||
'images',
|
|
||||||
$this->subject
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function getCategoriesReturnsInitialValueForInt()
|
|
||||||
{
|
|
||||||
self::assertSame(
|
|
||||||
0,
|
|
||||||
$this->subject->getCategories()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function setCategoriesForIntSetsCategories()
|
|
||||||
{
|
|
||||||
$this->subject->setCategories(12);
|
|
||||||
|
|
||||||
self::assertAttributeEquals(
|
|
||||||
12,
|
|
||||||
'categories',
|
|
||||||
$this->subject
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function getDatesReturnsInitialValueForDate()
|
|
||||||
{
|
|
||||||
$newObjectStorage = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
|
|
||||||
self::assertEquals(
|
|
||||||
$newObjectStorage,
|
|
||||||
$this->subject->getDates()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function setDatesForObjectStorageContainingDateSetsDates()
|
|
||||||
{
|
|
||||||
$date = new \Wrm\Events\Domain\Model\Date();
|
|
||||||
$objectStorageHoldingExactlyOneDates = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
|
|
||||||
$objectStorageHoldingExactlyOneDates->attach($date);
|
|
||||||
$this->subject->setDates($objectStorageHoldingExactlyOneDates);
|
|
||||||
|
|
||||||
self::assertAttributeEquals(
|
|
||||||
$objectStorageHoldingExactlyOneDates,
|
|
||||||
'dates',
|
|
||||||
$this->subject
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function addDateToObjectStorageHoldingDates()
|
|
||||||
{
|
|
||||||
$date = new \Wrm\Events\Domain\Model\Date();
|
|
||||||
$datesObjectStorageMock = $this->getMockBuilder(\TYPO3\CMS\Extbase\Persistence\ObjectStorage::class)
|
|
||||||
->setMethods(['attach'])
|
|
||||||
->disableOriginalConstructor()
|
|
||||||
->getMock();
|
|
||||||
|
|
||||||
$datesObjectStorageMock->expects(self::once())->method('attach')->with(self::equalTo($date));
|
|
||||||
$this->inject($this->subject, 'dates', $datesObjectStorageMock);
|
|
||||||
|
|
||||||
$this->subject->addDate($date);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function removeDateFromObjectStorageHoldingDates()
|
|
||||||
{
|
|
||||||
$date = new \Wrm\Events\Domain\Model\Date();
|
|
||||||
$datesObjectStorageMock = $this->getMockBuilder(\TYPO3\CMS\Extbase\Persistence\ObjectStorage::class)
|
|
||||||
->setMethods(['detach'])
|
|
||||||
->disableOriginalConstructor()
|
|
||||||
->getMock();
|
|
||||||
|
|
||||||
$datesObjectStorageMock->expects(self::once())->method('detach')->with(self::equalTo($date));
|
|
||||||
$this->inject($this->subject, 'dates', $datesObjectStorageMock);
|
|
||||||
|
|
||||||
$this->subject->removeDate($date);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function getOrganizerReturnsInitialValueForOrganizer()
|
|
||||||
{
|
|
||||||
self::assertEquals(
|
|
||||||
null,
|
|
||||||
$this->subject->getOrganizer()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function setOrganizerForOrganizerSetsOrganizer()
|
|
||||||
{
|
|
||||||
$organizerFixture = new \Wrm\Events\Domain\Model\Organizer();
|
|
||||||
$this->subject->setOrganizer($organizerFixture);
|
|
||||||
|
|
||||||
self::assertAttributeEquals(
|
|
||||||
$organizerFixture,
|
|
||||||
'organizer',
|
|
||||||
$this->subject
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function getRegionReturnsInitialValueForRegion()
|
|
||||||
{
|
|
||||||
self::assertEquals(
|
|
||||||
null,
|
|
||||||
$this->subject->getRegion()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function setRegionForRegionSetsRegion()
|
|
||||||
{
|
|
||||||
$regionFixture = new \Wrm\Events\Domain\Model\Region();
|
|
||||||
$this->subject->setRegion($regionFixture);
|
|
||||||
|
|
||||||
self::assertAttributeEquals(
|
|
||||||
$regionFixture,
|
|
||||||
'region',
|
|
||||||
$this->subject
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,613 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace Wrm\Events\Tests\Unit\Domain\Model;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Test case.
|
|
||||||
*
|
|
||||||
* @author Dirk Koritnik <koritnik@werkraum-media.de>
|
|
||||||
*/
|
|
||||||
class EventsTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* @var \Wrm\Events\Domain\Model\Events
|
|
||||||
*/
|
|
||||||
protected $subject = null;
|
|
||||||
|
|
||||||
protected function setUp(): void
|
|
||||||
{
|
|
||||||
parent::setUp();
|
|
||||||
$this->subject = new \Wrm\Events\Domain\Model\Events();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function getGlobalIdReturnsInitialValueForString()
|
|
||||||
{
|
|
||||||
self::assertSame(
|
|
||||||
'',
|
|
||||||
$this->subject->getGlobalId()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function setGlobalIdForStringSetsGlobalId()
|
|
||||||
{
|
|
||||||
$this->subject->setGlobalId('Conceived at T3CON10');
|
|
||||||
|
|
||||||
self::assertAttributeEquals(
|
|
||||||
'Conceived at T3CON10',
|
|
||||||
'globalId',
|
|
||||||
$this->subject
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function getTitleReturnsInitialValueForString()
|
|
||||||
{
|
|
||||||
self::assertSame(
|
|
||||||
'',
|
|
||||||
$this->subject->getTitle()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function setTitleForStringSetsTitle()
|
|
||||||
{
|
|
||||||
$this->subject->setTitle('Conceived at T3CON10');
|
|
||||||
|
|
||||||
self::assertAttributeEquals(
|
|
||||||
'Conceived at T3CON10',
|
|
||||||
'title',
|
|
||||||
$this->subject
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function getTeaserReturnsInitialValueForString()
|
|
||||||
{
|
|
||||||
self::assertSame(
|
|
||||||
'',
|
|
||||||
$this->subject->getTeaser()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function setTeaserForStringSetsTeaser()
|
|
||||||
{
|
|
||||||
$this->subject->setTeaser('Conceived at T3CON10');
|
|
||||||
|
|
||||||
self::assertAttributeEquals(
|
|
||||||
'Conceived at T3CON10',
|
|
||||||
'teaser',
|
|
||||||
$this->subject
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function getDetailsReturnsInitialValueForString()
|
|
||||||
{
|
|
||||||
self::assertSame(
|
|
||||||
'',
|
|
||||||
$this->subject->getDetails()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function setDetailsForStringSetsDetails()
|
|
||||||
{
|
|
||||||
$this->subject->setDetails('Conceived at T3CON10');
|
|
||||||
|
|
||||||
self::assertAttributeEquals(
|
|
||||||
'Conceived at T3CON10',
|
|
||||||
'details',
|
|
||||||
$this->subject
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function getPriceInfoReturnsInitialValueForString()
|
|
||||||
{
|
|
||||||
self::assertSame(
|
|
||||||
'',
|
|
||||||
$this->subject->getPriceInfo()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function setPriceInfoForStringSetsPriceInfo()
|
|
||||||
{
|
|
||||||
$this->subject->setPriceInfo('Conceived at T3CON10');
|
|
||||||
|
|
||||||
self::assertAttributeEquals(
|
|
||||||
'Conceived at T3CON10',
|
|
||||||
'priceInfo',
|
|
||||||
$this->subject
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function getStreetReturnsInitialValueForString()
|
|
||||||
{
|
|
||||||
self::assertSame(
|
|
||||||
'',
|
|
||||||
$this->subject->getStreet()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function setStreetForStringSetsStreet()
|
|
||||||
{
|
|
||||||
$this->subject->setStreet('Conceived at T3CON10');
|
|
||||||
|
|
||||||
self::assertAttributeEquals(
|
|
||||||
'Conceived at T3CON10',
|
|
||||||
'street',
|
|
||||||
$this->subject
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function getDistrictReturnsInitialValueForString()
|
|
||||||
{
|
|
||||||
self::assertSame(
|
|
||||||
'',
|
|
||||||
$this->subject->getDistrict()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function setDistrictForStringSetsDistrict()
|
|
||||||
{
|
|
||||||
$this->subject->setDistrict('Conceived at T3CON10');
|
|
||||||
|
|
||||||
self::assertAttributeEquals(
|
|
||||||
'Conceived at T3CON10',
|
|
||||||
'district',
|
|
||||||
$this->subject
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function getCityReturnsInitialValueForString()
|
|
||||||
{
|
|
||||||
self::assertSame(
|
|
||||||
'',
|
|
||||||
$this->subject->getCity()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function setCityForStringSetsCity()
|
|
||||||
{
|
|
||||||
$this->subject->setCity('Conceived at T3CON10');
|
|
||||||
|
|
||||||
self::assertAttributeEquals(
|
|
||||||
'Conceived at T3CON10',
|
|
||||||
'city',
|
|
||||||
$this->subject
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function getZipReturnsInitialValueForString()
|
|
||||||
{
|
|
||||||
self::assertSame(
|
|
||||||
'',
|
|
||||||
$this->subject->getZip()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function setZipForStringSetsZip()
|
|
||||||
{
|
|
||||||
$this->subject->setZip('Conceived at T3CON10');
|
|
||||||
|
|
||||||
self::assertAttributeEquals(
|
|
||||||
'Conceived at T3CON10',
|
|
||||||
'zip',
|
|
||||||
$this->subject
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function getWebReturnsInitialValueForString()
|
|
||||||
{
|
|
||||||
self::assertSame(
|
|
||||||
'',
|
|
||||||
$this->subject->getWeb()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function setWebForStringSetsWeb()
|
|
||||||
{
|
|
||||||
$this->subject->setWeb('Conceived at T3CON10');
|
|
||||||
|
|
||||||
self::assertAttributeEquals(
|
|
||||||
'Conceived at T3CON10',
|
|
||||||
'web',
|
|
||||||
$this->subject
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function getBookingReturnsInitialValueForString()
|
|
||||||
{
|
|
||||||
self::assertSame(
|
|
||||||
'',
|
|
||||||
$this->subject->getBooking()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function setBookingForStringSetsBooking()
|
|
||||||
{
|
|
||||||
$this->subject->setBooking('Conceived at T3CON10');
|
|
||||||
|
|
||||||
self::assertAttributeEquals(
|
|
||||||
'Conceived at T3CON10',
|
|
||||||
'booking',
|
|
||||||
$this->subject
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function getTicketReturnsInitialValueForString()
|
|
||||||
{
|
|
||||||
self::assertSame(
|
|
||||||
'',
|
|
||||||
$this->subject->getTicket()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function setTicketForStringSetsTicket()
|
|
||||||
{
|
|
||||||
$this->subject->setTicket('Conceived at T3CON10');
|
|
||||||
|
|
||||||
self::assertAttributeEquals(
|
|
||||||
'Conceived at T3CON10',
|
|
||||||
'ticket',
|
|
||||||
$this->subject
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function getFacebookReturnsInitialValueForString()
|
|
||||||
{
|
|
||||||
self::assertSame(
|
|
||||||
'',
|
|
||||||
$this->subject->getFacebook()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function setFacebookForStringSetsFacebook()
|
|
||||||
{
|
|
||||||
$this->subject->setFacebook('Conceived at T3CON10');
|
|
||||||
|
|
||||||
self::assertAttributeEquals(
|
|
||||||
'Conceived at T3CON10',
|
|
||||||
'facebook',
|
|
||||||
$this->subject
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function getYoutubeReturnsInitialValueForString()
|
|
||||||
{
|
|
||||||
self::assertSame(
|
|
||||||
'',
|
|
||||||
$this->subject->getYoutube()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function setYoutubeForStringSetsYoutube()
|
|
||||||
{
|
|
||||||
$this->subject->setYoutube('Conceived at T3CON10');
|
|
||||||
|
|
||||||
self::assertAttributeEquals(
|
|
||||||
'Conceived at T3CON10',
|
|
||||||
'youtube',
|
|
||||||
$this->subject
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function getLatitudeReturnsInitialValueForString()
|
|
||||||
{
|
|
||||||
self::assertSame(
|
|
||||||
'',
|
|
||||||
$this->subject->getLatitude()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function setLatitudeForStringSetsLatitude()
|
|
||||||
{
|
|
||||||
$this->subject->setLatitude('Conceived at T3CON10');
|
|
||||||
|
|
||||||
self::assertAttributeEquals(
|
|
||||||
'Conceived at T3CON10',
|
|
||||||
'latitude',
|
|
||||||
$this->subject
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function getLongitudeReturnsInitialValueForString()
|
|
||||||
{
|
|
||||||
self::assertSame(
|
|
||||||
'',
|
|
||||||
$this->subject->getLongitude()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function setLongitudeForStringSetsLongitude()
|
|
||||||
{
|
|
||||||
$this->subject->setLongitude('Conceived at T3CON10');
|
|
||||||
|
|
||||||
self::assertAttributeEquals(
|
|
||||||
'Conceived at T3CON10',
|
|
||||||
'longitude',
|
|
||||||
$this->subject
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function getImagesReturnsInitialValueForFileReference()
|
|
||||||
{
|
|
||||||
self::assertEquals(
|
|
||||||
null,
|
|
||||||
$this->subject->getImages()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function setImagesForFileReferenceSetsImages()
|
|
||||||
{
|
|
||||||
$fileReferenceFixture = new \TYPO3\CMS\Extbase\Domain\Model\FileReference();
|
|
||||||
$this->subject->setImages($fileReferenceFixture);
|
|
||||||
|
|
||||||
self::assertAttributeEquals(
|
|
||||||
$fileReferenceFixture,
|
|
||||||
'images',
|
|
||||||
$this->subject
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function getSlugReturnsInitialValueForString()
|
|
||||||
{
|
|
||||||
self::assertSame(
|
|
||||||
'',
|
|
||||||
$this->subject->getSlug()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function setSlugForStringSetsSlug()
|
|
||||||
{
|
|
||||||
$this->subject->setSlug('Conceived at T3CON10');
|
|
||||||
|
|
||||||
self::assertAttributeEquals(
|
|
||||||
'Conceived at T3CON10',
|
|
||||||
'slug',
|
|
||||||
$this->subject
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function getOrganizerReturnsInitialValueFor()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function setOrganizerForSetsOrganizer()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function getDateReturnsInitialValueFor()
|
|
||||||
{
|
|
||||||
$newObjectStorage = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
|
|
||||||
self::assertEquals(
|
|
||||||
$newObjectStorage,
|
|
||||||
$this->subject->getDate()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function setDateForObjectStorageContainingSetsDate()
|
|
||||||
{
|
|
||||||
// $date = new ();
|
|
||||||
$objectStorageHoldingExactlyOneDate = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
|
|
||||||
$objectStorageHoldingExactlyOneDate->attach($date);
|
|
||||||
$this->subject->setDate($objectStorageHoldingExactlyOneDate);
|
|
||||||
|
|
||||||
self::assertAttributeEquals(
|
|
||||||
$objectStorageHoldingExactlyOneDate,
|
|
||||||
'date',
|
|
||||||
$this->subject
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function addDateToObjectStorageHoldingDate()
|
|
||||||
{
|
|
||||||
// $date = new ();
|
|
||||||
$dateObjectStorageMock = $this->getMockBuilder(\TYPO3\CMS\Extbase\Persistence\ObjectStorage::class)
|
|
||||||
->setMethods(['attach'])
|
|
||||||
->disableOriginalConstructor()
|
|
||||||
->getMock();
|
|
||||||
|
|
||||||
$dateObjectStorageMock->expects(self::once())->method('attach')->with(self::equalTo($date));
|
|
||||||
$this->inject($this->subject, 'date', $dateObjectStorageMock);
|
|
||||||
|
|
||||||
$this->subject->addDate($date);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function removeDateFromObjectStorageHoldingDate()
|
|
||||||
{
|
|
||||||
// $date = new ();
|
|
||||||
$dateObjectStorageMock = $this->getMockBuilder(\TYPO3\CMS\Extbase\Persistence\ObjectStorage::class)
|
|
||||||
->setMethods(['detach'])
|
|
||||||
->disableOriginalConstructor()
|
|
||||||
->getMock();
|
|
||||||
|
|
||||||
$dateObjectStorageMock->expects(self::once())->method('detach')->with(self::equalTo($date));
|
|
||||||
$this->inject($this->subject, 'date', $dateObjectStorageMock);
|
|
||||||
|
|
||||||
$this->subject->removeDate($date);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function getRegionReturnsInitialValueFor()
|
|
||||||
{
|
|
||||||
$newObjectStorage = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
|
|
||||||
self::assertEquals(
|
|
||||||
$newObjectStorage,
|
|
||||||
$this->subject->getRegion()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function setRegionForObjectStorageContainingSetsRegion()
|
|
||||||
{
|
|
||||||
// $region = new ();
|
|
||||||
$objectStorageHoldingExactlyOneRegion = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
|
|
||||||
$objectStorageHoldingExactlyOneRegion->attach($region);
|
|
||||||
$this->subject->setRegion($objectStorageHoldingExactlyOneRegion);
|
|
||||||
|
|
||||||
self::assertAttributeEquals(
|
|
||||||
$objectStorageHoldingExactlyOneRegion,
|
|
||||||
'region',
|
|
||||||
$this->subject
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function addRegionToObjectStorageHoldingRegion()
|
|
||||||
{
|
|
||||||
// $region = new ();
|
|
||||||
$regionObjectStorageMock = $this->getMockBuilder(\TYPO3\CMS\Extbase\Persistence\ObjectStorage::class)
|
|
||||||
->setMethods(['attach'])
|
|
||||||
->disableOriginalConstructor()
|
|
||||||
->getMock();
|
|
||||||
|
|
||||||
$regionObjectStorageMock->expects(self::once())->method('attach')->with(self::equalTo($region));
|
|
||||||
$this->inject($this->subject, 'region', $regionObjectStorageMock);
|
|
||||||
|
|
||||||
$this->subject->addRegion($region);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function removeRegionFromObjectStorageHoldingRegion()
|
|
||||||
{
|
|
||||||
// $region = new ();
|
|
||||||
$regionObjectStorageMock = $this->getMockBuilder(\TYPO3\CMS\Extbase\Persistence\ObjectStorage::class)
|
|
||||||
->setMethods(['detach'])
|
|
||||||
->disableOriginalConstructor()
|
|
||||||
->getMock();
|
|
||||||
|
|
||||||
$regionObjectStorageMock->expects(self::once())->method('detach')->with(self::equalTo($region));
|
|
||||||
$this->inject($this->subject, 'region', $regionObjectStorageMock);
|
|
||||||
|
|
||||||
$this->subject->removeRegion($region);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,222 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace Wrm\Events\Tests\Unit\Domain\Model;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Test case.
|
|
||||||
*
|
|
||||||
* @author Dirk Koritnik <koritnik@werkraum-media.de>
|
|
||||||
*/
|
|
||||||
class OrganizerTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* @var \Wrm\Events\Domain\Model\Organizer
|
|
||||||
*/
|
|
||||||
protected $subject = null;
|
|
||||||
|
|
||||||
protected function setUp(): void
|
|
||||||
{
|
|
||||||
parent::setUp();
|
|
||||||
$this->subject = new \Wrm\Events\Domain\Model\Organizer();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function getNameReturnsInitialValueForString()
|
|
||||||
{
|
|
||||||
self::assertSame(
|
|
||||||
'',
|
|
||||||
$this->subject->getName()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function setNameForStringSetsName()
|
|
||||||
{
|
|
||||||
$this->subject->setName('Conceived at T3CON10');
|
|
||||||
|
|
||||||
self::assertAttributeEquals(
|
|
||||||
'Conceived at T3CON10',
|
|
||||||
'name',
|
|
||||||
$this->subject
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function getStreetReturnsInitialValueForString()
|
|
||||||
{
|
|
||||||
self::assertSame(
|
|
||||||
'',
|
|
||||||
$this->subject->getStreet()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function setStreetForStringSetsStreet()
|
|
||||||
{
|
|
||||||
$this->subject->setStreet('Conceived at T3CON10');
|
|
||||||
|
|
||||||
self::assertAttributeEquals(
|
|
||||||
'Conceived at T3CON10',
|
|
||||||
'street',
|
|
||||||
$this->subject
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function getDistrictReturnsInitialValueForString()
|
|
||||||
{
|
|
||||||
self::assertSame(
|
|
||||||
'',
|
|
||||||
$this->subject->getDistrict()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function setDistrictForStringSetsDistrict()
|
|
||||||
{
|
|
||||||
$this->subject->setDistrict('Conceived at T3CON10');
|
|
||||||
|
|
||||||
self::assertAttributeEquals(
|
|
||||||
'Conceived at T3CON10',
|
|
||||||
'district',
|
|
||||||
$this->subject
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function getCityReturnsInitialValueForString()
|
|
||||||
{
|
|
||||||
self::assertSame(
|
|
||||||
'',
|
|
||||||
$this->subject->getCity()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function setCityForStringSetsCity()
|
|
||||||
{
|
|
||||||
$this->subject->setCity('Conceived at T3CON10');
|
|
||||||
|
|
||||||
self::assertAttributeEquals(
|
|
||||||
'Conceived at T3CON10',
|
|
||||||
'city',
|
|
||||||
$this->subject
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function getZipReturnsInitialValueForString()
|
|
||||||
{
|
|
||||||
self::assertSame(
|
|
||||||
'',
|
|
||||||
$this->subject->getZip()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function setZipForStringSetsZip()
|
|
||||||
{
|
|
||||||
$this->subject->setZip('Conceived at T3CON10');
|
|
||||||
|
|
||||||
self::assertAttributeEquals(
|
|
||||||
'Conceived at T3CON10',
|
|
||||||
'zip',
|
|
||||||
$this->subject
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function getPhoneReturnsInitialValueForString()
|
|
||||||
{
|
|
||||||
self::assertSame(
|
|
||||||
'',
|
|
||||||
$this->subject->getPhone()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function setPhoneForStringSetsPhone()
|
|
||||||
{
|
|
||||||
$this->subject->setPhone('Conceived at T3CON10');
|
|
||||||
|
|
||||||
self::assertAttributeEquals(
|
|
||||||
'Conceived at T3CON10',
|
|
||||||
'phone',
|
|
||||||
$this->subject
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function getWebReturnsInitialValueForString()
|
|
||||||
{
|
|
||||||
self::assertSame(
|
|
||||||
'',
|
|
||||||
$this->subject->getWeb()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function setWebForStringSetsWeb()
|
|
||||||
{
|
|
||||||
$this->subject->setWeb('Conceived at T3CON10');
|
|
||||||
|
|
||||||
self::assertAttributeEquals(
|
|
||||||
'Conceived at T3CON10',
|
|
||||||
'web',
|
|
||||||
$this->subject
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function getEmailReturnsInitialValueForString()
|
|
||||||
{
|
|
||||||
self::assertSame(
|
|
||||||
'',
|
|
||||||
$this->subject->getEmail()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function setEmailForStringSetsEmail()
|
|
||||||
{
|
|
||||||
$this->subject->setEmail('Conceived at T3CON10');
|
|
||||||
|
|
||||||
self::assertAttributeEquals(
|
|
||||||
'Conceived at T3CON10',
|
|
||||||
'email',
|
|
||||||
$this->subject
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,47 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace Wrm\Events\Tests\Unit\Domain\Model;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Test case.
|
|
||||||
*
|
|
||||||
* @author Dirk Koritnik <koritnik@werkraum-media.de>
|
|
||||||
*/
|
|
||||||
class RegionTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* @var \Wrm\Events\Domain\Model\Region
|
|
||||||
*/
|
|
||||||
protected $subject = null;
|
|
||||||
|
|
||||||
protected function setUp(): void
|
|
||||||
{
|
|
||||||
parent::setUp();
|
|
||||||
$this->subject = new \Wrm\Events\Domain\Model\Region();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function getTitleReturnsInitialValueForString()
|
|
||||||
{
|
|
||||||
self::assertSame(
|
|
||||||
'',
|
|
||||||
$this->subject->getTitle()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @test
|
|
||||||
*/
|
|
||||||
public function setTitleForStringSetsTitle()
|
|
||||||
{
|
|
||||||
$this->subject->setTitle('Conceived at T3CON10');
|
|
||||||
|
|
||||||
self::assertAttributeEquals(
|
|
||||||
'Conceived at T3CON10',
|
|
||||||
'title',
|
|
||||||
$this->subject
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,6 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "wrm/events",
|
"name": "wrm/events",
|
||||||
"type": "typo3-cms-extension",
|
"type": "typo3-cms-extension",
|
||||||
|
"license": "GPL-2.0-or-later",
|
||||||
"description": "Extension to manage Destination Data managed events",
|
"description": "Extension to manage Destination Data managed events",
|
||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
|
@ -25,12 +26,13 @@
|
||||||
},
|
},
|
||||||
"extra": {
|
"extra": {
|
||||||
"typo3/cms": {
|
"typo3/cms": {
|
||||||
"extension-key": "events"
|
"cms-package-dir": "{$vendor-dir}/typo3/cms",
|
||||||
|
"extension-key": "events",
|
||||||
|
"web-dir": ".Build/web"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"squizlabs/php_codesniffer": "^3.5",
|
"squizlabs/php_codesniffer": "^3.5",
|
||||||
"phpunit/phpunit": "^9.0",
|
"symplify/easy-coding-standard": "^9.4"
|
||||||
"typo3/testing-framework": "^6.6"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
20
ecs.php
Normal file
20
ecs.php
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||||
|
use Symplify\EasyCodingStandard\ValueObject\Option;
|
||||||
|
use Symplify\EasyCodingStandard\ValueObject\Set\SetList;
|
||||||
|
|
||||||
|
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||||
|
$containerConfigurator->import(SetList::PSR_12);
|
||||||
|
|
||||||
|
$parameters = $containerConfigurator->parameters();
|
||||||
|
|
||||||
|
$parameters->set(Option::PATHS, [
|
||||||
|
__DIR__ . '/Classes',
|
||||||
|
__DIR__ . '/Configuration',
|
||||||
|
__DIR__ . '/ecs.php',
|
||||||
|
__DIR__ . '/ext_emconf.php',
|
||||||
|
__DIR__ . '/ext_localconf.php',
|
||||||
|
__DIR__ . '/ext_tables.php',
|
||||||
|
]);
|
||||||
|
};
|
|
@ -4,7 +4,6 @@ defined('TYPO3') || die('Access denied.');
|
||||||
|
|
||||||
call_user_func(
|
call_user_func(
|
||||||
function () {
|
function () {
|
||||||
|
|
||||||
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile('events', 'Configuration/TypoScript', 'Events');
|
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile('events', 'Configuration/TypoScript', 'Events');
|
||||||
|
|
||||||
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr('tx_events_domain_model_event', 'EXT:events/Resources/Private/Language/locallang_csh_tx_events_domain_model_event.xlf');
|
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr('tx_events_domain_model_event', 'EXT:events/Resources/Private/Language/locallang_csh_tx_events_domain_model_event.xlf');
|
||||||
|
|
|
@ -1,26 +0,0 @@
|
||||||
<?xml version="1.0"?>
|
|
||||||
<ruleset name="project">
|
|
||||||
<description>This project coding standard</description>
|
|
||||||
|
|
||||||
<file>Classes/</file>
|
|
||||||
<file>Tests/</file>
|
|
||||||
<file>ext_localconf.php</file>
|
|
||||||
<file>ext_tables.php</file>
|
|
||||||
|
|
||||||
<!-- Set default settings -->
|
|
||||||
<arg value="sp"/>
|
|
||||||
<arg name="colors"/>
|
|
||||||
<arg name="encoding" value="utf-8" />
|
|
||||||
<arg name="extensions" value="php" />
|
|
||||||
|
|
||||||
<!-- Base rules -->
|
|
||||||
<rule ref="PSR12">
|
|
||||||
<!-- Ignore some rules for now. -->
|
|
||||||
<!-- Otherwise we would need some more adjustments to the code. -->
|
|
||||||
<!-- We can clean these rules up in the future -->
|
|
||||||
<exclude name="Generic.Files.LineLength.TooLong" />
|
|
||||||
<exclude name="PSR1.Methods.CamelCapsMethodName.NotCamelCaps" />
|
|
||||||
<exclude name="PSR12.Properties.ConstantVisibility.NotFound" />
|
|
||||||
<exclude name="PSR2.Classes.PropertyDeclaration.Underscore" />
|
|
||||||
</rule>
|
|
||||||
</ruleset>
|
|
Loading…
Reference in a new issue