File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -86,6 +86,10 @@ public function getThreadsActions(Request $request)
86
86
{
87
87
$ ids = $ request ->query ->get ('ids ' );
88
88
89
+ if (null === $ ids ) {
90
+ throw new NotFoundHttpException ('Cannot query threads without id \'s. ' );
91
+ }
92
+
89
93
$ threads = $ this ->container ->get ('fos_comment.manager.thread ' )->findThreadsBy (array ('id ' => $ ids ));
90
94
91
95
$ view = View::create ()
Original file line number Diff line number Diff line change @@ -45,6 +45,19 @@ public function testGetThread404()
45
45
$ this ->assertEquals (404 , $ this ->client ->getResponse ()->getStatusCode ());
46
46
}
47
47
48
+ /**
49
+ * Tests retrieval of a threads without id's.
50
+ *
51
+ * fos_comment_get_threads: GET: /comment_api/threads
52
+ */
53
+ public function testGetThreads404 ()
54
+ {
55
+ $ this ->client ->insulate (true );
56
+
57
+ $ this ->client ->request ('GET ' , '/comment_api/threads ' );
58
+ $ this ->assertEquals (404 , $ this ->client ->getResponse ()->getStatusCode ());
59
+ }
60
+
48
61
/**
49
62
* Tests creation of a new form.retrieval of a thread that doesnt exist.
50
63
*
You can’t perform that action at this time.
0 commit comments