|
@@ -6,6 +6,8 @@ use PHPUnit\Framework\TestCase;
|
|
|
use n2n\test\TestEnv;
|
|
use n2n\test\TestEnv;
|
|
|
use internship\test\ArticleTestEnv;
|
|
use internship\test\ArticleTestEnv;
|
|
|
use util\GeneralTestEnv;
|
|
use util\GeneralTestEnv;
|
|
|
|
|
+use n2n\web\http\StatusException;
|
|
|
|
|
+
|
|
|
use n2n\web\http\PageNotFoundException;
|
|
use n2n\web\http\PageNotFoundException;
|
|
|
use internship\bo\Article;
|
|
use internship\bo\Article;
|
|
|
use n2n\web\http\BadRequestException;
|
|
use n2n\web\http\BadRequestException;
|
|
@@ -30,6 +32,9 @@ class ArticleControllerTest extends TestCase {
|
|
|
$this->article3Id = $article3->getId();
|
|
$this->article3Id = $article3->getId();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @throws StatusException
|
|
|
|
|
+ */
|
|
|
function testGetDoArticles() {
|
|
function testGetDoArticles() {
|
|
|
$response = TestEnv::http()->newRequest()
|
|
$response = TestEnv::http()->newRequest()
|
|
|
->get(['api', 'articles'])
|
|
->get(['api', 'articles'])
|
|
@@ -232,4 +237,15 @@ class ArticleControllerTest extends TestCase {
|
|
|
$tx->commit();
|
|
$tx->commit();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @throws StatusException
|
|
|
|
|
+ */
|
|
|
|
|
+ function testGetDoArticlesByCategoryName() {
|
|
|
|
|
+ $response = TestEnv::http()->newRequest()
|
|
|
|
|
+ ->get(['api', 'articles', 'news'])
|
|
|
|
|
+ ->exec();
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
}
|
|
}
|