File tree Expand file tree Collapse file tree 3 files changed +48
-3
lines changed
src/Oro/Bundle/ProductBundle
Tests/Functional/Controller/Frontend Expand file tree Collapse file tree 3 files changed +48
-3
lines changed Original file line number Diff line number Diff line change 22
33namespace Oro \Bundle \ProductBundle \Controller \Frontend ;
44
5- use Oro \Bundle \ProductBundle \Entity \Product ;
5+ use Oro \Bundle \ProductBundle \Entity \Brand ;
66use Symfony \Bundle \FrameworkBundle \Controller \Controller ;
77use Symfony \Component \HttpFoundation \Request ;
8+ use Symfony \Component \HttpKernel \Exception \NotFoundHttpException ;
89use Symfony \Component \Routing \Annotation \Route ;
910
11+ /**
12+ * Frontend product brand controller.
13+ */
1014class BrandController extends Controller
1115{
1216 const GRID_NAME = 'frontend-brand-search-grid ' ;
@@ -20,7 +24,7 @@ class BrandController extends Controller
2024 */
2125 public function indexAction ()
2226 {
23- return [] ;
27+ throw new NotFoundHttpException () ;
2428 }
2529
2630 /**
@@ -35,6 +39,6 @@ public function indexAction()
3539 */
3640 public function viewAction (Request $ request , Brand $ brand )
3741 {
38- return [] ;
42+ throw new NotFoundHttpException () ;
3943 }
4044}
Original file line number Diff line number Diff line change @@ -20,6 +20,13 @@ oro_product_frontend_product:
2020 options :
2121 frontend : true
2222
23+ oro_product_frontend_brand :
24+ resource : " @OroProductBundle/Controller/Frontend/BrandController.php"
25+ type : annotation
26+ prefix : /brand
27+ options :
28+ frontend : true
29+
2330oro_product_frontend_product_ajax :
2431 resource : " @OroProductBundle/Controller/Frontend/AjaxProductController.php"
2532 type : annotation
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Oro \Bundle \ProductBundle \Tests \Functional \Controller \Frontend ;
4+
5+ use Oro \Bundle \FrontendTestFrameworkBundle \Migrations \Data \ORM \LoadCustomerUserData ;
6+ use Oro \Bundle \ProductBundle \Tests \Functional \DataFixtures \LoadBrandData ;
7+ use Oro \Bundle \TestFrameworkBundle \Test \WebTestCase ;
8+
9+ class BrandController extends WebTestCase
10+ {
11+ protected function setUp (): void
12+ {
13+ $ this ->initClient (
14+ [],
15+ $ this ->generateBasicAuthHeader (LoadCustomerUserData::AUTH_USER , LoadCustomerUserData::AUTH_PW )
16+ );
17+ $ this ->loadFixtures ([LoadBrandData::class]);
18+ }
19+
20+ public function testIndexAction (): void
21+ {
22+ $ this ->client ->request ('GET ' , $ this ->getUrl ('oro_product_frontend_brand_index ' ));
23+ $ result = $ this ->client ->getResponse ();
24+ $ this ->assertHtmlResponseStatusCodeEquals ($ result , 404 );
25+ }
26+
27+ public function testViewAction (): void
28+ {
29+ $ brandId = $ this ->getReference (LoadBrandData::BRAND_1 )->getId ();
30+ $ this ->client ->request ('GET ' , $ this ->getUrl ('oro_product_frontend_brand_view ' , ['id ' => $ brandId ]));
31+ $ result = $ this ->client ->getResponse ();
32+ $ this ->assertHtmlResponseStatusCodeEquals ($ result , 404 );
33+ }
34+ }
You can’t perform that action at this time.
0 commit comments