diff --git a/Models/NewsArticle.php b/Models/NewsArticle.php
index fdcdb85..106cb0b 100755
--- a/Models/NewsArticle.php
+++ b/Models/NewsArticle.php
@@ -29,7 +29,7 @@ use phpOMS\Stdlib\Base\Exception\InvalidEnumValue;
* @link https://orange-management.org
* @since 1.0.0
*/
-class NewsArticle implements ArrayableInterface, \JsonSerializable
+class NewsArticle implements \JsonSerializable, ArrayableInterface
{
/**
* Article ID.
diff --git a/Models/NewsStatus.php b/Models/NewsStatus.php
index 722104f..5eea39a 100755
--- a/Models/NewsStatus.php
+++ b/Models/NewsStatus.php
@@ -27,5 +27,6 @@ use phpOMS\Stdlib\Base\Enum;
abstract class NewsStatus extends Enum
{
public const VISIBLE = 0;
+
public const DRAFT = 1;
}
diff --git a/Models/NewsType.php b/Models/NewsType.php
index d0963cc..9cab7ff 100755
--- a/Models/NewsType.php
+++ b/Models/NewsType.php
@@ -27,6 +27,8 @@ use phpOMS\Stdlib\Base\Enum;
abstract class NewsType extends Enum
{
public const ARTICLE = 0;
+
public const LINK = 1;
+
public const HEADLINE = 2;
}
diff --git a/Theme/Backend/dashboard-news.tpl.php b/Theme/Backend/dashboard-news.tpl.php
index e748236..bf497cb 100755
--- a/Theme/Backend/dashboard-news.tpl.php
+++ b/Theme/Backend/dashboard-news.tpl.php
@@ -25,8 +25,8 @@ $newsList = $this->getData('news') ?? [];
|
- | = $this->getHtml('Type', 'News') ?>
- | = $this->getHtml('Title', 'News') ?>
+ | = $this->getHtml('Type', 'News'); ?>
+ | = $this->getHtml('Title', 'News'); ?>
|
$news) : ++$count;
$url = \phpOMS\Uri\UriFactory::build('{/prefix}news/article?{?}&id=' . $news->getId());
@@ -42,13 +42,13 @@ $newsList = $this->getData('news') ?? [];
-
+ |
- = $this->getHtml('TYPE' . $news->getType(), 'News') ?>
+ = $this->getHtml('TYPE' . $news->getType(), 'News'); ?>
- |
+ |
= $this->printHtml($news->getTitle()); ?>
diff --git a/Theme/Backend/news-archive.tpl.php b/Theme/Backend/news-archive.tpl.php
index 8af62f8..277913b 100755
--- a/Theme/Backend/news-archive.tpl.php
+++ b/Theme/Backend/news-archive.tpl.php
@@ -27,14 +27,14 @@ echo $this->getData('nav')->render(); ?>
- = $this->getHtml('Archive') ?>
+ = $this->getHtml('Archive'); ?>
- | = $this->getHtml('Type') ?>
- | = $this->getHtml('Title') ?>
- | = $this->getHtml('Author') ?>
- | = $this->getHtml('Date') ?>
+ | = $this->getHtml('Type'); ?>
+ | = $this->getHtml('Title'); ?>
+ | = $this->getHtml('Author'); ?>
+ | = $this->getHtml('Date'); ?>
|
$news) : ++$count; $url = UriFactory::build('{/prefix}news/article?{?}&id=' . $news->getId());
$color = 'darkred';
@@ -43,7 +43,7 @@ echo $this->getData('nav')->render(); ?>
elseif ($news->getType() === NewsType::LINK) { $color = 'yellow'; }
?>
- | = $this->getHtml('TYPE' . $news->getType()) ?>
+ | = $this->getHtml('TYPE' . $news->getType()); ?>
| = $this->printHtml($news->getTitle()); ?>
| = $this->printHtml($news->getCreatedBy()->getName1()); ?>
| = $this->printHtml($news->getPublish()->format('Y-m-d')); ?>
diff --git a/Theme/Backend/news-draft.tpl.php b/Theme/Backend/news-draft.tpl.php
index 1d1400d..c7a59a9 100644
--- a/Theme/Backend/news-draft.tpl.php
+++ b/Theme/Backend/news-draft.tpl.php
@@ -27,14 +27,14 @@ echo $this->getData('nav')->render(); ?>
- = $this->getHtml('Draft') ?>
+ = $this->getHtml('Draft'); ?>
- | = $this->getHtml('Type') ?>
- | = $this->getHtml('Title') ?>
- | = $this->getHtml('Author') ?>
- | = $this->getHtml('Date') ?>
+ | = $this->getHtml('Type'); ?>
+ | = $this->getHtml('Title'); ?>
+ | = $this->getHtml('Author'); ?>
+ | = $this->getHtml('Date'); ?>
|
$news) : ++$count; $url = UriFactory::build('{/prefix}news/edit?{?}&id=' . $news->getId());
$color = 'darkred';
@@ -43,7 +43,7 @@ echo $this->getData('nav')->render(); ?>
elseif ($news->getType() === NewsType::LINK) { $color = 'yellow'; }
?>
- | = $this->getHtml('TYPE' . $news->getType()) ?>
+ | = $this->getHtml('TYPE' . $news->getType()); ?>
| = $this->printHtml($news->getTitle()); ?>
| = $this->printHtml($news->getCreatedBy()->getName1()); ?>
| = $this->printHtml($news->getPublish()->format('Y-m-d')); ?>
diff --git a/tests/Admin/AdminTest.php b/tests/Admin/AdminTest.php
index ccb7dae..c97b134 100755
--- a/tests/Admin/AdminTest.php
+++ b/tests/Admin/AdminTest.php
@@ -20,6 +20,7 @@ namespace Modules\News\tests\Admin;
class AdminTest extends \PHPUnit\Framework\TestCase
{
protected const MODULE_NAME = 'News';
+
protected const URI_LOAD = 'http://127.0.0.1/en/backend/news';
use \Modules\tests\ModuleTestTrait;
diff --git a/tests/Controller/Api/ApiControllerNewsArticleTrait.php b/tests/Controller/Api/ApiControllerNewsArticleTrait.php
index e771703..0384880 100755
--- a/tests/Controller/Api/ApiControllerNewsArticleTrait.php
+++ b/tests/Controller/Api/ApiControllerNewsArticleTrait.php
@@ -23,8 +23,8 @@ use phpOMS\Uri\HttpUri;
trait ApiControllerNewsArticleTrait
{
/**
- * @testdox A news article can be created
- * @covers Modules\News\Controller\ApiController
+ * @testdox A news article can be created
+ * @covers Modules\News\Controller\ApiController
* @group module
*/
public function testApiNewsCreate() : void
diff --git a/tests/Controller/ApiControllerTest.php b/tests/Controller/ApiControllerTest.php
index bbd98ea..d2edafb 100755
--- a/tests/Controller/ApiControllerTest.php
+++ b/tests/Controller/ApiControllerTest.php
@@ -37,6 +37,7 @@ use phpOMS\Utils\TestUtils;
class ControllerTest extends \PHPUnit\Framework\TestCase
{
protected $app = null;
+
protected $module = null;
protected function setUp() : void
diff --git a/tests/Models/NewsArticleTest.php b/tests/Models/NewsArticleTest.php
index d41048f..635573b 100755
--- a/tests/Models/NewsArticleTest.php
+++ b/tests/Models/NewsArticleTest.php
@@ -192,7 +192,7 @@ class NewsArticleTest extends \PHPUnit\Framework\TestCase
* @testdox A invalid status throws a InvalidEnumValue exception
* @covers Modules\News\Models\NewsArticle
* @group module
- */
+ */
public function testInvalidStatus() : void
{
$this->expectException(\phpOMS\Stdlib\Base\Exception\InvalidEnumValue::class);
@@ -205,7 +205,7 @@ class NewsArticleTest extends \PHPUnit\Framework\TestCase
* @testdox A invalid type throws a InvalidEnumValue exception
* @covers Modules\News\Models\NewsArticle
* @group module
- */
+ */
public function testInvalidType() : void
{
$this->expectException(\phpOMS\Stdlib\Base\Exception\InvalidEnumValue::class);
@@ -218,7 +218,7 @@ class NewsArticleTest extends \PHPUnit\Framework\TestCase
* @testdox A invalid language throws a InvalidEnumValue exception
* @covers Modules\News\Models\NewsArticle
* @group module
- */
+ */
public function testInvalidLanguage() : void
{
$this->expectException(\phpOMS\Stdlib\Base\Exception\InvalidEnumValue::class);
| | |