aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/ApiBundle
diff options
context:
space:
mode:
authorJeremy Benoist <jeremy.benoist@gmail.com>2016-10-22 12:09:20 +0200
committerJeremy Benoist <jeremy.benoist@gmail.com>2016-10-22 12:09:20 +0200
commitaa4741091f3f2cc7e4a7ef061a04678597ddeca8 (patch)
treee5a41f21c2c182bc198c9aa6d3c37f380d3d597c /src/Wallabag/ApiBundle
parent3199ec4702cec9c10ad0c663bcf6ce799068c9aa (diff)
downloadwallabag-aa4741091f3f2cc7e4a7ef061a04678597ddeca8.tar.gz
wallabag-aa4741091f3f2cc7e4a7ef061a04678597ddeca8.tar.zst
wallabag-aa4741091f3f2cc7e4a7ef061a04678597ddeca8.zip
Add test on /api/annotations
Fix controller forward in WallabagRestController. Update PHPDoc so it is sorted the same way as others one Duplicate all annotations test to use both api & normal way Also, make annotation tests independent to each other
Diffstat (limited to 'src/Wallabag/ApiBundle')
-rw-r--r--src/Wallabag/ApiBundle/Controller/WallabagRestController.php33
1 files changed, 17 insertions, 16 deletions
diff --git a/src/Wallabag/ApiBundle/Controller/WallabagRestController.php b/src/Wallabag/ApiBundle/Controller/WallabagRestController.php
index 0c709ca0..a73d44ca 100644
--- a/src/Wallabag/ApiBundle/Controller/WallabagRestController.php
+++ b/src/Wallabag/ApiBundle/Controller/WallabagRestController.php
@@ -536,7 +536,7 @@ class WallabagRestController extends FOSRestController
536 { 536 {
537 $this->validateAuthentication(); 537 $this->validateAuthentication();
538 538
539 return $this->forward('WallabagApiBundle:WallabagRest:getAnnotations', [ 539 return $this->forward('WallabagAnnotationBundle:WallabagAnnotation:getAnnotations', [
540 'entry' => $entry, 540 'entry' => $entry,
541 ]); 541 ]);
542 } 542 }
@@ -544,10 +544,6 @@ class WallabagRestController extends FOSRestController
544 /** 544 /**
545 * Creates a new annotation. 545 * Creates a new annotation.
546 * 546 *
547 * @param Request $request
548 * @param Entry $entry
549 *
550 * @return JsonResponse
551 * @ApiDoc( 547 * @ApiDoc(
552 * requirements={ 548 * requirements={
553 * {"name"="ranges", "dataType"="array", "requirement"="\w+", "description"="The range array for the annotation"}, 549 * {"name"="ranges", "dataType"="array", "requirement"="\w+", "description"="The range array for the annotation"},
@@ -555,15 +551,20 @@ class WallabagRestController extends FOSRestController
555 * {"name"="text", "dataType"="string", "required"=true, "description"=""}, 551 * {"name"="text", "dataType"="string", "required"=true, "description"=""},
556 * } 552 * }
557 * ) 553 * )
554 *
555 * @param Request $request
556 * @param Entry $entry
557 *
558 * @return JsonResponse
558 */ 559 */
559 public function postAnnotationAction(Request $request, Entry $entry) 560 public function postAnnotationAction(Request $request, Entry $entry)
560 { 561 {
561 $this->validateAuthentication(); 562 $this->validateAuthentication();
562 563
563 return $this->forward('WallabagApiBundle:WallabagRest:postAnnotation', [ 564 return $this->forward('WallabagAnnotationBundle:WallabagAnnotation:postAnnotation', [
564 'request' => $request, 565 'request' => $request,
565 'entry' => $entry, 566 'entry' => $entry,
566 ]); 567 ]);
567 } 568 }
568 569
569 /** 570 /**
@@ -586,10 +587,10 @@ class WallabagRestController extends FOSRestController
586 { 587 {
587 $this->validateAuthentication(); 588 $this->validateAuthentication();
588 589
589 return $this->forward('WallabagApiBundle:WallabagRest:putAnnotation', [ 590 return $this->forward('WallabagAnnotationBundle:WallabagAnnotation:putAnnotation', [
590 'annotation' => $annotation, 591 'annotation' => $annotation,
591 'request' => $request, 592 'request' => $request,
592 ]); 593 ]);
593 } 594 }
594 595
595 /** 596 /**
@@ -611,9 +612,9 @@ class WallabagRestController extends FOSRestController
611 { 612 {
612 $this->validateAuthentication(); 613 $this->validateAuthentication();
613 614
614 return $this->forward('WallabagApiBundle:WallabagRest:deleteAnnotation', [ 615 return $this->forward('WallabagAnnotationBundle:WallabagAnnotation:deleteAnnotation', [
615 'annotation' => $annotation, 616 'annotation' => $annotation,
616 ]); 617 ]);
617 } 618 }
618 619
619 /** 620 /**