Skip to content

Commit

Permalink
version 10.1.4
Browse files Browse the repository at this point in the history
uses now PHPUnit for testing
  • Loading branch information
bihor committed Sep 2, 2020
1 parent d2c4c51 commit a337251
Show file tree
Hide file tree
Showing 10 changed files with 77 additions and 43 deletions.
4 changes: 3 additions & 1 deletion Classes/Controller/ContentController.php
Expand Up @@ -1105,7 +1105,9 @@ public function createAction(\Quizpalme\Camaliga\Domain\Model\Content $content)
$storage = \TYPO3\CMS\Core\Resource\ResourceFactory::getInstance()->getDefaultStorage();
$delete1 = '';
$delete2 = '';
$position = $this->getLatLonOfImage($uploadedFileData['tmp_name']);
if ($this->settings['getLatLon']) {
$position = $this->getLatLonOfImage($uploadedFileData['tmp_name']);
}

# check if target folder exist or create it
if ($storage->hasFolder($mediaFolder)) {
Expand Down
4 changes: 2 additions & 2 deletions Classes/Domain/Model/Content.php
Expand Up @@ -167,14 +167,14 @@ class Content extends \TYPO3\CMS\Extbase\DomainObject\AbstractValueObject
*
* @var float
*/
protected $latitude;
protected $latitude = 0.0;

/**
* Longitude
*
* @var float
*/
protected $longitude;
protected $longitude = 0.0;

/**
* Distance bei Umkreissuche
Expand Down
2 changes: 1 addition & 1 deletion Classes/Domain/Repository/ContentRepository.php
Expand Up @@ -591,7 +591,7 @@ public function getSiteRoot() {
}

/**
* Get the link to a file
* Get the link to a file. Works only with files in the fileadmin-folder!?
*
* @param int $uid UID of a file
* @return string
Expand Down
6 changes: 4 additions & 2 deletions Documentation/Changelog/Index.rst
Expand Up @@ -231,5 +231,7 @@ Version Changes
Templates changed: new partials.

TCA-Bugfix for TYPO3 10.
10.1.1 New and create action added.
========== ==============================================================================================================================
10.2.0 New and create action added.

The test-class uses now PHPUnit.
========== ==============================================================================================================================
9 changes: 5 additions & 4 deletions Documentation/Configuration/Typoscript-reference/Index.rst
Expand Up @@ -86,11 +86,12 @@ settings.random boolean Shuffle elements (rando

1: yes, shuffle the elements every time the cache is cleared.
settings.getLatLon boolean Try to get the latitude and longitude from a google server 0
for every entry with an address but no latitude?
for every entry with an address but no latitude? Checks the GPS-coordinates of
images in the create-action too.

0: no.

1: yes, search the position in the carousel, list or map template.
1: yes, search the position in the carousel, list, map or create-action.
settings.onlyDistinct boolean Show only distinct entries? 0

0: no.
Expand All @@ -111,8 +112,8 @@ overrideFlexformSettingsIfEmpty boolean Override FlexForm setti
settings.category.storagePids string Folder with categories. -1: all categories; empty: use normal folder.
settings.category.sortBy string Sort categories by: sorting (default), tstamp, crdate, title or uid.
settings.category.orderBy string Order categories by: asc (default) or desc.
settings.img.width int Width of the images. Can be used in the template. 700
settings.img.height int Height of the images. Can be used in the template. 500
settings.img.width int Width of the images. Can be used in the template. Is used in the create-action. 700
settings.img.height int Height of the images. Can be used in the template. Is used in the create-action. 500
settings.img.thumbWidth int Thumbnail width of the images. Can be used in the template. 195
settings.img.thumbHeight int Thumbnail height of the images. Can be used in the template. 139
settings.img.folderForNewEntries string Folder in the default storage for uploaded images in the FE camaliga
Expand Down
Expand Up @@ -89,11 +89,12 @@ settings.random boolean Die Elemente zufällig
1: ja, jedes mal wenn der Cache geleert wird.
settings.getLatLon boolean Versuche die Latitude und Longitude automatisch zu finden? 0
Die Position einer vorhanden Adresse ohne Latitude wird über einen
Google-Server erfragt.
Google-Server erfragt. Beim Create wird auch die GPS-Position eines Bildes
geprüft.

0: nein.

1: ja, suche die Position in einem Karussell-, List- oder Map- Template.
1: ja, suche die Position in der Karussell-, List-, Map- oder Create-Action.
settings.onlyDistinct boolean Zeige nur eindeutige Elemente an? 0

0: nein.
Expand All @@ -116,8 +117,8 @@ settings.overrideFlexformSettingsIfEmpty boolean Überschreibe die FlexF
settings.category.storagePids string Ordner mit den Kategorien. -1: alle Kategorien; Leer: normalen Ordner verwenden.
settings.category.sortBy string Kategorien sortieren nach: sorting (default), tstamp, crdate, title oder uid.
settings.category.orderBy string Kategorien ordnen nach: asc (default) oder desc.
settings.img.width int Breite eines Bildes. Kann im Template benutzt werden... 700
settings.img.height int Höhe eines Bildes. 500
settings.img.width int Breite eines Bildes. Kann im Template benutzt werden. Die create-action nutzt es. 700
settings.img.height int Höhe eines Bildes. Die create-action nutzt es. 500
settings.img.thumbWidth int Thumbnail-Breite eines Bildes. 195
settings.img.thumbHeight int Thumbnail-Höhe eines Bildes. 139
settings.img.folderForNewEntries string Ordner im "default storage" für hochgeladene Bilder im FE camaliga
Expand Down
6 changes: 4 additions & 2 deletions Documentation/Localization.de_DE/Nderungen/Index.rst
Expand Up @@ -238,5 +238,7 @@ Version Änderungen
Debug-Ausgabe jetzt im Template. DevLog-Aufruf entfernt.

TCA-Bugfix für TYPO3 10.
10.1.1 New und create action hinzugefügt.
========== =====================================================================================================================
10.2.0 New und create action hinzugefügt.

Die Test-Klasse nutzt nun PHPUnit.
========== =====================================================================================================================
4 changes: 2 additions & 2 deletions README.md
@@ -1,6 +1,6 @@
# camaliga

version 10.1.3
version 10.1.4

A carousel/gallery/map/list extension that can use the TYPO3 categories and different jQuery-plugins like Slick or Isotope.
Bootstrap support. Indexer for ke_search. Many features.
Expand All @@ -10,4 +10,4 @@ https://docs.typo3.org/p/quizpalme/camaliga/master/en-us/
and
https://docs.typo3.org/p/quizpalme/camaliga/master/de-de/

Last feature: get position of a new entry. TODO: generate slug.
Last feature: test-class uses now PHPUnit.
74 changes: 50 additions & 24 deletions Tests/Unit/Domain/Model/ContentTest.php
@@ -1,6 +1,10 @@
<?php

namespace quizpalme\Camaliga\Tests;
namespace Quizpalme\Camaliga\Tests;

use Quizpalme\Camaliga\Domain\Model\Content;
use PHPUnit\Framework\TestCase;

/***************************************************************
* Copyright notice
*
Expand Down Expand Up @@ -37,14 +41,17 @@
*
* @author Kurt Gusbeth <info@quizpalme.de>
*/
class ContentTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
class ContentTest extends TestCase
{
/**
* @var \quizpalme\Camaliga\Domain\Model\Content
* @var Content
*/
protected $fixture;

public function setUp() {
$this->fixture = new \quizpalme\Camaliga\Domain\Model\Content();
$this->fixture = new Content();

static::assertInstanceOf(Content::class, $this->fixture);
}

public function tearDown() {
Expand All @@ -68,6 +75,18 @@ public function setTitleForStringSetsTitle() {
);
}

/**
* @test
*/
public function setTitleForStringSetsTitleWithNl() {
$this->fixture->setTitle("Conceived at\nT3CON10");

$this->assertSame(
'Conceived at<br />T3CON10',
$this->fixture->getTitleNl2br()
);
}

/**
* @test
*/
Expand All @@ -85,6 +104,18 @@ public function setShortdescForStringSetsShortdesc() {
);
}

/**
* @test
*/
public function setShortdescForStringSetsShortdescWithNl() {
$this->fixture->setShortdesc("Conceived at\r\nT3CON10");

$this->assertSame(
'Conceived at<br />T3CON10',
$this->fixture->getShortdescNl2br()
);
}

/**
* @test
*/
Expand All @@ -105,46 +136,41 @@ public function setLongdescForStringSetsLongdesc() {
/**
* @test
*/
public function getLinkReturnsInitialValueForString() { }

/**
* @test
*/
public function setLinkForStringSetsLink() {
$this->fixture->setLink('Conceived at T3CON10');

public function setLongdescForStringSetsLongdescWithNl() {
$this->fixture->setLongdesc("Conceived at\rT3CON10");

$this->assertSame(
'Conceived at T3CON10',
$this->fixture->getLink()
'Conceived at<br />T3CON10',
$this->fixture->getLongdescNl2br()
);
}

/**
* @test
*/
public function getImageReturnsInitialValueForString() { }
public function getLinkReturnsInitialValueForString() { }

/**
* @test
*/
public function setImageForStringSetsImage() {
$this->fixture->setImage('Conceived at T3CON10');
public function setLinkForStringSetsLink() {
$this->fixture->setLink('Conceived at T3CON10');

$this->assertSame(
'Conceived at T3CON10',
$this->fixture->getImage()
$this->fixture->getLink()
);
}

/**
* test schlägt fehl, da kein default-value vorhanden ist
*
* test schlägt fehl, da kein default-value vorhanden ist?
*/
public function getLatitudeReturnsInitialValueForFloat() {
$this->assertSame(
0.0,
$this->fixture->getLatitude()
);
} */
}

/**
* @test
Expand All @@ -159,14 +185,14 @@ public function setLatitudeForFloatSetsLatitude() {
}

/**
* test schlägt fehl, da kein default-value vorhanden ist
*
* test schlägt fehl, da kein default-value vorhanden ist?
*/
public function getLongitudeReturnsInitialValueForFloat() {
$this->assertSame(
0.0,
$this->fixture->getLongitude()
);
} */
}

/**
* @test
Expand Down
2 changes: 1 addition & 1 deletion ext_emconf.php
Expand Up @@ -14,7 +14,7 @@
'title' => 'Camaliga: CArousel/MAp/LIst/GAllery',
'description' => 'A carousel/gallery/map/list extension that can use the TYPO3 categories and different jQuery-plugins like Slick or Isotope. Bootstrap support. Indexer for ke_search.',
'category' => 'plugin',
'version' => '10.1.3',
'version' => '10.1.4',
'state' => 'stable',
'uploadfolder' => false,
'createDirs' => '',
Expand Down

0 comments on commit a337251

Please sign in to comment.