diff --git a/.gitignore b/.gitignore index ee4e287..c0a851b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ /composer.lock -/public/ +/.Build/ /vendor/ diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..60c5be9 --- /dev/null +++ b/.gitlab-ci.yml @@ -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 diff --git a/Classes/Command/DestinationDataImportCommand.php b/Classes/Command/DestinationDataImportCommand.php index ca638ff..245c81e 100644 --- a/Classes/Command/DestinationDataImportCommand.php +++ b/Classes/Command/DestinationDataImportCommand.php @@ -13,7 +13,6 @@ use Wrm\Events\Service\DestinationDataImportService; class DestinationDataImportCommand extends Command { - public function configure() { $this->setDescription('Import Destination Data Events'); diff --git a/Classes/Controller/DateController.php b/Classes/Controller/DateController.php index db6bea3..d773cfc 100644 --- a/Classes/Controller/DateController.php +++ b/Classes/Controller/DateController.php @@ -18,7 +18,6 @@ use Wrm\Events\Service\DataProcessingForModels; */ class DateController extends AbstractController { - /** * @var dateRepository */ diff --git a/Classes/Domain/Model/Date.php b/Classes/Domain/Model/Date.php index 06384b9..8b76967 100644 --- a/Classes/Domain/Model/Date.php +++ b/Classes/Domain/Model/Date.php @@ -9,7 +9,6 @@ use TYPO3\CMS\Extbase\DomainObject\AbstractEntity; */ class Date extends AbstractEntity { - /** * @var \DateTime */ diff --git a/Classes/Domain/Model/Dto/DateDemand.php b/Classes/Domain/Model/Dto/DateDemand.php index 319b40c..b9a1960 100644 --- a/Classes/Domain/Model/Dto/DateDemand.php +++ b/Classes/Domain/Model/Dto/DateDemand.php @@ -6,7 +6,6 @@ use TYPO3\CMS\Core\Utility\GeneralUtility; class DateDemand { - /** * @var string */ diff --git a/Classes/Domain/Model/Dto/EventDemand.php b/Classes/Domain/Model/Dto/EventDemand.php index f07f843..92fdcb7 100644 --- a/Classes/Domain/Model/Dto/EventDemand.php +++ b/Classes/Domain/Model/Dto/EventDemand.php @@ -4,7 +4,6 @@ namespace Wrm\Events\Domain\Model\Dto; class EventDemand { - /** * @var string */ diff --git a/Classes/Domain/Model/Event.php b/Classes/Domain/Model/Event.php index b877f71..3b8f09d 100644 --- a/Classes/Domain/Model/Event.php +++ b/Classes/Domain/Model/Event.php @@ -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 * diff --git a/Classes/Domain/Model/Organizer.php b/Classes/Domain/Model/Organizer.php index 583b1e6..f70d7dd 100644 --- a/Classes/Domain/Model/Organizer.php +++ b/Classes/Domain/Model/Organizer.php @@ -20,7 +20,6 @@ use TYPO3\CMS\Extbase\DomainObject\AbstractEntity; */ class Organizer extends AbstractEntity { - /** * name * diff --git a/Classes/Domain/Model/Partner.php b/Classes/Domain/Model/Partner.php index 2b9a607..e768064 100644 --- a/Classes/Domain/Model/Partner.php +++ b/Classes/Domain/Model/Partner.php @@ -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 diff --git a/Classes/Domain/Model/Region.php b/Classes/Domain/Model/Region.php index 8c8bae2..649b9fc 100644 --- a/Classes/Domain/Model/Region.php +++ b/Classes/Domain/Model/Region.php @@ -20,7 +20,6 @@ use TYPO3\CMS\Extbase\DomainObject\AbstractEntity; */ class Region extends AbstractEntity { - /** * title * diff --git a/Classes/Domain/Repository/DateRepository.php b/Classes/Domain/Repository/DateRepository.php index 6204037..7123321 100644 --- a/Classes/Domain/Repository/DateRepository.php +++ b/Classes/Domain/Repository/DateRepository.php @@ -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'); diff --git a/Classes/Domain/Repository/OrganizerRepository.php b/Classes/Domain/Repository/OrganizerRepository.php index e43570f..a249515 100644 --- a/Classes/Domain/Repository/OrganizerRepository.php +++ b/Classes/Domain/Repository/OrganizerRepository.php @@ -19,5 +19,4 @@ use TYPO3\CMS\Extbase\Persistence\Repository; class OrganizerRepository extends Repository { - } diff --git a/Classes/Domain/Repository/RegionRepository.php b/Classes/Domain/Repository/RegionRepository.php index 213154a..8502231 100644 --- a/Classes/Domain/Repository/RegionRepository.php +++ b/Classes/Domain/Repository/RegionRepository.php @@ -19,5 +19,4 @@ use TYPO3\CMS\Extbase\Persistence\Repository; class RegionRepository extends Repository { - } diff --git a/Classes/Service/CategoryService.php b/Classes/Service/CategoryService.php index a7b1637..c57e2a0 100755 --- a/Classes/Service/CategoryService.php +++ b/Classes/Service/CategoryService.php @@ -11,7 +11,6 @@ use TYPO3\CMS\Core\Utility\GeneralUtility; class CategoryService { - /** @var TimeTracker */ protected $timeTracker; diff --git a/Classes/Service/Cleanup/Database.php b/Classes/Service/Cleanup/Database.php index 93a04bd..550f97d 100644 --- a/Classes/Service/Cleanup/Database.php +++ b/Classes/Service/Cleanup/Database.php @@ -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 { diff --git a/Classes/Service/Cleanup/Files.php b/Classes/Service/Cleanup/Files.php index 367e47d..f9f67e4 100644 --- a/Classes/Service/Cleanup/Files.php +++ b/Classes/Service/Cleanup/Files.php @@ -63,7 +63,7 @@ class Files $uidsToRemove[] = $fileToDelete['uid']; } - $this->deleteFromDb(... $uidsToRemove); + $this->deleteFromDb(...$uidsToRemove); } private function getFilesFromDb(callable $whereGenerator = null): array diff --git a/Classes/Service/CleanupService.php b/Classes/Service/CleanupService.php index d5dbb41..f6269f5 100644 --- a/Classes/Service/CleanupService.php +++ b/Classes/Service/CleanupService.php @@ -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(); } diff --git a/Classes/Service/DestinationDataImportService.php b/Classes/Service/DestinationDataImportService.php index d0b7c85..2b358b2 100644 --- a/Classes/Service/DestinationDataImportService.php +++ b/Classes/Service/DestinationDataImportService.php @@ -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(); diff --git a/Configuration/TCA/Overrides/tt_content.php b/Configuration/TCA/Overrides/tt_content.php index 45af5df..08ae561 100644 --- a/Configuration/TCA/Overrides/tt_content.php +++ b/Configuration/TCA/Overrides/tt_content.php @@ -68,5 +68,4 @@ call_user_func(function () { 'events_selected', 'FILE:EXT:events/Configuration/FlexForms/Selected.xml' ); - }); diff --git a/Configuration/TCA/tx_events_domain_model_date.php b/Configuration/TCA/tx_events_domain_model_date.php index f8a25ba..c580c15 100644 --- a/Configuration/TCA/tx_events_domain_model_date.php +++ b/Configuration/TCA/tx_events_domain_model_date.php @@ -210,7 +210,7 @@ return [ 'size' => 1, 'minitems' => 0, 'maxitems' => 1, - 'readOnly' =>1, + 'readOnly' => 1, ) ) ], diff --git a/Configuration/TCA/tx_events_domain_model_organizer.php b/Configuration/TCA/tx_events_domain_model_organizer.php index b3b80c0..02aa761 100644 --- a/Configuration/TCA/tx_events_domain_model_organizer.php +++ b/Configuration/TCA/tx_events_domain_model_organizer.php @@ -1,4 +1,5 @@ [ 'title' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_organizer.xlf:tx_events_domain_model_organizer', diff --git a/Configuration/TCA/tx_events_domain_model_region.php b/Configuration/TCA/tx_events_domain_model_region.php index 822b513..cf7de1c 100644 --- a/Configuration/TCA/tx_events_domain_model_region.php +++ b/Configuration/TCA/tx_events_domain_model_region.php @@ -1,4 +1,5 @@ [ 'title' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_region.xlf:tx_events_domain_model_region', diff --git a/Resources/Private/Language/de.locallang.xlf b/Resources/Private/Language/de.locallang.xlf index e07ab4a..cd1bc32 100644 --- a/Resources/Private/Language/de.locallang.xlf +++ b/Resources/Private/Language/de.locallang.xlf @@ -1,32 +1,32 @@ - - - -
- - - Search form - Suchformular - - - Search word - Suchwort - - - Date from - Datum von - - - Date to - Date bis - - - All regions - Alle Städte - - - Search - Suchen - - - + + + +
+ + + Search form + Suchformular + + + Search word + Suchwort + + + Date from + Datum von + + + Date to + Date bis + + + All regions + Alle Städte + + + Search + Suchen + + + diff --git a/Resources/Private/Language/de.locallang_csh_date.xlf b/Resources/Private/Language/de.locallang_csh_date.xlf index b931349..07c6257 100644 --- a/Resources/Private/Language/de.locallang_csh_date.xlf +++ b/Resources/Private/Language/de.locallang_csh_date.xlf @@ -1,6 +1,6 @@ - - - + + +
diff --git a/Resources/Private/Language/de.locallang_csh_event.xlf b/Resources/Private/Language/de.locallang_csh_event.xlf index 59e8704..cccf663 100644 --- a/Resources/Private/Language/de.locallang_csh_event.xlf +++ b/Resources/Private/Language/de.locallang_csh_event.xlf @@ -1,6 +1,6 @@ - - - + + +
diff --git a/Resources/Private/Language/de.locallang_csh_organizer.xlf b/Resources/Private/Language/de.locallang_csh_organizer.xlf index 4703dbc..f80efbd 100644 --- a/Resources/Private/Language/de.locallang_csh_organizer.xlf +++ b/Resources/Private/Language/de.locallang_csh_organizer.xlf @@ -1,44 +1,44 @@ - - - -
- - - Organizer - Organisator - - - Name - Name - - - Street - Straße - - - District - Bundesland - - - City - Stadt - - - Zip - Postleitzahl - - - Phone - Telefon - - - Web - Internet - - - E-Mail - E-Mail - - - + + + +
+ + + Organizer + Organisator + + + Name + Name + + + Street + Straße + + + District + Bundesland + + + City + Stadt + + + Zip + Postleitzahl + + + Phone + Telefon + + + Web + Internet + + + E-Mail + E-Mail + + + diff --git a/Resources/Private/Language/de.locallang_csh_partner.xlf b/Resources/Private/Language/de.locallang_csh_partner.xlf index 4f026b9..b44f6f8 100644 --- a/Resources/Private/Language/de.locallang_csh_partner.xlf +++ b/Resources/Private/Language/de.locallang_csh_partner.xlf @@ -1,6 +1,6 @@ - - - + + +
diff --git a/Resources/Private/Language/de.locallang_csh_region.xlf b/Resources/Private/Language/de.locallang_csh_region.xlf index 4c1c1f3..5ac671e 100644 --- a/Resources/Private/Language/de.locallang_csh_region.xlf +++ b/Resources/Private/Language/de.locallang_csh_region.xlf @@ -1,16 +1,16 @@ - - - -
- - - Region - Region - - - Title - Titel - - - + + + +
+ + + Region + Region + + + Title + Titel + + + diff --git a/Resources/Private/Language/de.locallang_db.xlf b/Resources/Private/Language/de.locallang_db.xlf index 53d8dbd..31843c6 100644 --- a/Resources/Private/Language/de.locallang_db.xlf +++ b/Resources/Private/Language/de.locallang_db.xlf @@ -1,6 +1,6 @@ - - - + + +
diff --git a/Resources/Private/Language/locallang.xlf b/Resources/Private/Language/locallang.xlf index ca11660..2c1281d 100644 --- a/Resources/Private/Language/locallang.xlf +++ b/Resources/Private/Language/locallang.xlf @@ -1,26 +1,26 @@ - - - -
- - - Search form - - - Search word - - - Date from - - - Date to - - - All regions - - - Search - - - + + + +
+ + + Search form + + + Search word + + + Date from + + + Date to + + + All regions + + + Search + + + diff --git a/Resources/Private/Language/locallang_csh_date.xlf b/Resources/Private/Language/locallang_csh_date.xlf index 42a521b..b6ad683 100644 --- a/Resources/Private/Language/locallang_csh_date.xlf +++ b/Resources/Private/Language/locallang_csh_date.xlf @@ -1,6 +1,6 @@ - - - + + +
diff --git a/Resources/Private/Language/locallang_csh_event.xlf b/Resources/Private/Language/locallang_csh_event.xlf index 97cb2f0..3eb5212 100644 --- a/Resources/Private/Language/locallang_csh_event.xlf +++ b/Resources/Private/Language/locallang_csh_event.xlf @@ -1,6 +1,6 @@ - - - + + +
diff --git a/Resources/Private/Language/locallang_csh_organizer.xlf b/Resources/Private/Language/locallang_csh_organizer.xlf index 0187dab..06a579c 100644 --- a/Resources/Private/Language/locallang_csh_organizer.xlf +++ b/Resources/Private/Language/locallang_csh_organizer.xlf @@ -1,35 +1,35 @@ - - - -
- - - Organizer - - - Name - - - Street - - - District - - - City - - - Zip - - - Phone - - - Web - - - E-Mail - - - + + + +
+ + + Organizer + + + Name + + + Street + + + District + + + City + + + Zip + + + Phone + + + Web + + + E-Mail + + + diff --git a/Resources/Private/Language/locallang_csh_partner.xlf b/Resources/Private/Language/locallang_csh_partner.xlf index cbfc87b..1d2e7db 100644 --- a/Resources/Private/Language/locallang_csh_partner.xlf +++ b/Resources/Private/Language/locallang_csh_partner.xlf @@ -1,6 +1,6 @@ - - - + + +
diff --git a/Resources/Private/Language/locallang_csh_region.xlf b/Resources/Private/Language/locallang_csh_region.xlf index 48fd713..38f9864 100644 --- a/Resources/Private/Language/locallang_csh_region.xlf +++ b/Resources/Private/Language/locallang_csh_region.xlf @@ -1,14 +1,14 @@ - - - -
- - - Region - - - Title - - - + + + +
+ + + Region + + + Title + + + diff --git a/Resources/Private/Language/locallang_db.xlf b/Resources/Private/Language/locallang_db.xlf index 03080c4..d78e917 100644 --- a/Resources/Private/Language/locallang_db.xlf +++ b/Resources/Private/Language/locallang_db.xlf @@ -1,6 +1,6 @@ - - + +
diff --git a/Tests/Unit/Controller/DateControllerTest.php b/Tests/Unit/Controller/DateControllerTest.php deleted file mode 100644 index b9a7ba9..0000000 --- a/Tests/Unit/Controller/DateControllerTest.php +++ /dev/null @@ -1,63 +0,0 @@ - - */ -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); - } -} diff --git a/Tests/Unit/Controller/EventControllerTest.php b/Tests/Unit/Controller/EventControllerTest.php deleted file mode 100644 index 5ab1161..0000000 --- a/Tests/Unit/Controller/EventControllerTest.php +++ /dev/null @@ -1,63 +0,0 @@ - - */ -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); - } -} diff --git a/Tests/Unit/Controller/EventsControllerTest.php b/Tests/Unit/Controller/EventsControllerTest.php deleted file mode 100644 index 9efe3a9..0000000 --- a/Tests/Unit/Controller/EventsControllerTest.php +++ /dev/null @@ -1,63 +0,0 @@ - - */ -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); - } -} diff --git a/Tests/Unit/Domain/Model/DateTest.php b/Tests/Unit/Domain/Model/DateTest.php deleted file mode 100644 index 057c4a0..0000000 --- a/Tests/Unit/Domain/Model/DateTest.php +++ /dev/null @@ -1,74 +0,0 @@ - - */ -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 - ); - } -} diff --git a/Tests/Unit/Domain/Model/EventTest.php b/Tests/Unit/Domain/Model/EventTest.php deleted file mode 100644 index 82de42c..0000000 --- a/Tests/Unit/Domain/Model/EventTest.php +++ /dev/null @@ -1,663 +0,0 @@ - - */ -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 - ); - } -} diff --git a/Tests/Unit/Domain/Model/EventsTest.php b/Tests/Unit/Domain/Model/EventsTest.php deleted file mode 100644 index 25d9e4c..0000000 --- a/Tests/Unit/Domain/Model/EventsTest.php +++ /dev/null @@ -1,613 +0,0 @@ - - */ -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); - } -} diff --git a/Tests/Unit/Domain/Model/OrganizerTest.php b/Tests/Unit/Domain/Model/OrganizerTest.php deleted file mode 100644 index 1d38ff0..0000000 --- a/Tests/Unit/Domain/Model/OrganizerTest.php +++ /dev/null @@ -1,222 +0,0 @@ - - */ -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 - ); - } -} diff --git a/Tests/Unit/Domain/Model/RegionTest.php b/Tests/Unit/Domain/Model/RegionTest.php deleted file mode 100644 index 0811d91..0000000 --- a/Tests/Unit/Domain/Model/RegionTest.php +++ /dev/null @@ -1,47 +0,0 @@ - - */ -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 - ); - } -} diff --git a/composer.json b/composer.json index 7431679..cb6d676 100644 --- a/composer.json +++ b/composer.json @@ -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" } } diff --git a/ecs.php b/ecs.php new file mode 100644 index 0000000..f3c8db2 --- /dev/null +++ b/ecs.php @@ -0,0 +1,20 @@ +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', + ]); +}; diff --git a/ext_tables.php b/ext_tables.php index 181bc7f..09a3f9a 100644 --- a/ext_tables.php +++ b/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'); diff --git a/phpcs.xml.dist b/phpcs.xml.dist deleted file mode 100644 index 0c873f7..0000000 --- a/phpcs.xml.dist +++ /dev/null @@ -1,26 +0,0 @@ - - - This project coding standard - - Classes/ - Tests/ - ext_localconf.php - ext_tables.php - - - - - - - - - - - - - - - - - -