From f8c8f556ba921070aafdba36b60b577154e9190e Mon Sep 17 00:00:00 2001 From: Vinai Kopp Date: Fri, 26 Jun 2015 15:58:10 +0200 Subject: [PATCH] Add abstract method execute() to \Magento\Framework\App\Action\Action Purpose == Make implementing Actions more developer friendly via self-documenting code. Background == The existing method `\Magento\Framework\App\Action\Action::dispatch()` calls an `execute()` method without actually implementing it. ```php $result = $this->execute(); ``` Any subclass actions simply need to implement that method and it will be called automatically when the superclass method is `dispatch()` is called. Without the changes in this PR, the `execute()` method in effect was part of an implicit interface exposed by the `Action` class. Because of this the `Action` class could never be instantiated and used (that is, dispatched), without first subclassing it. This in turn makes the `Action` class an implicitly abstract class. All this PR does it that it makes the class interface explicit by adding the execute method as an abstract method to `\Magento\Framework\App\Action\Action`. All the other changes in this PR are just follow-up changes to accommodate for this one update. Follow up changes -- Because concrete classes can't have abstract methods, the `Action` class itself also had to be made abstract. A number of subclasses of `Action` that did not implement `execute()`, because they themselves also needed to be extended, had to be declared as abstract classes now, too, because they inherit the abstract method from the `Action` superclass. There where some tests that instantiated these implicitly abstract classes. This PR adds stub implementations for each of these. * `Magento\Checkout\Test\Unit\Controller\OnepageTest` in app/code/Magento/Checkout/Test/Unit/Controller/ * `Magento\Contact\Test\Unit\Controller\IndexTest` in app/code/Magento/Contact/Test/Unit/Controller/ * `Magento\Tax\Test\Unit\App\Action\ContextPluginTest` in app/code/Magento/Tax/Test/Unit/App/Action/ * `Magento\Catalog\Helper\Product\ViewTest` in dev/tests/integration/testsuite/Magento/Catalog/Helper/Product/ * `Magento\Cms\Helper\PageTest` in dev/tests/integration/testsuite/Magento/Cms/Helper/Stub/ * `Magento\Sales\Controller\Adminhtml\Order\CreateTest` in dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/ Finally, the `Magento\Ui\Controller\UiActionInterface` class, which was implemented by an abstract subclass of `Action`, namely `\Magento\Ui\Controller\Adminhtml\AbstractAction`, contained a `public function execute();` itself. This explicit interface contract was in conflict with the implicit interface of the `Action` class, which did defined the same method, but implicitly. To resolve this conflict this PR changes the method exposed by the `UiActionInterface` to `public function executeAjaxRequest();`. This seemed the most fitting when looking at the code implementing the interface method. Internally it only calls the now explicit `execute()` method inherited from the `Action` interface. Also, it seems as if the `UiActionInterface::execute()` method was only called by a single test. However, I realize the method might be used a lot more in the non-public EE code, which will also need to be adjusted to be compatible with this PR. Reasons for this PR == As stated above, the purpose of this PR is to make the developer experience better. This is done by making an implicit interface explicit. This has a whole number of benefits, besides being good OOP practice: * It is clear which classes should be instantiated and which should not * It is clear which method needs to be implemented when subclassing `Action` * The expected return type of `execute()` is documented in the phpdoc block * When subclassing `Action` the IDE can be used to quickly a method stub Allover the changes lead to more self-documenting code that tells developers to they should use it. Potential issues == The explicit abstract `execute()` method added in this PR is declared with protected visibility. This basically removes it as a valid extension point for plugins. However, since the method was not declared as public previously (in fact, is wasn't declared at all), it should not have been used as an extension point for plugins anyway. So the main reason against this PR I can think of is that the EE code will need to be adjusted (plus, I might be missing many obvious reasons). Of course I'd be happy to make the required updates, but I realize that is problematic due to the commercial licenced, non-open code. I've got a bunch of hacky shell scripts to find and update any controllers needed to be declared abstract, but I'd rather not share them as they are just one-time hacks. All the other changes - updating the ui action interface and the test stubs - where done manually and didn't take long. --- .../Controller/Adminhtml/Notification.php | 2 +- app/code/Magento/Backend/App/Action.php | 2 +- .../Backend/Controller/Adminhtml/Auth.php | 2 +- .../Backend/Controller/Adminhtml/Cache.php | 2 +- .../Backend/Controller/Adminhtml/Dashboard.php | 2 +- .../Backend/Controller/Adminhtml/Index.php | 2 +- .../Backend/Controller/Adminhtml/System.php | 2 +- .../Controller/Adminhtml/System/Account.php | 2 +- .../Controller/Adminhtml/System/Design.php | 2 +- .../Controller/Adminhtml/System/Store.php | 2 +- .../Backup/Controller/Adminhtml/Index.php | 2 +- .../Catalog/Controller/Adminhtml/Category.php | 2 +- .../Controller/Adminhtml/Category/Widget.php | 2 +- .../Catalog/Controller/Adminhtml/Product.php | 2 +- .../Adminhtml/Product/AbstractProductGrid.php | 2 +- .../Adminhtml/Product/Action/Attribute.php | 2 +- .../Controller/Adminhtml/Product/Attribute.php | 2 +- .../Controller/Adminhtml/Product/Set.php | 2 +- app/code/Magento/Catalog/Controller/Product.php | 2 +- .../Catalog/Controller/Product/Compare.php | 2 +- .../Controller/Adminhtml/Promo/Catalog.php | 2 +- .../Controller/Adminhtml/Promo/Widget.php | 2 +- .../Controller/Adminhtml/Product/Widget.php | 2 +- app/code/Magento/Checkout/Controller/Cart.php | 2 +- .../Magento/Checkout/Controller/Onepage.php | 2 +- .../Test/Unit/Controller/OnepageTest.php | 4 ++-- .../Test/Unit/Controller/Stub/OnepageStub.php | 12 ++++++++++++ .../Controller/Adminhtml/Agreement.php | 2 +- .../Magento/Cms/Controller/Adminhtml/Block.php | 2 +- .../Cms/Controller/Adminhtml/Wysiwyg/Images.php | 2 +- app/code/Magento/Contact/Controller/Index.php | 2 +- .../Contact/Test/Unit/Controller/IndexTest.php | 2 +- .../Test/Unit/Controller/Stub/IndexStub.php | 12 ++++++++++++ .../Controller/Adminhtml/System/Currency.php | 2 +- .../Adminhtml/System/Currencysymbol.php | 2 +- .../Magento/Customer/Controller/Account.php | 2 +- .../Magento/Customer/Controller/Address.php | 2 +- .../Adminhtml/Cart/Product/Composite/Cart.php | 2 +- .../Customer/Controller/Adminhtml/Group.php | 2 +- .../Customer/Controller/Adminhtml/Index.php | 2 +- .../Adminhtml/System/Config/Validatevat.php | 2 +- .../Wishlist/Product/Composite/Wishlist.php | 2 +- .../Adminhtml/System/Design/Editor.php | 2 +- .../Adminhtml/System/Design/Editor/Tools.php | 2 +- .../Controller/Adminhtml/Downloadable/File.php | 2 +- .../Downloadable/Controller/Download.php | 2 +- .../Controller/Adminhtml/Email/Template.php | 2 +- .../Adminhtml/Googleshopping/Items.php | 2 +- .../Adminhtml/Googleshopping/Types.php | 2 +- .../Controller/Adminhtml/Export.php | 2 +- .../Controller/Adminhtml/Import.php | 2 +- .../Indexer/Controller/Adminhtml/Indexer.php | 2 +- .../Controller/Adminhtml/Integration.php | 2 +- .../Adminhtml/System/Config/System/Storage.php | 2 +- .../Multishipping/Controller/Checkout.php | 2 +- .../Controller/Checkout/Address.php | 2 +- .../Newsletter/Controller/Adminhtml/Problem.php | 2 +- .../Newsletter/Controller/Adminhtml/Queue.php | 2 +- .../Controller/Adminhtml/Subscriber.php | 2 +- .../Controller/Adminhtml/Template.php | 2 +- .../Magento/Newsletter/Controller/Manage.php | 2 +- .../Newsletter/Controller/Subscriber.php | 2 +- app/code/Magento/PageCache/Controller/Block.php | 2 +- .../Magento/Persistent/Controller/Index.php | 2 +- .../Magento/ProductAlert/Controller/Add.php | 2 +- .../ProductAlert/Controller/Unsubscribe.php | 2 +- .../Reports/Controller/Adminhtml/Index.php | 2 +- .../Controller/Adminhtml/Report/Customer.php | 2 +- .../Controller/Adminhtml/Report/Product.php | 2 +- .../Controller/Adminhtml/Report/Review.php | 2 +- .../Controller/Adminhtml/Report/Sales.php | 2 +- .../Controller/Adminhtml/Report/Shopcart.php | 2 +- .../Controller/Adminhtml/Report/Statistics.php | 2 +- .../Review/Controller/Adminhtml/Product.php | 2 +- .../Review/Controller/Adminhtml/Rating.php | 2 +- app/code/Magento/Review/Controller/Customer.php | 2 +- app/code/Magento/Review/Controller/Product.php | 2 +- .../Magento/Rss/Controller/Adminhtml/Feed.php | 2 +- app/code/Magento/Rss/Controller/Feed.php | 2 +- app/code/Magento/Rss/Controller/Index.php | 2 +- .../Sales/Controller/Adminhtml/Order.php | 2 +- .../Sales/Controller/Adminhtml/Order/Create.php | 2 +- .../Sales/Controller/Adminhtml/Order/Status.php | 2 +- .../Adminhtml/Order/View/Giftmessage.php | 2 +- .../Sales/Controller/Adminhtml/Transactions.php | 2 +- .../Controller/Adminhtml/Promo/Quote.php | 2 +- .../Search/Controller/Adminhtml/Term.php | 2 +- .../Magento/SendFriend/Controller/Product.php | 2 +- .../Sitemap/Controller/Adminhtml/Sitemap.php | 2 +- .../Magento/Tax/Controller/Adminhtml/Rate.php | 2 +- .../Magento/Tax/Controller/Adminhtml/Rule.php | 2 +- .../Magento/Tax/Controller/Adminhtml/Tax.php | 2 +- .../Test/Unit/App/Action/ContextPluginTest.php | 2 +- .../Test/Unit/App/Action/Stub/ActionStub.php | 12 ++++++++++++ .../Controller/Adminhtml/Rate.php | 2 +- .../Adminhtml/System/Design/Theme.php | 2 +- .../Adminhtml/System/Design/Wysiwyg/Files.php | 2 +- .../Ui/Controller/Adminhtml/AbstractAction.php | 17 ++++++++++------- .../Ui/Controller/Adminhtml/Bookmark/Delete.php | 2 +- .../Ui/Controller/Adminhtml/Bookmark/Save.php | 2 +- .../Ui/Controller/Adminhtml/Index/Render.php | 2 +- .../Magento/Ui/Controller/UiActionInterface.php | 2 +- .../Controller/Adminhtml/Index/RenderTest.php | 4 ++-- .../Controller/Adminhtml/Url/Rewrite.php | 2 +- .../Magento/User/Controller/Adminhtml/Auth.php | 2 +- .../Magento/User/Controller/Adminhtml/User.php | 2 +- .../User/Controller/Adminhtml/User/Role.php | 2 +- .../Controller/Adminhtml/System/Variable.php | 2 +- .../Controller/Adminhtml/Widget/Instance.php | 2 +- .../Product/Stub/ProductControllerStub.php | 11 +++++++++++ .../Magento/Catalog/Helper/Product/ViewTest.php | 4 ++-- .../testsuite/Magento/Cms/Helper/PageTest.php | 2 +- .../Magento/Cms/Helper/Stub/ActionStub.php | 11 +++++++++++ .../Controller/Adminhtml/Order/CreateTest.php | 4 +++- .../Adminhtml/Order/Stub/OrderCreateStub.php | 11 +++++++++++ .../Magento/Framework/App/Action/Action.php | 8 +++++++- 116 files changed, 199 insertions(+), 119 deletions(-) create mode 100644 app/code/Magento/Checkout/Test/Unit/Controller/Stub/OnepageStub.php create mode 100644 app/code/Magento/Contact/Test/Unit/Controller/Stub/IndexStub.php create mode 100644 app/code/Magento/Tax/Test/Unit/App/Action/Stub/ActionStub.php create mode 100644 dev/tests/integration/testsuite/Magento/Catalog/Helper/Product/Stub/ProductControllerStub.php create mode 100644 dev/tests/integration/testsuite/Magento/Cms/Helper/Stub/ActionStub.php create mode 100644 dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Stub/OrderCreateStub.php diff --git a/app/code/Magento/AdminNotification/Controller/Adminhtml/Notification.php b/app/code/Magento/AdminNotification/Controller/Adminhtml/Notification.php index d1657ae076abb..af4d1f155e5b5 100644 --- a/app/code/Magento/AdminNotification/Controller/Adminhtml/Notification.php +++ b/app/code/Magento/AdminNotification/Controller/Adminhtml/Notification.php @@ -7,7 +7,7 @@ */ namespace Magento\AdminNotification\Controller\Adminhtml; -class Notification extends \Magento\Backend\App\AbstractAction +abstract class Notification extends \Magento\Backend\App\AbstractAction { /** * @return bool diff --git a/app/code/Magento/Backend/App/Action.php b/app/code/Magento/Backend/App/Action.php index 784ea97a090f7..88fbbbd6d5553 100644 --- a/app/code/Magento/Backend/App/Action.php +++ b/app/code/Magento/Backend/App/Action.php @@ -12,6 +12,6 @@ /** * @SuppressWarnings(PHPMD.NumberOfChildren) */ -class Action extends \Magento\Backend\App\AbstractAction +abstract class Action extends \Magento\Backend\App\AbstractAction { } diff --git a/app/code/Magento/Backend/Controller/Adminhtml/Auth.php b/app/code/Magento/Backend/Controller/Adminhtml/Auth.php index 0aa79d40a6a41..c712deb6fedd0 100644 --- a/app/code/Magento/Backend/Controller/Adminhtml/Auth.php +++ b/app/code/Magento/Backend/Controller/Adminhtml/Auth.php @@ -10,7 +10,7 @@ /** * Auth backend controller */ -class Auth extends AbstractAction +abstract class Auth extends AbstractAction { /** * Check if user has permissions to access this controller diff --git a/app/code/Magento/Backend/Controller/Adminhtml/Cache.php b/app/code/Magento/Backend/Controller/Adminhtml/Cache.php index f7d1548519d70..ae0e3ceab0c87 100644 --- a/app/code/Magento/Backend/Controller/Adminhtml/Cache.php +++ b/app/code/Magento/Backend/Controller/Adminhtml/Cache.php @@ -8,7 +8,7 @@ use Magento\Backend\App\Action; use Magento\Framework\Exception\LocalizedException; -class Cache extends Action +abstract class Cache extends Action { /** * @var \Magento\Framework\App\Cache\TypeListInterface diff --git a/app/code/Magento/Backend/Controller/Adminhtml/Dashboard.php b/app/code/Magento/Backend/Controller/Adminhtml/Dashboard.php index a4c41fde49a92..f247871b9ebb8 100644 --- a/app/code/Magento/Backend/Controller/Adminhtml/Dashboard.php +++ b/app/code/Magento/Backend/Controller/Adminhtml/Dashboard.php @@ -11,7 +11,7 @@ */ namespace Magento\Backend\Controller\Adminhtml; -class Dashboard extends \Magento\Backend\App\Action +abstract class Dashboard extends \Magento\Backend\App\Action { /** * @return bool diff --git a/app/code/Magento/Backend/Controller/Adminhtml/Index.php b/app/code/Magento/Backend/Controller/Adminhtml/Index.php index 333f29205188b..0dd5ee2af3961 100644 --- a/app/code/Magento/Backend/Controller/Adminhtml/Index.php +++ b/app/code/Magento/Backend/Controller/Adminhtml/Index.php @@ -10,7 +10,7 @@ /** * Index backend controller */ -class Index extends AbstractAction +abstract class Index extends AbstractAction { /** * Check if user has permissions to access this controller diff --git a/app/code/Magento/Backend/Controller/Adminhtml/System.php b/app/code/Magento/Backend/Controller/Adminhtml/System.php index 5ce34283afccf..6378dfeb6cd94 100644 --- a/app/code/Magento/Backend/Controller/Adminhtml/System.php +++ b/app/code/Magento/Backend/Controller/Adminhtml/System.php @@ -12,7 +12,7 @@ * * @author Magento Core Team */ -class System extends AbstractAction +abstract class System extends AbstractAction { /** * @return bool diff --git a/app/code/Magento/Backend/Controller/Adminhtml/System/Account.php b/app/code/Magento/Backend/Controller/Adminhtml/System/Account.php index 166951742d8f3..1cc8e12d7ca44 100644 --- a/app/code/Magento/Backend/Controller/Adminhtml/System/Account.php +++ b/app/code/Magento/Backend/Controller/Adminhtml/System/Account.php @@ -12,7 +12,7 @@ * * @author Magento Core Team */ -class Account extends Action +abstract class Account extends Action { /** * @return bool diff --git a/app/code/Magento/Backend/Controller/Adminhtml/System/Design.php b/app/code/Magento/Backend/Controller/Adminhtml/System/Design.php index fb5725b74bbf8..f236b5d156e0b 100644 --- a/app/code/Magento/Backend/Controller/Adminhtml/System/Design.php +++ b/app/code/Magento/Backend/Controller/Adminhtml/System/Design.php @@ -7,7 +7,7 @@ use Magento\Backend\App\Action; -class Design extends Action +abstract class Design extends Action { /** * Core registry diff --git a/app/code/Magento/Backend/Controller/Adminhtml/System/Store.php b/app/code/Magento/Backend/Controller/Adminhtml/System/Store.php index a6efb535ec265..2b23e5906cf09 100644 --- a/app/code/Magento/Backend/Controller/Adminhtml/System/Store.php +++ b/app/code/Magento/Backend/Controller/Adminhtml/System/Store.php @@ -17,7 +17,7 @@ * * @author Magento Core Team */ -class Store extends Action +abstract class Store extends Action { /** * Core registry diff --git a/app/code/Magento/Backup/Controller/Adminhtml/Index.php b/app/code/Magento/Backup/Controller/Adminhtml/Index.php index c6af716bcab64..d9f11a7a2e18e 100644 --- a/app/code/Magento/Backup/Controller/Adminhtml/Index.php +++ b/app/code/Magento/Backup/Controller/Adminhtml/Index.php @@ -10,7 +10,7 @@ * * @author Magento Core Team */ -class Index extends \Magento\Backend\App\Action +abstract class Index extends \Magento\Backend\App\Action { /** * Core registry diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Category.php b/app/code/Magento/Catalog/Controller/Adminhtml/Category.php index 718bf23d4965f..f2bb5f9a03172 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Category.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Category.php @@ -8,7 +8,7 @@ /** * Catalog category controller */ -class Category extends \Magento\Backend\App\Action +abstract class Category extends \Magento\Backend\App\Action { /** * Initialize requested category and put it into registry. diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Category/Widget.php b/app/code/Magento/Catalog/Controller/Adminhtml/Category/Widget.php index 11bd3d9e83b7a..1e66bfc259deb 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Category/Widget.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Category/Widget.php @@ -12,7 +12,7 @@ * * @author Magento Core Team */ -class Widget extends \Magento\Backend\App\Action +abstract class Widget extends \Magento\Backend\App\Action { /** * @var \Magento\Framework\View\LayoutFactory diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product.php index d80a02f02aa98..ebe362ba65ad0 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Product.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product.php @@ -11,7 +11,7 @@ * Catalog product controller * @SuppressWarnings(PHPMD.NumberOfChildren) */ -class Product extends \Magento\Backend\App\Action +abstract class Product extends \Magento\Backend\App\Action { /** * @var Product\Builder diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product/AbstractProductGrid.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product/AbstractProductGrid.php index 404c82ef0b613..de7e829f6daba 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Product/AbstractProductGrid.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product/AbstractProductGrid.php @@ -10,7 +10,7 @@ use Magento\Catalog\Controller\Adminhtml\Product; use Magento\Framework\Controller\Result; -class AbstractProductGrid extends Product +abstract class AbstractProductGrid extends Product { /** * @var \Magento\Framework\View\Result\LayoutFactory diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Action/Attribute.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Action/Attribute.php index 5a1ebddaee421..e23f35f50d83a 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Action/Attribute.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Action/Attribute.php @@ -13,7 +13,7 @@ /** * Adminhtml catalog product action attribute update controller */ -class Attribute extends Action +abstract class Attribute extends Action { /** * @var \Magento\Catalog\Helper\Product\Edit\Action\Attribute diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute.php index 96612bbbe8b56..9e15c4246cc04 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute.php @@ -12,7 +12,7 @@ use Magento\Framework\Controller\Result; use Magento\Framework\View\Result\PageFactory; -class Attribute extends \Magento\Backend\App\Action +abstract class Attribute extends \Magento\Backend\App\Action { /** * @var \Magento\Framework\Cache\FrontendInterface diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Set.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Set.php index ee933b06bd55f..7074f92eb89d6 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Set.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Set.php @@ -10,7 +10,7 @@ * * @author Magento Core Team */ -class Set extends \Magento\Backend\App\Action +abstract class Set extends \Magento\Backend\App\Action { /** * Core registry diff --git a/app/code/Magento/Catalog/Controller/Product.php b/app/code/Magento/Catalog/Controller/Product.php index 9ea6777d7ce90..4fd20839f0cd6 100644 --- a/app/code/Magento/Catalog/Controller/Product.php +++ b/app/code/Magento/Catalog/Controller/Product.php @@ -10,7 +10,7 @@ use Magento\Catalog\Controller\Product\View\ViewInterface; use Magento\Catalog\Model\Product as ModelProduct; -class Product extends \Magento\Framework\App\Action\Action implements ViewInterface +abstract class Product extends \Magento\Framework\App\Action\Action implements ViewInterface { /** * Initialize requested product object diff --git a/app/code/Magento/Catalog/Controller/Product/Compare.php b/app/code/Magento/Catalog/Controller/Product/Compare.php index 89952430169bf..625dbc5c67da5 100644 --- a/app/code/Magento/Catalog/Controller/Product/Compare.php +++ b/app/code/Magento/Catalog/Controller/Product/Compare.php @@ -15,7 +15,7 @@ * @SuppressWarnings(PHPMD.LongVariable) * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ -class Compare extends \Magento\Framework\App\Action\Action +abstract class Compare extends \Magento\Framework\App\Action\Action { /** * Customer id diff --git a/app/code/Magento/CatalogRule/Controller/Adminhtml/Promo/Catalog.php b/app/code/Magento/CatalogRule/Controller/Adminhtml/Promo/Catalog.php index 3b20dec460b31..28a40fb06c944 100644 --- a/app/code/Magento/CatalogRule/Controller/Adminhtml/Promo/Catalog.php +++ b/app/code/Magento/CatalogRule/Controller/Adminhtml/Promo/Catalog.php @@ -18,7 +18,7 @@ use Magento\Framework\Registry; use Magento\Framework\Stdlib\DateTime\Filter\Date; -class Catalog extends Action +abstract class Catalog extends Action { /** * Dirty rules notice message diff --git a/app/code/Magento/CatalogRule/Controller/Adminhtml/Promo/Widget.php b/app/code/Magento/CatalogRule/Controller/Adminhtml/Promo/Widget.php index ffdd9b64c42e3..b633a81949aae 100644 --- a/app/code/Magento/CatalogRule/Controller/Adminhtml/Promo/Widget.php +++ b/app/code/Magento/CatalogRule/Controller/Adminhtml/Promo/Widget.php @@ -7,7 +7,7 @@ use Magento\Backend\App\Action; -class Widget extends Action +abstract class Widget extends Action { /** * @return bool diff --git a/app/code/Magento/CatalogWidget/Controller/Adminhtml/Product/Widget.php b/app/code/Magento/CatalogWidget/Controller/Adminhtml/Product/Widget.php index 59787a6ed2870..68a0266978f6c 100644 --- a/app/code/Magento/CatalogWidget/Controller/Adminhtml/Product/Widget.php +++ b/app/code/Magento/CatalogWidget/Controller/Adminhtml/Product/Widget.php @@ -10,7 +10,7 @@ /** * Class Widget */ -class Widget extends Action +abstract class Widget extends Action { /** * @return bool diff --git a/app/code/Magento/Checkout/Controller/Cart.php b/app/code/Magento/Checkout/Controller/Cart.php index 9aa93f99d0352..7fe2e0a10d1f3 100644 --- a/app/code/Magento/Checkout/Controller/Cart.php +++ b/app/code/Magento/Checkout/Controller/Cart.php @@ -12,7 +12,7 @@ /** * Shopping cart controller */ -class Cart extends \Magento\Framework\App\Action\Action implements ViewInterface +abstract class Cart extends \Magento\Framework\App\Action\Action implements ViewInterface { /** * @var \Magento\Framework\App\Config\ScopeConfigInterface diff --git a/app/code/Magento/Checkout/Controller/Onepage.php b/app/code/Magento/Checkout/Controller/Onepage.php index 2257347e9150b..6c93ea4bcd8b2 100644 --- a/app/code/Magento/Checkout/Controller/Onepage.php +++ b/app/code/Magento/Checkout/Controller/Onepage.php @@ -13,7 +13,7 @@ /** * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ -class Onepage extends Action +abstract class Onepage extends Action { /** * @var array diff --git a/app/code/Magento/Checkout/Test/Unit/Controller/OnepageTest.php b/app/code/Magento/Checkout/Test/Unit/Controller/OnepageTest.php index cbf0127cc37eb..659fa90754e67 100644 --- a/app/code/Magento/Checkout/Test/Unit/Controller/OnepageTest.php +++ b/app/code/Magento/Checkout/Test/Unit/Controller/OnepageTest.php @@ -85,9 +85,9 @@ protected function setUp() $context->expects($this->once()) ->method('getEventManager') ->willReturn($this->eventManager); - + $this->controller = $objectManager->getObject( - 'Magento\Checkout\Controller\Onepage', + 'Magento\Checkout\Test\Unit\Controller\Stub\OnepageStub', [ 'context' => $context ] diff --git a/app/code/Magento/Checkout/Test/Unit/Controller/Stub/OnepageStub.php b/app/code/Magento/Checkout/Test/Unit/Controller/Stub/OnepageStub.php new file mode 100644 index 0000000000000..ffad3cc12d470 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Unit/Controller/Stub/OnepageStub.php @@ -0,0 +1,12 @@ + */ -class Block extends \Magento\Backend\App\Action +abstract class Block extends \Magento\Backend\App\Action { /** * Core registry diff --git a/app/code/Magento/Cms/Controller/Adminhtml/Wysiwyg/Images.php b/app/code/Magento/Cms/Controller/Adminhtml/Wysiwyg/Images.php index 415c5fb125d8f..8b07d85db03be 100644 --- a/app/code/Magento/Cms/Controller/Adminhtml/Wysiwyg/Images.php +++ b/app/code/Magento/Cms/Controller/Adminhtml/Wysiwyg/Images.php @@ -10,7 +10,7 @@ * * @author Magento Core Team */ -class Images extends \Magento\Backend\App\Action +abstract class Images extends \Magento\Backend\App\Action { /** * Core registry diff --git a/app/code/Magento/Contact/Controller/Index.php b/app/code/Magento/Contact/Controller/Index.php index df15306308938..8a04b5b7b1d0b 100644 --- a/app/code/Magento/Contact/Controller/Index.php +++ b/app/code/Magento/Contact/Controller/Index.php @@ -12,7 +12,7 @@ /** * Contact index controller */ -class Index extends \Magento\Framework\App\Action\Action +abstract class Index extends \Magento\Framework\App\Action\Action { /** * Recipient email config path diff --git a/app/code/Magento/Contact/Test/Unit/Controller/IndexTest.php b/app/code/Magento/Contact/Test/Unit/Controller/IndexTest.php index 9db82a0300c8d..9c58e0b85b4f7 100644 --- a/app/code/Magento/Contact/Test/Unit/Controller/IndexTest.php +++ b/app/code/Magento/Contact/Test/Unit/Controller/IndexTest.php @@ -51,7 +51,7 @@ public function setUp() ) ); - $this->_controller = new \Magento\Contact\Controller\Index( + $this->_controller = new \Magento\Contact\Test\Unit\Controller\Stub\IndexStub( $context, $this->getMock('\Magento\Framework\Mail\Template\TransportBuilder', [], [], '', false), $this->getMockForAbstractClass('\Magento\Framework\Translate\Inline\StateInterface', [], '', false), diff --git a/app/code/Magento/Contact/Test/Unit/Controller/Stub/IndexStub.php b/app/code/Magento/Contact/Test/Unit/Controller/Stub/IndexStub.php new file mode 100644 index 0000000000000..df739d2b4f79d --- /dev/null +++ b/app/code/Magento/Contact/Test/Unit/Controller/Stub/IndexStub.php @@ -0,0 +1,12 @@ + */ -class Cart extends \Magento\Backend\App\Action +abstract class Cart extends \Magento\Backend\App\Action { /** * Customer we're working with diff --git a/app/code/Magento/Customer/Controller/Adminhtml/Group.php b/app/code/Magento/Customer/Controller/Adminhtml/Group.php index cfbca15cae361..7c72ecd516e29 100644 --- a/app/code/Magento/Customer/Controller/Adminhtml/Group.php +++ b/app/code/Magento/Customer/Controller/Adminhtml/Group.php @@ -11,7 +11,7 @@ /** * Customer groups controller */ -class Group extends \Magento\Backend\App\Action +abstract class Group extends \Magento\Backend\App\Action { /** * Core registry diff --git a/app/code/Magento/Customer/Controller/Adminhtml/Index.php b/app/code/Magento/Customer/Controller/Adminhtml/Index.php index 2d84f59c80f84..5520cbeab0c91 100644 --- a/app/code/Magento/Customer/Controller/Adminhtml/Index.php +++ b/app/code/Magento/Customer/Controller/Adminhtml/Index.php @@ -24,7 +24,7 @@ * @SuppressWarnings(PHPMD.TooManyFields) * @SuppressWarnings(PHPMD.NumberOfChildren) */ -class Index extends \Magento\Backend\App\Action +abstract class Index extends \Magento\Backend\App\Action { /** * @var \Magento\Framework\Validator diff --git a/app/code/Magento/Customer/Controller/Adminhtml/System/Config/Validatevat.php b/app/code/Magento/Customer/Controller/Adminhtml/System/Config/Validatevat.php index 6f7e6b7da097d..8e903542a7c1f 100644 --- a/app/code/Magento/Customer/Controller/Adminhtml/System/Config/Validatevat.php +++ b/app/code/Magento/Customer/Controller/Adminhtml/System/Config/Validatevat.php @@ -10,7 +10,7 @@ * * @author Magento Core Team */ -class Validatevat extends \Magento\Backend\App\Action +abstract class Validatevat extends \Magento\Backend\App\Action { /** * Perform customer VAT ID validation diff --git a/app/code/Magento/Customer/Controller/Adminhtml/Wishlist/Product/Composite/Wishlist.php b/app/code/Magento/Customer/Controller/Adminhtml/Wishlist/Product/Composite/Wishlist.php index 68786e84077fe..4e2fb4c9ba852 100644 --- a/app/code/Magento/Customer/Controller/Adminhtml/Wishlist/Product/Composite/Wishlist.php +++ b/app/code/Magento/Customer/Controller/Adminhtml/Wishlist/Product/Composite/Wishlist.php @@ -10,7 +10,7 @@ /** * Catalog composite product configuration controller */ -class Wishlist extends \Magento\Backend\App\Action +abstract class Wishlist extends \Magento\Backend\App\Action { /** * Wishlist we're working with. diff --git a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor.php b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor.php index 04e1ed33e8889..c92eda29dfff5 100644 --- a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor.php +++ b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor.php @@ -14,7 +14,7 @@ * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ -class Editor extends \Magento\Backend\App\Action +abstract class Editor extends \Magento\Backend\App\Action { /** * @var \Magento\Theme\Model\Config diff --git a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools.php b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools.php index 6e615c03c21d9..36dc25785e2d4 100644 --- a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools.php +++ b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools.php @@ -10,7 +10,7 @@ * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ -class Tools extends \Magento\Backend\App\Action +abstract class Tools extends \Magento\Backend\App\Action { /** * Initialize theme context model diff --git a/app/code/Magento/Downloadable/Controller/Adminhtml/Downloadable/File.php b/app/code/Magento/Downloadable/Controller/Adminhtml/Downloadable/File.php index 766e5c5d79f40..ea570b86aa269 100644 --- a/app/code/Magento/Downloadable/Controller/Adminhtml/Downloadable/File.php +++ b/app/code/Magento/Downloadable/Controller/Adminhtml/Downloadable/File.php @@ -10,7 +10,7 @@ * * @author Magento Core Team */ -class File extends \Magento\Backend\App\Action +abstract class File extends \Magento\Backend\App\Action { /** * @var \Magento\Downloadable\Model\Link diff --git a/app/code/Magento/Downloadable/Controller/Download.php b/app/code/Magento/Downloadable/Controller/Download.php index 3c6d7ac2afc27..6f6b80c1093df 100644 --- a/app/code/Magento/Downloadable/Controller/Download.php +++ b/app/code/Magento/Downloadable/Controller/Download.php @@ -12,7 +12,7 @@ * * @author Magento Core Team */ -class Download extends \Magento\Framework\App\Action\Action +abstract class Download extends \Magento\Framework\App\Action\Action { /** * Prepare response to output resource contents diff --git a/app/code/Magento/Email/Controller/Adminhtml/Email/Template.php b/app/code/Magento/Email/Controller/Adminhtml/Email/Template.php index 49bd7013f3fad..ba6fd1a82d694 100644 --- a/app/code/Magento/Email/Controller/Adminhtml/Email/Template.php +++ b/app/code/Magento/Email/Controller/Adminhtml/Email/Template.php @@ -10,7 +10,7 @@ * * @author Magento Core Team */ -class Template extends \Magento\Backend\App\Action +abstract class Template extends \Magento\Backend\App\Action { /** * Core registry diff --git a/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Items.php b/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Items.php index 0ec30477e3866..c73a32938c048 100644 --- a/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Items.php +++ b/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Items.php @@ -12,7 +12,7 @@ /** * GoogleShopping Admin Items Controller */ -class Items extends \Magento\Backend\App\Action +abstract class Items extends \Magento\Backend\App\Action { /** * @var NotifierInterface diff --git a/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Types.php b/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Types.php index 068fa2cdf168f..6ad795d2a9045 100644 --- a/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Types.php +++ b/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Types.php @@ -10,7 +10,7 @@ /** * GoogleShopping Admin Item Types Controller */ -class Types extends \Magento\Backend\App\Action +abstract class Types extends \Magento\Backend\App\Action { /** * Core registry diff --git a/app/code/Magento/ImportExport/Controller/Adminhtml/Export.php b/app/code/Magento/ImportExport/Controller/Adminhtml/Export.php index d6efeb305fb49..fe8b1ccc9ca39 100644 --- a/app/code/Magento/ImportExport/Controller/Adminhtml/Export.php +++ b/app/code/Magento/ImportExport/Controller/Adminhtml/Export.php @@ -10,7 +10,7 @@ /** * Export controller */ -class Export extends Action +abstract class Export extends Action { /** * Check access (in the ACL) for current user diff --git a/app/code/Magento/ImportExport/Controller/Adminhtml/Import.php b/app/code/Magento/ImportExport/Controller/Adminhtml/Import.php index a9ea50ef17e2f..319bef1a9cd42 100644 --- a/app/code/Magento/ImportExport/Controller/Adminhtml/Import.php +++ b/app/code/Magento/ImportExport/Controller/Adminhtml/Import.php @@ -10,7 +10,7 @@ /** * Import controller */ -class Import extends Action +abstract class Import extends Action { /** * Check access (in the ACL) for current user. diff --git a/app/code/Magento/Indexer/Controller/Adminhtml/Indexer.php b/app/code/Magento/Indexer/Controller/Adminhtml/Indexer.php index 3f19af76b4155..fc8c405e1479f 100644 --- a/app/code/Magento/Indexer/Controller/Adminhtml/Indexer.php +++ b/app/code/Magento/Indexer/Controller/Adminhtml/Indexer.php @@ -5,7 +5,7 @@ */ namespace Magento\Indexer\Controller\Adminhtml; -class Indexer extends \Magento\Backend\App\Action +abstract class Indexer extends \Magento\Backend\App\Action { /** * Check ACL permissions diff --git a/app/code/Magento/Integration/Controller/Adminhtml/Integration.php b/app/code/Magento/Integration/Controller/Adminhtml/Integration.php index b1db3f9779ef8..7b3e2dc7a0349 100644 --- a/app/code/Magento/Integration/Controller/Adminhtml/Integration.php +++ b/app/code/Magento/Integration/Controller/Adminhtml/Integration.php @@ -13,7 +13,7 @@ * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ -class Integration extends Action +abstract class Integration extends Action { /** Param Key for extracting integration id from Request */ const PARAM_INTEGRATION_ID = 'id'; diff --git a/app/code/Magento/MediaStorage/Controller/Adminhtml/System/Config/System/Storage.php b/app/code/Magento/MediaStorage/Controller/Adminhtml/System/Config/System/Storage.php index 0ea5d4aad0b58..6bce322560df4 100644 --- a/app/code/Magento/MediaStorage/Controller/Adminhtml/System/Config/System/Storage.php +++ b/app/code/Magento/MediaStorage/Controller/Adminhtml/System/Config/System/Storage.php @@ -11,7 +11,7 @@ */ namespace Magento\MediaStorage\Controller\Adminhtml\System\Config\System; -class Storage extends \Magento\Backend\App\Action +abstract class Storage extends \Magento\Backend\App\Action { /** * Return file storage singleton diff --git a/app/code/Magento/Multishipping/Controller/Checkout.php b/app/code/Magento/Multishipping/Controller/Checkout.php index ded1bf1b30821..fe17a4b02943b 100644 --- a/app/code/Magento/Multishipping/Controller/Checkout.php +++ b/app/code/Magento/Multishipping/Controller/Checkout.php @@ -13,7 +13,7 @@ * Multishipping checkout controller * @SuppressWarnings(PHPMD.NumberOfChildren) */ -class Checkout extends \Magento\Checkout\Controller\Action implements +abstract class Checkout extends \Magento\Checkout\Controller\Action implements \Magento\Checkout\Controller\Express\RedirectLoginInterface { /** diff --git a/app/code/Magento/Multishipping/Controller/Checkout/Address.php b/app/code/Magento/Multishipping/Controller/Checkout/Address.php index d18261d0b20c3..41f7377c58773 100644 --- a/app/code/Magento/Multishipping/Controller/Checkout/Address.php +++ b/app/code/Magento/Multishipping/Controller/Checkout/Address.php @@ -8,7 +8,7 @@ /** * Multishipping checkout address manipulation controller */ -class Address extends \Magento\Framework\App\Action\Action +abstract class Address extends \Magento\Framework\App\Action\Action { /** * {@inheritdoc} diff --git a/app/code/Magento/Newsletter/Controller/Adminhtml/Problem.php b/app/code/Magento/Newsletter/Controller/Adminhtml/Problem.php index 8358e1e47d2e4..4ce88d0fb74f4 100644 --- a/app/code/Magento/Newsletter/Controller/Adminhtml/Problem.php +++ b/app/code/Magento/Newsletter/Controller/Adminhtml/Problem.php @@ -8,7 +8,7 @@ /** * Newsletter subscribers controller */ -class Problem extends \Magento\Backend\App\Action +abstract class Problem extends \Magento\Backend\App\Action { /** * Check if user has enough privileges diff --git a/app/code/Magento/Newsletter/Controller/Adminhtml/Queue.php b/app/code/Magento/Newsletter/Controller/Adminhtml/Queue.php index 7ff875cda6219..edfbd7192a48c 100644 --- a/app/code/Magento/Newsletter/Controller/Adminhtml/Queue.php +++ b/app/code/Magento/Newsletter/Controller/Adminhtml/Queue.php @@ -11,7 +11,7 @@ */ namespace Magento\Newsletter\Controller\Adminhtml; -class Queue extends \Magento\Backend\App\Action +abstract class Queue extends \Magento\Backend\App\Action { /** * Check if user has enough privileges diff --git a/app/code/Magento/Newsletter/Controller/Adminhtml/Subscriber.php b/app/code/Magento/Newsletter/Controller/Adminhtml/Subscriber.php index e10db3516c373..5c18a5c717a2b 100644 --- a/app/code/Magento/Newsletter/Controller/Adminhtml/Subscriber.php +++ b/app/code/Magento/Newsletter/Controller/Adminhtml/Subscriber.php @@ -8,7 +8,7 @@ /** * Newsletter subscribers controller */ -class Subscriber extends \Magento\Backend\App\Action +abstract class Subscriber extends \Magento\Backend\App\Action { /** * @var \Magento\Framework\App\Response\Http\FileFactory diff --git a/app/code/Magento/Newsletter/Controller/Adminhtml/Template.php b/app/code/Magento/Newsletter/Controller/Adminhtml/Template.php index 51d30793ad50e..10752db660c07 100644 --- a/app/code/Magento/Newsletter/Controller/Adminhtml/Template.php +++ b/app/code/Magento/Newsletter/Controller/Adminhtml/Template.php @@ -10,7 +10,7 @@ */ namespace Magento\Newsletter\Controller\Adminhtml; -class Template extends \Magento\Backend\App\Action +abstract class Template extends \Magento\Backend\App\Action { /** * Check is allowed access diff --git a/app/code/Magento/Newsletter/Controller/Manage.php b/app/code/Magento/Newsletter/Controller/Manage.php index 5083ade552674..f014dab1e1f0d 100644 --- a/app/code/Magento/Newsletter/Controller/Manage.php +++ b/app/code/Magento/Newsletter/Controller/Manage.php @@ -10,7 +10,7 @@ /** * Customers newsletter subscription controller */ -class Manage extends \Magento\Framework\App\Action\Action +abstract class Manage extends \Magento\Framework\App\Action\Action { /** * Customer session diff --git a/app/code/Magento/Newsletter/Controller/Subscriber.php b/app/code/Magento/Newsletter/Controller/Subscriber.php index ecebc482b444e..d68f69422585a 100644 --- a/app/code/Magento/Newsletter/Controller/Subscriber.php +++ b/app/code/Magento/Newsletter/Controller/Subscriber.php @@ -15,7 +15,7 @@ use Magento\Newsletter\Model\SubscriberFactory; use Magento\Customer\Model\Url as CustomerUrl; -class Subscriber extends \Magento\Framework\App\Action\Action +abstract class Subscriber extends \Magento\Framework\App\Action\Action { /** * Customer session diff --git a/app/code/Magento/PageCache/Controller/Block.php b/app/code/Magento/PageCache/Controller/Block.php index 4189e3c9b92ad..8f9dc2940c7a7 100644 --- a/app/code/Magento/PageCache/Controller/Block.php +++ b/app/code/Magento/PageCache/Controller/Block.php @@ -7,7 +7,7 @@ */ namespace Magento\PageCache\Controller; -class Block extends \Magento\Framework\App\Action\Action +abstract class Block extends \Magento\Framework\App\Action\Action { /** * @var \Magento\Framework\Translate\InlineInterface diff --git a/app/code/Magento/Persistent/Controller/Index.php b/app/code/Magento/Persistent/Controller/Index.php index 69e283a403112..1663b9f3f81d1 100644 --- a/app/code/Magento/Persistent/Controller/Index.php +++ b/app/code/Magento/Persistent/Controller/Index.php @@ -15,7 +15,7 @@ /** * Persistent front controller */ -class Index extends Action +abstract class Index extends Action { /** * Persistent observer diff --git a/app/code/Magento/ProductAlert/Controller/Add.php b/app/code/Magento/ProductAlert/Controller/Add.php index 84e5f47fe8b6d..6ede2a9cc5780 100644 --- a/app/code/Magento/ProductAlert/Controller/Add.php +++ b/app/code/Magento/ProductAlert/Controller/Add.php @@ -10,7 +10,7 @@ use Magento\Customer\Model\Session as CustomerSession; use Magento\Framework\App\RequestInterface; -class Add extends Action +abstract class Add extends Action { /** * @var \Magento\Customer\Model\Session diff --git a/app/code/Magento/ProductAlert/Controller/Unsubscribe.php b/app/code/Magento/ProductAlert/Controller/Unsubscribe.php index 123ff3e826102..d910062e34e9a 100644 --- a/app/code/Magento/ProductAlert/Controller/Unsubscribe.php +++ b/app/code/Magento/ProductAlert/Controller/Unsubscribe.php @@ -5,6 +5,6 @@ */ namespace Magento\ProductAlert\Controller; -class Unsubscribe extends Add +abstract class Unsubscribe extends Add { } diff --git a/app/code/Magento/Reports/Controller/Adminhtml/Index.php b/app/code/Magento/Reports/Controller/Adminhtml/Index.php index 51a122b451b3d..e6d7330ec4a9e 100644 --- a/app/code/Magento/Reports/Controller/Adminhtml/Index.php +++ b/app/code/Magento/Reports/Controller/Adminhtml/Index.php @@ -11,7 +11,7 @@ */ namespace Magento\Reports\Controller\Adminhtml; -class Index extends \Magento\Backend\App\Action +abstract class Index extends \Magento\Backend\App\Action { /** * @var \Magento\Framework\App\Response\Http\FileFactory diff --git a/app/code/Magento/Reports/Controller/Adminhtml/Report/Customer.php b/app/code/Magento/Reports/Controller/Adminhtml/Report/Customer.php index fef0913a88a82..f7cdbed596854 100644 --- a/app/code/Magento/Reports/Controller/Adminhtml/Report/Customer.php +++ b/app/code/Magento/Reports/Controller/Adminhtml/Report/Customer.php @@ -12,7 +12,7 @@ */ namespace Magento\Reports\Controller\Adminhtml\Report; -class Customer extends \Magento\Backend\App\Action +abstract class Customer extends \Magento\Backend\App\Action { /** * @var \Magento\Framework\App\Response\Http\FileFactory diff --git a/app/code/Magento/Reports/Controller/Adminhtml/Report/Product.php b/app/code/Magento/Reports/Controller/Adminhtml/Report/Product.php index d47b388b4e903..2c8fbff08daae 100644 --- a/app/code/Magento/Reports/Controller/Adminhtml/Report/Product.php +++ b/app/code/Magento/Reports/Controller/Adminhtml/Report/Product.php @@ -11,7 +11,7 @@ */ namespace Magento\Reports\Controller\Adminhtml\Report; -class Product extends AbstractReport +abstract class Product extends AbstractReport { /** * Add report/products breadcrumbs diff --git a/app/code/Magento/Reports/Controller/Adminhtml/Report/Review.php b/app/code/Magento/Reports/Controller/Adminhtml/Report/Review.php index c01c3b5657d8b..abb09b9c3023d 100644 --- a/app/code/Magento/Reports/Controller/Adminhtml/Report/Review.php +++ b/app/code/Magento/Reports/Controller/Adminhtml/Report/Review.php @@ -11,7 +11,7 @@ */ namespace Magento\Reports\Controller\Adminhtml\Report; -class Review extends \Magento\Backend\App\Action +abstract class Review extends \Magento\Backend\App\Action { /** * @var \Magento\Framework\App\Response\Http\FileFactory diff --git a/app/code/Magento/Reports/Controller/Adminhtml/Report/Sales.php b/app/code/Magento/Reports/Controller/Adminhtml/Report/Sales.php index cbb4b377759a9..98626a1529808 100644 --- a/app/code/Magento/Reports/Controller/Adminhtml/Report/Sales.php +++ b/app/code/Magento/Reports/Controller/Adminhtml/Report/Sales.php @@ -14,7 +14,7 @@ /** * @SuppressWarnings(PHPMD.NumberOfChildren) */ -class Sales extends AbstractReport +abstract class Sales extends AbstractReport { /** * Add report/sales breadcrumbs diff --git a/app/code/Magento/Reports/Controller/Adminhtml/Report/Shopcart.php b/app/code/Magento/Reports/Controller/Adminhtml/Report/Shopcart.php index 0bedb3749518c..46403c071cc1c 100644 --- a/app/code/Magento/Reports/Controller/Adminhtml/Report/Shopcart.php +++ b/app/code/Magento/Reports/Controller/Adminhtml/Report/Shopcart.php @@ -11,7 +11,7 @@ */ namespace Magento\Reports\Controller\Adminhtml\Report; -class Shopcart extends \Magento\Backend\App\Action +abstract class Shopcart extends \Magento\Backend\App\Action { /** * @var \Magento\Framework\App\Response\Http\FileFactory diff --git a/app/code/Magento/Reports/Controller/Adminhtml/Report/Statistics.php b/app/code/Magento/Reports/Controller/Adminhtml/Report/Statistics.php index 7de4649499c06..1cda57a4e3f76 100644 --- a/app/code/Magento/Reports/Controller/Adminhtml/Report/Statistics.php +++ b/app/code/Magento/Reports/Controller/Adminhtml/Report/Statistics.php @@ -14,7 +14,7 @@ use Magento\Backend\Model\Auth\Session as AuthSession; use Magento\Backend\Model\Session; -class Statistics extends \Magento\Backend\App\Action +abstract class Statistics extends \Magento\Backend\App\Action { /** * Admin session model diff --git a/app/code/Magento/Review/Controller/Adminhtml/Product.php b/app/code/Magento/Review/Controller/Adminhtml/Product.php index fcb0c4e648857..f729f55e78838 100644 --- a/app/code/Magento/Review/Controller/Adminhtml/Product.php +++ b/app/code/Magento/Review/Controller/Adminhtml/Product.php @@ -14,7 +14,7 @@ /** * Reviews admin controller */ -class Product extends Action +abstract class Product extends Action { /** * Array of actions which can be processed without secret key validation diff --git a/app/code/Magento/Review/Controller/Adminhtml/Rating.php b/app/code/Magento/Review/Controller/Adminhtml/Rating.php index e4b0fb63d8fa3..2bd4bda930a14 100644 --- a/app/code/Magento/Review/Controller/Adminhtml/Rating.php +++ b/app/code/Magento/Review/Controller/Adminhtml/Rating.php @@ -12,7 +12,7 @@ /** * Admin ratings controller */ -class Rating extends Action +abstract class Rating extends Action { /** * Core registry diff --git a/app/code/Magento/Review/Controller/Customer.php b/app/code/Magento/Review/Controller/Customer.php index 034fc91c0684d..6ed9d0599108e 100644 --- a/app/code/Magento/Review/Controller/Customer.php +++ b/app/code/Magento/Review/Controller/Customer.php @@ -13,7 +13,7 @@ /** * Customer reviews controller */ -class Customer extends Action +abstract class Customer extends Action { /** * Customer session model diff --git a/app/code/Magento/Review/Controller/Product.php b/app/code/Magento/Review/Controller/Product.php index f0af2ede6e4d5..a0137ef07b98c 100644 --- a/app/code/Magento/Review/Controller/Product.php +++ b/app/code/Magento/Review/Controller/Product.php @@ -15,7 +15,7 @@ * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ -class Product extends \Magento\Framework\App\Action\Action +abstract class Product extends \Magento\Framework\App\Action\Action { /** * Core registry diff --git a/app/code/Magento/Rss/Controller/Adminhtml/Feed.php b/app/code/Magento/Rss/Controller/Adminhtml/Feed.php index cf98bd5737338..bf371c686a44b 100644 --- a/app/code/Magento/Rss/Controller/Adminhtml/Feed.php +++ b/app/code/Magento/Rss/Controller/Adminhtml/Feed.php @@ -9,7 +9,7 @@ * Class Feed * @package Magento\Rss\Controller */ -class Feed extends \Magento\Backend\App\Action +abstract class Feed extends \Magento\Backend\App\Action { /** * @var \Magento\Rss\Model\RssManager diff --git a/app/code/Magento/Rss/Controller/Feed.php b/app/code/Magento/Rss/Controller/Feed.php index d017be7cc9690..6d7c9dfc300fa 100644 --- a/app/code/Magento/Rss/Controller/Feed.php +++ b/app/code/Magento/Rss/Controller/Feed.php @@ -8,7 +8,7 @@ /** * Class Feed */ -class Feed extends \Magento\Framework\App\Action\Action +abstract class Feed extends \Magento\Framework\App\Action\Action { /** * @var \Magento\Customer\Model\Session diff --git a/app/code/Magento/Rss/Controller/Index.php b/app/code/Magento/Rss/Controller/Index.php index 846f631f0cacf..82590b0e48e0a 100644 --- a/app/code/Magento/Rss/Controller/Index.php +++ b/app/code/Magento/Rss/Controller/Index.php @@ -9,7 +9,7 @@ * Class Index * @package Magento\Rss\Controller */ -class Index extends \Magento\Framework\App\Action\Action +abstract class Index extends \Magento\Framework\App\Action\Action { /** * @var \Magento\Framework\App\Config\ScopeConfigInterface diff --git a/app/code/Magento/Sales/Controller/Adminhtml/Order.php b/app/code/Magento/Sales/Controller/Adminhtml/Order.php index 4685341ddef97..274800bb1bd00 100644 --- a/app/code/Magento/Sales/Controller/Adminhtml/Order.php +++ b/app/code/Magento/Sales/Controller/Adminhtml/Order.php @@ -13,7 +13,7 @@ * @author Magento Core Team * @SuppressWarnings(PHPMD.NumberOfChildren) */ -class Order extends \Magento\Backend\App\Action +abstract class Order extends \Magento\Backend\App\Action { /** * Array of actions which can be processed without secret key validation diff --git a/app/code/Magento/Sales/Controller/Adminhtml/Order/Create.php b/app/code/Magento/Sales/Controller/Adminhtml/Order/Create.php index 54fcd049b388a..53c999b0f05c8 100644 --- a/app/code/Magento/Sales/Controller/Adminhtml/Order/Create.php +++ b/app/code/Magento/Sales/Controller/Adminhtml/Order/Create.php @@ -15,7 +15,7 @@ * @author Magento Core Team * @SuppressWarnings(PHPMD.NumberOfChildren) */ -class Create extends \Magento\Backend\App\Action +abstract class Create extends \Magento\Backend\App\Action { /** * @var \Magento\Framework\Escaper diff --git a/app/code/Magento/Sales/Controller/Adminhtml/Order/Status.php b/app/code/Magento/Sales/Controller/Adminhtml/Order/Status.php index 1fb0d8f3c6463..c819f9708aca5 100644 --- a/app/code/Magento/Sales/Controller/Adminhtml/Order/Status.php +++ b/app/code/Magento/Sales/Controller/Adminhtml/Order/Status.php @@ -8,7 +8,7 @@ /** * Order status management controller */ -class Status extends \Magento\Backend\App\Action +abstract class Status extends \Magento\Backend\App\Action { /** * Core registry diff --git a/app/code/Magento/Sales/Controller/Adminhtml/Order/View/Giftmessage.php b/app/code/Magento/Sales/Controller/Adminhtml/Order/View/Giftmessage.php index 7b97ef542baa7..a7a57bea4c561 100644 --- a/app/code/Magento/Sales/Controller/Adminhtml/Order/View/Giftmessage.php +++ b/app/code/Magento/Sales/Controller/Adminhtml/Order/View/Giftmessage.php @@ -10,7 +10,7 @@ * * @author Magento Core Team */ -class Giftmessage extends \Magento\Backend\App\Action +abstract class Giftmessage extends \Magento\Backend\App\Action { /** * Retrieve gift message save model diff --git a/app/code/Magento/Sales/Controller/Adminhtml/Transactions.php b/app/code/Magento/Sales/Controller/Adminhtml/Transactions.php index 49b910be6a862..731b4e2ac6cd9 100644 --- a/app/code/Magento/Sales/Controller/Adminhtml/Transactions.php +++ b/app/code/Magento/Sales/Controller/Adminhtml/Transactions.php @@ -15,7 +15,7 @@ * * @author Magento Core Team */ -class Transactions extends \Magento\Backend\App\Action +abstract class Transactions extends \Magento\Backend\App\Action { /** * Core registry diff --git a/app/code/Magento/SalesRule/Controller/Adminhtml/Promo/Quote.php b/app/code/Magento/SalesRule/Controller/Adminhtml/Promo/Quote.php index 69109644664ad..95a4e519357f2 100644 --- a/app/code/Magento/SalesRule/Controller/Adminhtml/Promo/Quote.php +++ b/app/code/Magento/SalesRule/Controller/Adminhtml/Promo/Quote.php @@ -5,7 +5,7 @@ */ namespace Magento\SalesRule\Controller\Adminhtml\Promo; -class Quote extends \Magento\Backend\App\Action +abstract class Quote extends \Magento\Backend\App\Action { /** * Core registry diff --git a/app/code/Magento/Search/Controller/Adminhtml/Term.php b/app/code/Magento/Search/Controller/Adminhtml/Term.php index f1dcba98250a1..e383744f22abd 100644 --- a/app/code/Magento/Search/Controller/Adminhtml/Term.php +++ b/app/code/Magento/Search/Controller/Adminhtml/Term.php @@ -8,7 +8,7 @@ use Magento\Backend\App\Action; use Magento\Framework\Controller\ResultFactory; -class Term extends Action +abstract class Term extends Action { /** * @return \Magento\Backend\Model\View\Result\Page diff --git a/app/code/Magento/SendFriend/Controller/Product.php b/app/code/Magento/SendFriend/Controller/Product.php index 34f2fe324b804..5da1b89021fc2 100644 --- a/app/code/Magento/SendFriend/Controller/Product.php +++ b/app/code/Magento/SendFriend/Controller/Product.php @@ -14,7 +14,7 @@ * * @author Magento Core Team */ -class Product extends \Magento\Framework\App\Action\Action +abstract class Product extends \Magento\Framework\App\Action\Action { /** * Core registry diff --git a/app/code/Magento/Sitemap/Controller/Adminhtml/Sitemap.php b/app/code/Magento/Sitemap/Controller/Adminhtml/Sitemap.php index 2f62ee2c03a4a..432f8e59752da 100644 --- a/app/code/Magento/Sitemap/Controller/Adminhtml/Sitemap.php +++ b/app/code/Magento/Sitemap/Controller/Adminhtml/Sitemap.php @@ -8,7 +8,7 @@ /** * XML sitemap controller */ -class Sitemap extends \Magento\Backend\App\Action +abstract class Sitemap extends \Magento\Backend\App\Action { /** * Init actions diff --git a/app/code/Magento/Tax/Controller/Adminhtml/Rate.php b/app/code/Magento/Tax/Controller/Adminhtml/Rate.php index e25e0a19a87a2..b61aec6b2269a 100644 --- a/app/code/Magento/Tax/Controller/Adminhtml/Rate.php +++ b/app/code/Magento/Tax/Controller/Adminhtml/Rate.php @@ -13,7 +13,7 @@ * * @author Magento Core Team */ -class Rate extends \Magento\Backend\App\Action +abstract class Rate extends \Magento\Backend\App\Action { /** * @var \Magento\Framework\Registry diff --git a/app/code/Magento/Tax/Controller/Adminhtml/Rule.php b/app/code/Magento/Tax/Controller/Adminhtml/Rule.php index f4a88b5f03665..281e34fa06039 100644 --- a/app/code/Magento/Tax/Controller/Adminhtml/Rule.php +++ b/app/code/Magento/Tax/Controller/Adminhtml/Rule.php @@ -14,7 +14,7 @@ use Magento\Backend\App\Action; use Magento\Framework\Controller\ResultFactory; -class Rule extends \Magento\Backend\App\Action +abstract class Rule extends \Magento\Backend\App\Action { /** * Core registry diff --git a/app/code/Magento/Tax/Controller/Adminhtml/Tax.php b/app/code/Magento/Tax/Controller/Adminhtml/Tax.php index 43c9296a8f1ce..ad646cd0eae59 100644 --- a/app/code/Magento/Tax/Controller/Adminhtml/Tax.php +++ b/app/code/Magento/Tax/Controller/Adminhtml/Tax.php @@ -13,7 +13,7 @@ * * @author Magento Core Team */ -class Tax extends \Magento\Backend\App\Action +abstract class Tax extends \Magento\Backend\App\Action { /** * @var \Magento\Tax\Api\TaxClassRepositoryInterface diff --git a/app/code/Magento/Tax/Test/Unit/App/Action/ContextPluginTest.php b/app/code/Magento/Tax/Test/Unit/App/Action/ContextPluginTest.php index 66ad1afdbcad9..24c10c5040bc7 100644 --- a/app/code/Magento/Tax/Test/Unit/App/Action/ContextPluginTest.php +++ b/app/code/Magento/Tax/Test/Unit/App/Action/ContextPluginTest.php @@ -123,7 +123,7 @@ public function testAroundDispatch() ->method('setValue') ->with('tax_rates', [], 0); - $action = $this->objectManager->getObject('Magento\Framework\App\Action\Action'); + $action = $this->objectManager->getObject('Magento\Tax\Test\Unit\App\Action\Stub\ActionStub'); $request = $this->getMock('\Magento\Framework\App\Request\Http', ['getActionName'], [], '', false); $expectedResult = 'expectedResult'; $proceed = function ($request) use ($expectedResult) { diff --git a/app/code/Magento/Tax/Test/Unit/App/Action/Stub/ActionStub.php b/app/code/Magento/Tax/Test/Unit/App/Action/Stub/ActionStub.php new file mode 100644 index 0000000000000..142d24da60c51 --- /dev/null +++ b/app/code/Magento/Tax/Test/Unit/App/Action/Stub/ActionStub.php @@ -0,0 +1,12 @@ +factory = $factory; } - /** - * Execute action - * - * @return mixed - */ - abstract public function execute(); - /** * Getting name * @@ -56,4 +49,14 @@ protected function getComponent() { return $this->_request->getParam('component'); } + + /** + * Action for AJAX request + * + * @return void + */ + public function executeAjaxRequest() + { + $this->execute(); + } } diff --git a/app/code/Magento/Ui/Controller/Adminhtml/Bookmark/Delete.php b/app/code/Magento/Ui/Controller/Adminhtml/Bookmark/Delete.php index 721e43d75794b..6a2bdccd51030 100644 --- a/app/code/Magento/Ui/Controller/Adminhtml/Bookmark/Delete.php +++ b/app/code/Magento/Ui/Controller/Adminhtml/Bookmark/Delete.php @@ -48,7 +48,7 @@ public function __construct( * * @return void */ - public function execute() + protected function execute() { $viewIds = explode('.', $this->_request->getParam('data')); $bookmark = $this->bookmarkManagement->getByIdentifierNamespace( diff --git a/app/code/Magento/Ui/Controller/Adminhtml/Bookmark/Save.php b/app/code/Magento/Ui/Controller/Adminhtml/Bookmark/Save.php index f959e11ae83c8..4ec0b0891f987 100644 --- a/app/code/Magento/Ui/Controller/Adminhtml/Bookmark/Save.php +++ b/app/code/Magento/Ui/Controller/Adminhtml/Bookmark/Save.php @@ -71,7 +71,7 @@ public function __construct( * * @return void */ - public function execute() + protected function execute() { $bookmark = $this->bookmarkFactory->create(); $data = $this->_request->getParam('data'); diff --git a/app/code/Magento/Ui/Controller/Adminhtml/Index/Render.php b/app/code/Magento/Ui/Controller/Adminhtml/Index/Render.php index 01d7d0d4f09b3..bd431cf33f4fe 100644 --- a/app/code/Magento/Ui/Controller/Adminhtml/Index/Render.php +++ b/app/code/Magento/Ui/Controller/Adminhtml/Index/Render.php @@ -20,7 +20,7 @@ class Render extends AbstractAction * * @return void */ - public function execute() + protected function execute() { $component = $this->factory->create($this->_request->getParam('namespace')); $this->prepareComponent($component); diff --git a/app/code/Magento/Ui/Controller/UiActionInterface.php b/app/code/Magento/Ui/Controller/UiActionInterface.php index 53932aba49cce..5ffcaa2f04a85 100644 --- a/app/code/Magento/Ui/Controller/UiActionInterface.php +++ b/app/code/Magento/Ui/Controller/UiActionInterface.php @@ -15,5 +15,5 @@ interface UiActionInterface * * @return mixed */ - public function execute(); + public function executeAjaxRequest(); } diff --git a/app/code/Magento/Ui/Test/Unit/Controller/Adminhtml/Index/RenderTest.php b/app/code/Magento/Ui/Test/Unit/Controller/Adminhtml/Index/RenderTest.php index e1aaf97d8ca46..1fa39194f11f0 100644 --- a/app/code/Magento/Ui/Test/Unit/Controller/Adminhtml/Index/RenderTest.php +++ b/app/code/Magento/Ui/Test/Unit/Controller/Adminhtml/Index/RenderTest.php @@ -56,7 +56,7 @@ public function setUp() $this->render = new Render($contextMock, $this->uiFactoryMock); } - public function testExecute() + public function testExecuteAjaxRequest() { $name = 'test-name'; $renderedData = 'data'; @@ -94,6 +94,6 @@ public function testExecute() ->method('create') ->willReturn($viewMock); - $this->render->execute(); + $this->render->executeAjaxRequest(); } } diff --git a/app/code/Magento/UrlRewrite/Controller/Adminhtml/Url/Rewrite.php b/app/code/Magento/UrlRewrite/Controller/Adminhtml/Url/Rewrite.php index 1e6692d182056..b2a967beb0328 100644 --- a/app/code/Magento/UrlRewrite/Controller/Adminhtml/Url/Rewrite.php +++ b/app/code/Magento/UrlRewrite/Controller/Adminhtml/Url/Rewrite.php @@ -12,7 +12,7 @@ /** * URL rewrite adminhtml controller */ -class Rewrite extends Action +abstract class Rewrite extends Action { /**#@+ * Entity types diff --git a/app/code/Magento/User/Controller/Adminhtml/Auth.php b/app/code/Magento/User/Controller/Adminhtml/Auth.php index 4d2231f2092d8..5ca647ef8e061 100644 --- a/app/code/Magento/User/Controller/Adminhtml/Auth.php +++ b/app/code/Magento/User/Controller/Adminhtml/Auth.php @@ -8,7 +8,7 @@ /** * \Magento\User Auth controller */ -class Auth extends \Magento\Backend\App\AbstractAction +abstract class Auth extends \Magento\Backend\App\AbstractAction { /** * User model factory diff --git a/app/code/Magento/User/Controller/Adminhtml/User.php b/app/code/Magento/User/Controller/Adminhtml/User.php index 5759726c7442d..d2b4bc9f8e88c 100644 --- a/app/code/Magento/User/Controller/Adminhtml/User.php +++ b/app/code/Magento/User/Controller/Adminhtml/User.php @@ -5,7 +5,7 @@ */ namespace Magento\User\Controller\Adminhtml; -class User extends \Magento\Backend\App\AbstractAction +abstract class User extends \Magento\Backend\App\AbstractAction { /** * Core registry diff --git a/app/code/Magento/User/Controller/Adminhtml/User/Role.php b/app/code/Magento/User/Controller/Adminhtml/User/Role.php index bfbb6d53a02e1..61e6abc2e3a8e 100644 --- a/app/code/Magento/User/Controller/Adminhtml/User/Role.php +++ b/app/code/Magento/User/Controller/Adminhtml/User/Role.php @@ -7,7 +7,7 @@ use Magento\Authorization\Model\Acl\Role\Group as RoleGroup; -class Role extends \Magento\Backend\App\AbstractAction +abstract class Role extends \Magento\Backend\App\AbstractAction { /** * Core registry diff --git a/app/code/Magento/Variable/Controller/Adminhtml/System/Variable.php b/app/code/Magento/Variable/Controller/Adminhtml/System/Variable.php index 918e6094d9b7e..2e90402ab1adb 100644 --- a/app/code/Magento/Variable/Controller/Adminhtml/System/Variable.php +++ b/app/code/Magento/Variable/Controller/Adminhtml/System/Variable.php @@ -12,7 +12,7 @@ * * @author Magento Core Team */ -class Variable extends Action +abstract class Variable extends Action { /** * Core registry diff --git a/app/code/Magento/Widget/Controller/Adminhtml/Widget/Instance.php b/app/code/Magento/Widget/Controller/Adminhtml/Widget/Instance.php index 15b4151279fd9..7596c741a0163 100644 --- a/app/code/Magento/Widget/Controller/Adminhtml/Widget/Instance.php +++ b/app/code/Magento/Widget/Controller/Adminhtml/Widget/Instance.php @@ -9,7 +9,7 @@ */ namespace Magento\Widget\Controller\Adminhtml\Widget; -class Instance extends \Magento\Backend\App\Action +abstract class Instance extends \Magento\Backend\App\Action { /** * Core registry diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Helper/Product/Stub/ProductControllerStub.php b/dev/tests/integration/testsuite/Magento/Catalog/Helper/Product/Stub/ProductControllerStub.php new file mode 100644 index 0000000000000..2aa856f593541 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/Helper/Product/Stub/ProductControllerStub.php @@ -0,0 +1,11 @@ +objectManager->create('Magento\Framework\App\Action\Context', $arguments); $this->_controller = $this->objectManager->create( - 'Magento\Catalog\Controller\Product', + 'Magento\Catalog\Helper\Product\Stub\ProductControllerStub', ['context' => $context] ); $resultPageFactory = $this->objectManager->get('Magento\Framework\View\Result\PageFactory'); @@ -126,7 +126,7 @@ public function testPrepareAndRender() public function testPrepareAndRenderWrongController() { $objectManager = $this->objectManager; - $controller = $objectManager->create('Magento\Catalog\Controller\Product'); + $controller = $objectManager->create('Magento\Catalog\Helper\Product\Stub\ProductControllerStub'); $this->_helper->prepareAndRender($this->page, 10, $controller); } diff --git a/dev/tests/integration/testsuite/Magento/Cms/Helper/PageTest.php b/dev/tests/integration/testsuite/Magento/Cms/Helper/PageTest.php index 8a486813071ca..e770f3234a679 100755 --- a/dev/tests/integration/testsuite/Magento/Cms/Helper/PageTest.php +++ b/dev/tests/integration/testsuite/Magento/Cms/Helper/PageTest.php @@ -38,7 +38,7 @@ public function testRenderPage() $pageHelper = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Cms\Helper\Page'); $result = $pageHelper->prepareResultPage( \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - 'Magento\Framework\App\Action\Action', + 'Magento\Cms\Helper\Stub\ActionStub', ['context' => $context] ), $page->getId() diff --git a/dev/tests/integration/testsuite/Magento/Cms/Helper/Stub/ActionStub.php b/dev/tests/integration/testsuite/Magento/Cms/Helper/Stub/ActionStub.php new file mode 100644 index 0000000000000..64bb0fb36d219 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Cms/Helper/Stub/ActionStub.php @@ -0,0 +1,11 @@ +_objectManager->get('Magento\Backend\Model\Session\Quote')->setReordered($reordered); - $orderController = $this->_objectManager->get('Magento\Sales\Controller\Adminhtml\Order\Create'); + $orderController = $this->_objectManager->get( + 'Magento\Sales\Controller\Adminhtml\Order\Stub\OrderCreateStub' + ); $this->getRequest()->setActionName($actionName); diff --git a/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Stub/OrderCreateStub.php b/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Stub/OrderCreateStub.php new file mode 100644 index 0000000000000..faf85c25569a4 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Stub/OrderCreateStub.php @@ -0,0 +1,11 @@ +_response; } + /** + * @return ResultInterface + */ + abstract protected function execute(); + /** * Throw control to different action (control and module if was specified). *