Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This replaces the existing unit tests for the controller. Functional tests are way better suited for testing the controller.
- Loading branch information
1 parent
c944a3c
commit 100135e
Showing
18 changed files
with
537 additions
and
359 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<dataset> | ||
<pages> | ||
<uid>1</uid> | ||
<pid>0</pid> | ||
<doktype>1</doktype> | ||
<is_siteroot>1</is_siteroot> | ||
<slug>/</slug> | ||
<title>Page Title</title> | ||
</pages> | ||
<sys_template> | ||
<uid>1</uid> | ||
<pid>1</pid> | ||
<root>1</root> | ||
<clear>3</clear> | ||
<constants>databasePlatform = mysql</constants> | ||
<config><![CDATA[ | ||
<INCLUDE_TYPOSCRIPT: source="FILE:EXT:calendar_example/Configuration/TypoScript/Setup.typoscript"> | ||
<INCLUDE_TYPOSCRIPT: source="FILE:EXT:fluid_styled_content/Configuration/TypoScript/setup.typoscript"> | ||
]]></config> | ||
</sys_template> | ||
</dataset> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
base: / | ||
languages: | ||
- | ||
title: English | ||
enabled: true | ||
base: / | ||
typo3Language: default | ||
locale: en_GB.UTF-8 | ||
iso-639-1: en | ||
websiteTitle: '' | ||
navigationTitle: English | ||
hreflang: en-GB | ||
direction: '' | ||
flag: gb | ||
languageId: 0 | ||
fallbackType: strict | ||
fallbacks: '0' | ||
- | ||
title: Deutsch | ||
enabled: true | ||
base: /de | ||
typo3Language: de | ||
locale: de_DE.UTF-8 | ||
iso-639-1: de | ||
navigationTitle: Deutsch | ||
hreflang: de-DE | ||
direction: '' | ||
flag: de | ||
websiteTitle: '' | ||
languageId: 1 | ||
rootPageId: 1 | ||
websiteTitle: 'Example Website' |
37 changes: 37 additions & 0 deletions
37
Tests/Fixtures/calendar_example/Classes/Domain/ExampleDataFactory.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* Copyright (C) 2023 Daniel Siepmann <coding@daniel-siepmann.de> | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU General Public License | ||
* as published by the Free Software Foundation; either version 2 | ||
* of the License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program; if not, write to the Free Software | ||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | ||
* 02110-1301, USA. | ||
*/ | ||
|
||
namespace WerkraumMedia\CalendarExample\Domain; | ||
|
||
use WerkraumMedia\Calendar\Domain\Model\Day; | ||
use WerkraumMedia\Calendar\Domain\Model\ForeignDataFactory; | ||
|
||
class ExampleDataFactory implements ForeignDataFactory | ||
{ | ||
public function getData(Day $day) | ||
{ | ||
return [ | ||
'exampleKey' => 'exampleValue', | ||
]; | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
Tests/Fixtures/calendar_example/Classes/EventListener/AssignTemplateVariables.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* Copyright (C) 2023 Daniel Siepmann <coding@daniel-siepmann.de> | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU General Public License | ||
* as published by the Free Software Foundation; either version 2 | ||
* of the License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program; if not, write to the Free Software | ||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | ||
* 02110-1301, USA. | ||
*/ | ||
|
||
namespace WerkraumMedia\CalendarExample\EventListener; | ||
|
||
use WerkraumMedia\Calendar\Events\AssignTemplateVariables as AssignTemplateVariablesEvent; | ||
|
||
class AssignTemplateVariables | ||
{ | ||
public function __invoke(AssignTemplateVariablesEvent $event): void | ||
{ | ||
$event->setVariables(array_merge($event->getVariables(), [ | ||
'customVariable' => 'modifiedVariable', | ||
])); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
Tests/Fixtures/calendar_example/Configuration/Services.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
services: | ||
_defaults: | ||
autowire: true | ||
autoconfigure: true | ||
public: false | ||
|
||
WerkraumMedia\CalendarExample\: | ||
resource: '../Classes/*' | ||
|
||
WerkraumMedia\Calendar\Domain\Model\ForeignDataFactory: | ||
class: 'WerkraumMedia\CalendarExample\Domain\ExampleDataFactory' | ||
public: true | ||
|
||
WerkraumMedia\CalendarExample\EventListener\AssignTemplateVariables: | ||
tags: | ||
- name: 'event.listener' | ||
event: 'WerkraumMedia\Calendar\Events\AssignTemplateVariables' |
13 changes: 13 additions & 0 deletions
13
Tests/Fixtures/calendar_example/Configuration/TypoScript/Setup.typoscript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
plugin.tx_calendar_example { | ||
view { | ||
templateRootPaths { | ||
10 = EXT:calendar_example/Resources/Private/Templates/ | ||
} | ||
} | ||
} | ||
|
||
page = PAGE | ||
page { | ||
10 =< tt_content.calendar_example.20 | ||
} | ||
|
10 changes: 10 additions & 0 deletions
10
Tests/Fixtures/calendar_example/Resources/Private/Templates/Frontend/Calendar/Day.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" | ||
data-namespace-typo3-fluid="true" | ||
> | ||
|
||
<h2>{day.dateTimeInstance -> f:format.date(format: 'd.m.Y')}</h2> | ||
|
||
{day.foreignData.exampleKey} | ||
|
||
{customVariable} | ||
</html> |
14 changes: 14 additions & 0 deletions
14
Tests/Fixtures/calendar_example/Resources/Private/Templates/Frontend/Calendar/Month.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" | ||
data-namespace-typo3-fluid="true"> | ||
|
||
<h2>{month.dateTimeInstance -> f:format.date(format: '%B %Y')}</h2> | ||
|
||
<f:for each="{month.weeks}" as="week"> | ||
<f:for each="{week.days}" as="day"> | ||
{day.dateTimeInstance -> f:format.date(format: 'd')} | ||
{day.foreignData.exampleKey} | ||
</f:for> | ||
</f:for> | ||
|
||
{customVariable} | ||
</html> |
12 changes: 12 additions & 0 deletions
12
Tests/Fixtures/calendar_example/Resources/Private/Templates/Frontend/Calendar/Week.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" | ||
data-namespace-typo3-fluid="true"> | ||
|
||
<h2>{week.dateTimeInstance -> f:format.date(format: '%V %Y')}</h2> | ||
|
||
<f:for each="{week.days}" as="day"> | ||
{day.dateTimeInstance -> f:format.date(format: 'd')} | ||
{day.foreignData.exampleKey} | ||
</f:for> | ||
|
||
{customVariable} | ||
</html> |
16 changes: 16 additions & 0 deletions
16
Tests/Fixtures/calendar_example/Resources/Private/Templates/Frontend/Calendar/Year.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" | ||
data-namespace-typo3-fluid="true"> | ||
|
||
<h2>{year.dateTimeInstance -> f:format.date(format: 'Y')}</h2> | ||
|
||
<f:for each="{year.months}" as="month"> | ||
<f:for each="{month.weeks}" as="week"> | ||
<f:for each="{week.days}" as="day"> | ||
{day.dateTimeInstance -> f:format.date(format: 'd')} | ||
{day.foreignData.exampleKey} | ||
</f:for> | ||
</f:for> | ||
</f:for> | ||
|
||
{customVariable} | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"name": "werkraummedia/calendar_example", | ||
"description": "Add calendar data", | ||
"type": "typo3-cms-extension", | ||
"license": "GPL-2.0-or-later", | ||
"autoload": { | ||
"psr-4": { | ||
"WerkraumMedia\\CalendarExample\\": "Classes/" | ||
} | ||
}, | ||
"require": { | ||
"typo3/cms-core": "*", | ||
"typo3/cms-fluid-styled-content": "*", | ||
"werkraummedia/calendar": "*" | ||
}, | ||
"extra": { | ||
"typo3/cms": { | ||
"extension-key": "calendar_example" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
$EM_CONF['calendar_example'] = [ | ||
'title' => 'Calendar Example', | ||
'description' => 'Example extension to demonstrate integration', | ||
'category' => 'misc', | ||
'author' => 'Daniel Siepmann', | ||
'author_email' => 'coding@daniel-siepmann.de', | ||
'author_company' => 'Codappix GmbH', | ||
'state' => 'alpha', | ||
'uploadfolder' => 0, | ||
'clearCacheOnLoad' => 0, | ||
'version' => '1.0.0', | ||
'constraints' => [ | ||
'depends' => [ | ||
'typo3' => '*', | ||
], | ||
'conflicts' => [], | ||
'suggests' => [], | ||
], | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
(function () { | ||
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin( | ||
'Calendar', | ||
'Example', | ||
[ | ||
\WerkraumMedia\Calendar\Controller\Frontend\CalendarController::class => implode(',', [ | ||
'day', | ||
'week', | ||
'month', | ||
'year', | ||
]), | ||
], | ||
[], | ||
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT | ||
); | ||
})(); |
Oops, something went wrong.