mirror of
https://github.com/werkraum-media/events.git
synced 2024-11-22 03:16:11 +01:00
Merge branch 'feature/add-ci' into 'master'
Support canceled attribute during import of destination data See merge request typo3/events!11
This commit is contained in:
commit
b8b11f3e19
49 changed files with 287 additions and 2075 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1,3 +1,3 @@
|
|||
/composer.lock
|
||||
/public/
|
||||
/.Build/
|
||||
/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
|
||||
{
|
||||
|
||||
public function configure()
|
||||
{
|
||||
$this->setDescription('Import Destination Data Events');
|
||||
|
|
|
@ -18,7 +18,6 @@ use Wrm\Events\Service\DataProcessingForModels;
|
|||
*/
|
||||
class DateController extends AbstractController
|
||||
{
|
||||
|
||||
/**
|
||||
* @var dateRepository
|
||||
*/
|
||||
|
|
|
@ -9,7 +9,6 @@ use TYPO3\CMS\Extbase\DomainObject\AbstractEntity;
|
|||
*/
|
||||
class Date extends AbstractEntity
|
||||
{
|
||||
|
||||
/**
|
||||
* @var \DateTime
|
||||
*/
|
||||
|
|
|
@ -6,7 +6,6 @@ use TYPO3\CMS\Core\Utility\GeneralUtility;
|
|||
|
||||
class DateDemand
|
||||
{
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
|
|
|
@ -4,7 +4,6 @@ namespace Wrm\Events\Domain\Model\Dto;
|
|||
|
||||
class EventDemand
|
||||
{
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
namespace Wrm\Events\Domain\Model;
|
||||
|
||||
use TYPO3\CMS\Extbase\Annotation as Extbase;
|
||||
use TYPO3\CMS\Extbase\DomainObject\AbstractEntity;
|
||||
use TYPO3\CMS\Extbase\Domain\Model\FileReference;
|
||||
use TYPO3\CMS\Extbase\DomainObject\AbstractEntity;
|
||||
use TYPO3\CMS\Extbase\Object\ObjectManager;
|
||||
use TYPO3\CMS\Extbase\Persistence\ObjectStorage;
|
||||
use Wrm\Events\Domain\Repository\DateRepository;
|
||||
|
@ -15,7 +15,6 @@ use Wrm\Events\Service\DataProcessingForModels;
|
|||
*/
|
||||
class Event extends AbstractEntity
|
||||
{
|
||||
|
||||
/**
|
||||
* title
|
||||
*
|
||||
|
|
|
@ -20,7 +20,6 @@ use TYPO3\CMS\Extbase\DomainObject\AbstractEntity;
|
|||
*/
|
||||
class Organizer extends AbstractEntity
|
||||
{
|
||||
|
||||
/**
|
||||
* name
|
||||
*
|
||||
|
|
|
@ -21,8 +21,8 @@ namespace Wrm\Events\Domain\Model;
|
|||
* 02110-1301, USA.
|
||||
*/
|
||||
|
||||
use TYPO3\CMS\Extbase\DomainObject\AbstractEntity;
|
||||
use TYPO3\CMS\Extbase\Domain\Model\FileReference;
|
||||
use TYPO3\CMS\Extbase\DomainObject\AbstractEntity;
|
||||
use TYPO3\CMS\Extbase\Persistence\ObjectStorage;
|
||||
|
||||
class Partner extends AbstractEntity
|
||||
|
|
|
@ -20,7 +20,6 @@ use TYPO3\CMS\Extbase\DomainObject\AbstractEntity;
|
|||
*/
|
||||
class Region extends AbstractEntity
|
||||
{
|
||||
|
||||
/**
|
||||
* title
|
||||
*
|
||||
|
|
|
@ -13,7 +13,6 @@ use Wrm\Events\Service\CategoryService;
|
|||
|
||||
class DateRepository extends Repository
|
||||
{
|
||||
|
||||
/**
|
||||
* Find all dates based on selected uids
|
||||
* @param string $uids
|
||||
|
@ -164,7 +163,6 @@ class DateRepository extends Repository
|
|||
*/
|
||||
public function findSearchWord($search)
|
||||
{
|
||||
|
||||
$connection = GeneralUtility::makeInstance(ConnectionPool::class)
|
||||
->getConnectionForTable('tx_events_domain_model_date');
|
||||
|
||||
|
|
|
@ -19,5 +19,4 @@ use TYPO3\CMS\Extbase\Persistence\Repository;
|
|||
|
||||
class OrganizerRepository extends Repository
|
||||
{
|
||||
|
||||
}
|
||||
|
|
|
@ -19,5 +19,4 @@ use TYPO3\CMS\Extbase\Persistence\Repository;
|
|||
|
||||
class RegionRepository extends Repository
|
||||
{
|
||||
|
||||
}
|
||||
|
|
|
@ -11,7 +11,6 @@ use TYPO3\CMS\Core\Utility\GeneralUtility;
|
|||
|
||||
class CategoryService
|
||||
{
|
||||
|
||||
/** @var TimeTracker */
|
||||
protected $timeTracker;
|
||||
|
||||
|
|
|
@ -28,9 +28,9 @@ use TYPO3\CMS\Core\Utility\GeneralUtility;
|
|||
|
||||
class Database
|
||||
{
|
||||
const DATE_TABLE = 'tx_events_domain_model_date';
|
||||
const EVENT_TABLE = 'tx_events_domain_model_event';
|
||||
const ORGANIZER_TABLE = 'tx_events_domain_model_organizer';
|
||||
public const DATE_TABLE = 'tx_events_domain_model_date';
|
||||
public const EVENT_TABLE = 'tx_events_domain_model_event';
|
||||
public const ORGANIZER_TABLE = 'tx_events_domain_model_organizer';
|
||||
|
||||
public function truncateTables(string ...$tableNames): void
|
||||
{
|
||||
|
|
|
@ -63,7 +63,7 @@ class Files
|
|||
$uidsToRemove[] = $fileToDelete['uid'];
|
||||
}
|
||||
|
||||
$this->deleteFromDb(... $uidsToRemove);
|
||||
$this->deleteFromDb(...$uidsToRemove);
|
||||
}
|
||||
|
||||
private function getFilesFromDb(callable $whereGenerator = null): array
|
||||
|
|
|
@ -27,14 +27,14 @@ class CleanupService
|
|||
|
||||
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->files->deleteAll();
|
||||
}
|
||||
|
||||
public function deletePastData()
|
||||
{
|
||||
$this->database->deleteDates(... $this->database->getPastDates());
|
||||
$this->database->deleteDates(...$this->database->getPastDates());
|
||||
$this->removeViaDataHandler($this->database->getDeletionStructureForEventsWithoutDates());
|
||||
$this->files->deleteDangling();
|
||||
}
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
namespace Wrm\Events\Service;
|
||||
|
||||
use TYPO3\CMS\Core\Core\Environment;
|
||||
use TYPO3\CMS\Core\Database\ConnectionPool;
|
||||
use TYPO3\CMS\Core\DataHandling\DataHandler;
|
||||
use TYPO3\CMS\Core\DataHandling\SlugHelper;
|
||||
use TYPO3\CMS\Core\Database\ConnectionPool;
|
||||
use TYPO3\CMS\Core\Log\LogManager;
|
||||
use TYPO3\CMS\Core\Resource\Exception\FolderDoesNotExistException;
|
||||
use TYPO3\CMS\Core\Resource\FileRepository;
|
||||
|
@ -29,7 +29,6 @@ use Wrm\Events\Domain\Repository\RegionRepository;
|
|||
|
||||
class DestinationDataImportService
|
||||
{
|
||||
|
||||
/**
|
||||
* @var
|
||||
*/
|
||||
|
@ -172,18 +171,18 @@ class DestinationDataImportService
|
|||
ObjectManager $objectManager,
|
||||
Environment $environment
|
||||
) {
|
||||
$this->eventRepository = $eventRepository;
|
||||
$this->regionRepository = $regionRepository;
|
||||
$this->organizerRepository = $organizerRepository;
|
||||
$this->dateRepository = $dateRepository;
|
||||
$this->sysCategoriesRepository = $sysCategoriesRepository;
|
||||
$this->fileRepository = $fileRepository;
|
||||
$this->metaDataRepository = $metaDataRepository;
|
||||
$this->configurationManager = $configurationManager;
|
||||
$this->persistenceManager = $persistenceManager;
|
||||
$this->resourceFactory = $resourceFactory;
|
||||
$this->objectManager = $objectManager;
|
||||
$this->environment = $environment;
|
||||
$this->eventRepository = $eventRepository;
|
||||
$this->regionRepository = $regionRepository;
|
||||
$this->organizerRepository = $organizerRepository;
|
||||
$this->dateRepository = $dateRepository;
|
||||
$this->sysCategoriesRepository = $sysCategoriesRepository;
|
||||
$this->fileRepository = $fileRepository;
|
||||
$this->metaDataRepository = $metaDataRepository;
|
||||
$this->configurationManager = $configurationManager;
|
||||
$this->persistenceManager = $persistenceManager;
|
||||
$this->resourceFactory = $resourceFactory;
|
||||
$this->objectManager = $objectManager;
|
||||
$this->environment = $environment;
|
||||
|
||||
// Get Typoscript Settings
|
||||
$this->settings = $this->configurationManager->getConfiguration(
|
||||
|
@ -193,13 +192,13 @@ class DestinationDataImportService
|
|||
);
|
||||
|
||||
// Set properties
|
||||
$this->restUrl = $this->settings['destinationData']['restUrl'];
|
||||
$this->restLicenseKey = $this->settings['destinationData']['license'];
|
||||
$this->restType = $this->settings['destinationData']['restType'];
|
||||
$this->restLimit = $this->settings['destinationData']['restLimit'];
|
||||
$this->restMode = $this->settings['destinationData']['restMode'];
|
||||
$this->restTemplate = $this->settings['destinationData']['restTemplate'];
|
||||
$this->sysCategoriesPid = $this->settings['destinationData']['categoriesPid'];
|
||||
$this->restUrl = $this->settings['destinationData']['restUrl'];
|
||||
$this->restLicenseKey = $this->settings['destinationData']['license'];
|
||||
$this->restType = $this->settings['destinationData']['restType'];
|
||||
$this->restLimit = $this->settings['destinationData']['restLimit'];
|
||||
$this->restMode = $this->settings['destinationData']['restMode'];
|
||||
$this->restTemplate = $this->settings['destinationData']['restTemplate'];
|
||||
$this->sysCategoriesPid = $this->settings['destinationData']['categoriesPid'];
|
||||
$this->categoryParentUid = $this->settings['destinationData']['categoryParentUid'];
|
||||
}
|
||||
|
||||
|
@ -211,7 +210,6 @@ class DestinationDataImportService
|
|||
*/
|
||||
public function import($restExperience, $storagePid, $regionUid, $filesFolder)
|
||||
{
|
||||
|
||||
$this->restExperience = $restExperience;
|
||||
$this->storagePid = $storagePid;
|
||||
$this->regionUid = $regionUid;
|
||||
|
@ -252,7 +250,6 @@ class DestinationDataImportService
|
|||
*/
|
||||
public function processData($data)
|
||||
{
|
||||
|
||||
$this->logger->info('Processing json ' . count($data['items']));
|
||||
|
||||
// Get selected region
|
||||
|
@ -546,7 +543,6 @@ class DestinationDataImportService
|
|||
*/
|
||||
protected function multi_array_key_exists($needle, $haystack)
|
||||
{
|
||||
|
||||
foreach ($haystack as $key => $value) {
|
||||
if ($needle == $key) {
|
||||
return true;
|
||||
|
@ -596,7 +592,6 @@ class DestinationDataImportService
|
|||
*/
|
||||
protected function getOrCreateEvent(string $globalId, string $title)
|
||||
{
|
||||
|
||||
$event = $this->eventRepository->findOneByGlobalId($globalId);
|
||||
|
||||
if ($event) {
|
||||
|
@ -614,7 +609,7 @@ class DestinationDataImportService
|
|||
$event->setCategories(new ObjectStorage());
|
||||
$this->eventRepository->add($event);
|
||||
$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;
|
||||
}
|
||||
|
||||
|
@ -623,7 +618,6 @@ class DestinationDataImportService
|
|||
*/
|
||||
protected function setAssets(array $assets)
|
||||
{
|
||||
|
||||
$this->logger->info("Set assets");
|
||||
|
||||
$error = false;
|
||||
|
@ -673,7 +667,7 @@ class DestinationDataImportService
|
|||
if ($error !== true) {
|
||||
if ($this->tmpCurrentEvent->getImages()->count() > 0) {
|
||||
$this->logger->info('Relation found');
|
||||
// TODO: How to delete file references?
|
||||
// TODO: How to delete file references?
|
||||
} else {
|
||||
$this->logger->info('No relation found');
|
||||
$file = $this->storage->getFile($this->filesFolder . $orgFileNameSanitized);
|
||||
|
@ -716,7 +710,6 @@ class DestinationDataImportService
|
|||
*/
|
||||
protected function createFileRelations($uid_local, $tablenames, $uid_foreign, $fieldname, $storagePid)
|
||||
{
|
||||
|
||||
$newId = 'NEW1234';
|
||||
|
||||
$data = array();
|
||||
|
|
|
@ -68,5 +68,4 @@ call_user_func(function () {
|
|||
'events_selected',
|
||||
'FILE:EXT:events/Configuration/FlexForms/Selected.xml'
|
||||
);
|
||||
|
||||
});
|
||||
|
|
|
@ -210,7 +210,7 @@ return [
|
|||
'size' => 1,
|
||||
'minitems' => 0,
|
||||
'maxitems' => 1,
|
||||
'readOnly' =>1,
|
||||
'readOnly' => 1,
|
||||
)
|
||||
)
|
||||
],
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'ctrl' => [
|
||||
'title' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_organizer.xlf:tx_events_domain_model_organizer',
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'ctrl' => [
|
||||
'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" ?>
|
||||
<xliff version="1.0">
|
||||
<file source-language="en" datatype="plaintext" original="messages" date="2019-04-03T12:11:11Z" product-name="tx_events">
|
||||
<header/>
|
||||
<body>
|
||||
<trans-unit id="tx_events.searchform">
|
||||
<source>Search form</source>
|
||||
<target>Suchformular</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="tx_events.searchform.searchword">
|
||||
<source>Search word</source>
|
||||
<target>Suchwort</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="tx_events.searchform.date_from">
|
||||
<source>Date from</source>
|
||||
<target>Datum von</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="tx_events.searchform.date_to">
|
||||
<source>Date to</source>
|
||||
<target>Date bis</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="tx_events.searchform.regions">
|
||||
<source>All regions</source>
|
||||
<target>Alle Städte</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="tx_events.searchform.search">
|
||||
<source>Search</source>
|
||||
<target>Suchen</target>
|
||||
</trans-unit>
|
||||
</body>
|
||||
</file>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
|
||||
<file source-language="en" target-language="de" datatype="plaintext" original="messages" date="2021-09-07T09:15:42Z" product-name="Events">
|
||||
<header/>
|
||||
<body>
|
||||
<trans-unit id="tx_events.searchform">
|
||||
<source>Search form</source>
|
||||
<target>Suchformular</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="tx_events.searchform.searchword">
|
||||
<source>Search word</source>
|
||||
<target>Suchwort</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="tx_events.searchform.date_from">
|
||||
<source>Date from</source>
|
||||
<target>Datum von</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="tx_events.searchform.date_to">
|
||||
<source>Date to</source>
|
||||
<target>Date bis</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="tx_events.searchform.regions">
|
||||
<source>All regions</source>
|
||||
<target>Alle Städte</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="tx_events.searchform.search">
|
||||
<source>Search</source>
|
||||
<target>Suchen</target>
|
||||
</trans-unit>
|
||||
</body>
|
||||
</file>
|
||||
</xliff>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
||||
<xliff version="1.0">
|
||||
<file source-language="en" datatype="plaintext" original="messages" date="2019-04-03T12:11:11Z" product-name="tx_events">
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
|
||||
<file source-language="en" target-language="de" datatype="plaintext" original="messages" date="2021-09-07T09:15:42Z" product-name="Events">
|
||||
<header/>
|
||||
<body>
|
||||
<trans-unit id="tx_events_domain_model_date">
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
||||
<xliff version="1.0">
|
||||
<file source-language="en" datatype="plaintext" original="messages" date="2019-04-03T12:11:11Z" product-name="tx_events">
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
|
||||
<file source-language="en" target-language="de" datatype="plaintext" original="messages" date="2021-09-07T09:15:42Z" product-name="Events">
|
||||
<header/>
|
||||
<body>
|
||||
<trans-unit id="tx_events.name">
|
||||
|
|
|
@ -1,44 +1,44 @@
|
|||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
||||
<xliff version="1.0">
|
||||
<file source-language="en" datatype="plaintext" original="messages" date="2019-04-03T12:11:11Z" product-name="tx_events">
|
||||
<header/>
|
||||
<body>
|
||||
<trans-unit id="tx_events_domain_model_organizer">
|
||||
<source>Organizer</source>
|
||||
<target>Organisator</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="tx_events_domain_model_organizer.name">
|
||||
<source>Name</source>
|
||||
<target>Name</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="tx_events_domain_model_organizer.street">
|
||||
<source>Street</source>
|
||||
<target>Straße</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="tx_events_domain_model_organizer.district">
|
||||
<source>District</source>
|
||||
<target>Bundesland</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="tx_events_domain_model_organizer.city">
|
||||
<source>City</source>
|
||||
<target>Stadt</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="tx_events_domain_model_organizer.zip">
|
||||
<source>Zip</source>
|
||||
<target>Postleitzahl</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="tx_events_domain_model_organizer.phone">
|
||||
<source>Phone</source>
|
||||
<target>Telefon</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="tx_events_domain_model_organizer.web">
|
||||
<source>Web</source>
|
||||
<target>Internet</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="tx_events_domain_model_organizer.email">
|
||||
<source>E-Mail</source>
|
||||
<target>E-Mail</target>
|
||||
</trans-unit>
|
||||
</body>
|
||||
</file>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
|
||||
<file source-language="en" target-language="de" datatype="plaintext" original="messages" date="2021-09-07T09:15:42Z" product-name="Events">
|
||||
<header/>
|
||||
<body>
|
||||
<trans-unit id="tx_events_domain_model_organizer">
|
||||
<source>Organizer</source>
|
||||
<target>Organisator</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="tx_events_domain_model_organizer.name">
|
||||
<source>Name</source>
|
||||
<target>Name</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="tx_events_domain_model_organizer.street">
|
||||
<source>Street</source>
|
||||
<target>Straße</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="tx_events_domain_model_organizer.district">
|
||||
<source>District</source>
|
||||
<target>Bundesland</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="tx_events_domain_model_organizer.city">
|
||||
<source>City</source>
|
||||
<target>Stadt</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="tx_events_domain_model_organizer.zip">
|
||||
<source>Zip</source>
|
||||
<target>Postleitzahl</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="tx_events_domain_model_organizer.phone">
|
||||
<source>Phone</source>
|
||||
<target>Telefon</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="tx_events_domain_model_organizer.web">
|
||||
<source>Web</source>
|
||||
<target>Internet</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="tx_events_domain_model_organizer.email">
|
||||
<source>E-Mail</source>
|
||||
<target>E-Mail</target>
|
||||
</trans-unit>
|
||||
</body>
|
||||
</file>
|
||||
</xliff>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
||||
<xliff version="1.0">
|
||||
<file source-language="en" datatype="plaintext" original="messages" date="2019-04-03T12:11:11Z" product-name="tx_events">
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
|
||||
<file source-language="en" target-language="de" datatype="plaintext" original="messages" date="2021-09-07T09:15:42Z" product-name="Events">
|
||||
<header/>
|
||||
<body>
|
||||
<trans-unit id="tx_events_domain_model_partner">
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
||||
<xliff version="1.0">
|
||||
<file source-language="en" datatype="plaintext" original="messages" date="2019-04-03T12:11:11Z" product-name="tx_events">
|
||||
<header/>
|
||||
<body>
|
||||
<trans-unit id="tx_events_domain_model_region">
|
||||
<source>Region</source>
|
||||
<target>Region</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="tx_events_domain_model_region.title">
|
||||
<source>Title</source>
|
||||
<target>Titel</target>
|
||||
</trans-unit>
|
||||
</body>
|
||||
</file>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
|
||||
<file source-language="en" target-language="de" datatype="plaintext" original="messages" date="2021-09-07T09:15:42Z" product-name="Events">
|
||||
<header/>
|
||||
<body>
|
||||
<trans-unit id="tx_events_domain_model_region">
|
||||
<source>Region</source>
|
||||
<target>Region</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="tx_events_domain_model_region.title">
|
||||
<source>Title</source>
|
||||
<target>Titel</target>
|
||||
</trans-unit>
|
||||
</body>
|
||||
</file>
|
||||
</xliff>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
||||
<xliff version="1.0">
|
||||
<file source-language="en" datatype="plaintext" original="messages" date="2019-04-03T12:11:11Z" product-name="tx_events">
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
|
||||
<file source-language="en" target-language="de" datatype="plaintext" original="messages" date="2021-09-07T09:15:42Z" product-name="Events">
|
||||
<header/>
|
||||
<body>
|
||||
<trans-unit id="tx_events.name">
|
||||
|
|
|
@ -1,26 +1,26 @@
|
|||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
||||
<xliff version="1.0">
|
||||
<file source-language="en" datatype="plaintext" original="messages" date="2019-04-03T12:11:11Z" product-name="tx_events">
|
||||
<header/>
|
||||
<body>
|
||||
<trans-unit id="tx_events.searchform">
|
||||
<source>Search form</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="tx_events.searchform.searchword">
|
||||
<source>Search word</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="tx_events.searchform.date_from">
|
||||
<source>Date from</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="tx_events.searchform.date_to">
|
||||
<source>Date to</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="tx_events.searchform.regions">
|
||||
<source>All regions</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="tx_events.searchform.search">
|
||||
<source>Search</source>
|
||||
</trans-unit>
|
||||
</body>
|
||||
</file>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
|
||||
<file source-language="en" datatype="plaintext" original="messages" date="2021-09-07T09:15:42Z" product-name="Events">
|
||||
<header/>
|
||||
<body>
|
||||
<trans-unit id="tx_events.searchform">
|
||||
<source>Search form</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="tx_events.searchform.searchword">
|
||||
<source>Search word</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="tx_events.searchform.date_from">
|
||||
<source>Date from</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="tx_events.searchform.date_to">
|
||||
<source>Date to</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="tx_events.searchform.regions">
|
||||
<source>All regions</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="tx_events.searchform.search">
|
||||
<source>Search</source>
|
||||
</trans-unit>
|
||||
</body>
|
||||
</file>
|
||||
</xliff>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
||||
<xliff version="1.0">
|
||||
<file source-language="en" datatype="plaintext" original="messages" date="2019-04-03T12:11:11Z" product-name="tx_events">
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
|
||||
<file source-language="en" datatype="plaintext" original="messages" date="2021-09-07T09:15:42Z" product-name="Events">
|
||||
<header/>
|
||||
<body>
|
||||
<trans-unit id="tx_events_domain_model_date">
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
||||
<xliff version="1.0">
|
||||
<file source-language="en" datatype="plaintext" original="messages" date="2019-04-03T12:11:11Z" product-name="tx_events">
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
|
||||
<file source-language="en" datatype="plaintext" original="messages" date="2021-09-07T09:15:42Z" product-name="Events">
|
||||
<header/>
|
||||
<body>
|
||||
<trans-unit id="tx_events.name">
|
||||
|
|
|
@ -1,35 +1,35 @@
|
|||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
||||
<xliff version="1.0">
|
||||
<file source-language="en" datatype="plaintext" original="messages" date="2019-04-03T12:11:11Z" product-name="tx_events">
|
||||
<header/>
|
||||
<body>
|
||||
<trans-unit id="tx_events_domain_model_organizer">
|
||||
<source>Organizer</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="tx_events_domain_model_organizer.name">
|
||||
<source>Name</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="tx_events_domain_model_organizer.street">
|
||||
<source>Street</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="tx_events_domain_model_organizer.district">
|
||||
<source>District</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="tx_events_domain_model_organizer.city">
|
||||
<source>City</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="tx_events_domain_model_organizer.zip">
|
||||
<source>Zip</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="tx_events_domain_model_organizer.phone">
|
||||
<source>Phone</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="tx_events_domain_model_organizer.web">
|
||||
<source>Web</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="tx_events_domain_model_organizer.email">
|
||||
<source>E-Mail</source>
|
||||
</trans-unit>
|
||||
</body>
|
||||
</file>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
|
||||
<file source-language="en" datatype="plaintext" original="messages" date="2021-09-07T09:15:42Z" product-name="Events">
|
||||
<header/>
|
||||
<body>
|
||||
<trans-unit id="tx_events_domain_model_organizer">
|
||||
<source>Organizer</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="tx_events_domain_model_organizer.name">
|
||||
<source>Name</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="tx_events_domain_model_organizer.street">
|
||||
<source>Street</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="tx_events_domain_model_organizer.district">
|
||||
<source>District</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="tx_events_domain_model_organizer.city">
|
||||
<source>City</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="tx_events_domain_model_organizer.zip">
|
||||
<source>Zip</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="tx_events_domain_model_organizer.phone">
|
||||
<source>Phone</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="tx_events_domain_model_organizer.web">
|
||||
<source>Web</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="tx_events_domain_model_organizer.email">
|
||||
<source>E-Mail</source>
|
||||
</trans-unit>
|
||||
</body>
|
||||
</file>
|
||||
</xliff>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
||||
<xliff version="1.0">
|
||||
<file source-language="en" datatype="plaintext" original="messages" date="2019-04-03T12:11:11Z" product-name="tx_events">
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
|
||||
<file source-language="en" datatype="plaintext" original="messages" date="2021-09-07T09:15:42Z" product-name="Events">
|
||||
<header/>
|
||||
<body>
|
||||
<trans-unit id="tx_events_domain_model_partner">
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
||||
<xliff version="1.0">
|
||||
<file source-language="en" datatype="plaintext" original="messages" date="2019-04-03T12:11:11Z" product-name="tx_events">
|
||||
<header/>
|
||||
<body>
|
||||
<trans-unit id="tx_events_domain_model_region">
|
||||
<source>Region</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="tx_events_domain_model_region.title">
|
||||
<source>Title</source>
|
||||
</trans-unit>
|
||||
</body>
|
||||
</file>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
|
||||
<file source-language="en" datatype="plaintext" original="messages" date="2021-09-07T09:15:42Z" product-name="Events">
|
||||
<header/>
|
||||
<body>
|
||||
<trans-unit id="tx_events_domain_model_region">
|
||||
<source>Region</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="tx_events_domain_model_region.title">
|
||||
<source>Title</source>
|
||||
</trans-unit>
|
||||
</body>
|
||||
</file>
|
||||
</xliff>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
||||
<xliff version="1.0">
|
||||
<file source-language="en" datatype="plaintext" original="messages" date="2019-04-03T12:11:11Z" product-name="tx_events">
|
||||
<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="Events">
|
||||
<header/>
|
||||
<body>
|
||||
<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",
|
||||
"type": "typo3-cms-extension",
|
||||
"license": "GPL-2.0-or-later",
|
||||
"description": "Extension to manage Destination Data managed events",
|
||||
"authors": [
|
||||
{
|
||||
|
@ -25,12 +26,13 @@
|
|||
},
|
||||
"extra": {
|
||||
"typo3/cms": {
|
||||
"extension-key": "events"
|
||||
"cms-package-dir": "{$vendor-dir}/typo3/cms",
|
||||
"extension-key": "events",
|
||||
"web-dir": ".Build/web"
|
||||
}
|
||||
},
|
||||
"require-dev": {
|
||||
"squizlabs/php_codesniffer": "^3.5",
|
||||
"phpunit/phpunit": "^9.0",
|
||||
"typo3/testing-framework": "^6.6"
|
||||
"symplify/easy-coding-standard": "^9.4"
|
||||
}
|
||||
}
|
||||
|
|
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(
|
||||
function () {
|
||||
|
||||
\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');
|
||||
|
|
|
@ -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