[BUGFIX] Add property icon to category domainmodel 70/25170/2
authorStefan Froemken <froemken@gmail.com>
Tue, 5 Nov 2013 10:39:02 +0000 (11:39 +0100)
committerGeorg Ringer <georg.ringer@gmail.com>
Wed, 6 Nov 2013 05:20:49 +0000 (06:20 +0100)
Add missing icon property

Resolves: #53341
Releases: 6.2
Change-Id: Ib84e60c59a46d6f19adc1426760f177a37ddfe61
Reviewed-on: https://review.typo3.org/25170
Reviewed-by: Georg Ringer
Tested-by: Georg Ringer
typo3/sysext/extbase/Classes/Domain/Model/Category.php
typo3/sysext/extbase/Tests/Unit/Domain/Model/CategoryTest.php

index 9452139..fafa156 100755 (executable)
@@ -46,6 +46,11 @@ class Category extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
        protected $description = '';
 
        /**
+        * @var string
+        */
+       protected $icon = '';
+
+       /**
         * @var \TYPO3\CMS\Extbase\Domain\Model\Category|NULL
         * @lazy
         */
@@ -94,6 +99,27 @@ class Category extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
        }
 
        /**
+        * Returns the icon
+        *
+        * @return string $icon
+        * @api
+        */
+       public function getIcon() {
+               return $this->icon;
+       }
+
+       /**
+        * Sets the icon
+        *
+        * @param string $icon
+        * @return void
+        * @api
+        */
+       public function setIcon($icon) {
+               $this->icon = $icon;
+       }
+
+       /**
         * Gets the parent category.
         *
         * @return \TYPO3\CMS\Extbase\Domain\Model\Category|NULL the parent category
index 8d3ca28..e047faf 100644 (file)
@@ -76,6 +76,21 @@ class CategoryTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
        /**
         * @test
         */
+       public function getIconInitiallyReturnsEmptyString() {
+               $this->assertSame('', $this->fixture->getIcon());
+       }
+
+       /**
+        * @test
+        */
+       public function setIconSetsIcon() {
+               $this->fixture->setIcon('icon.png');
+               $this->assertSame('icon.png', $this->fixture->getIcon());
+       }
+
+       /**
+        * @test
+        */
        public function getParentInitiallyReturnsNull() {
                $this->assertNull($this->fixture->getParent());
        }