File tree Expand file tree Collapse file tree 5 files changed +80
-0
lines changed
linemarker/php/PluginLinemarkerRegistrar
classWithPluginShouldHaveLinemarker
classWithoutPluginShouldNotHaveLinemarker
project/magento2/vendor/magento/module-catalog
tests/com/magento/idea/magento2plugin/linemarker/php Expand file tree Collapse file tree 5 files changed +80
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ * Copyright © Magento, Inc. All rights reserved.
4
+ * See COPYING.txt for license details.
5
+ */
6
+
7
+ namespace Magento \Theme \Block ;
8
+
9
+ class PluginClass
10
+ {
11
+ public function someMethod ()
12
+ {
13
+ }
14
+ }
Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ * Copyright © Magento, Inc. All rights reserved.
4
+ * See COPYING.txt for license details.
5
+ */
6
+
7
+ namespace Magento \Catalog \Model ;
8
+
9
+ class RegularClass
10
+ {
11
+ public function someMethod ()
12
+ {
13
+ }
14
+ }
Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ * Copyright © Magento, Inc. All rights reserved.
4
+ * See COPYING.txt for license details.
5
+ */
6
+
7
+ namespace Magento \Catalog \Plugin ;
8
+
9
+ class PluginClass
10
+ {
11
+ public function beforeSomeMethod ()
12
+ {
13
+ }
14
+ }
Original file line number Diff line number Diff line change 1
1
<?xml version =" 1.0" ?>
2
+ <!--
3
+ /**
4
+ * Copyright © Magento, Inc. All rights reserved.
5
+ * See COPYING.txt for license details.
6
+ */
7
+ -->
2
8
<config >
3
9
<type name =" Magento\Theme\Block\Html\Topmenu" >
4
10
<plugin name =" catalogTopmenu" type =" Magento\Catalog\Plugin\Block\Topmenu" />
5
11
</type >
12
+ <type name =" Magento\Theme\Block\PluginClass" >
13
+ <plugin name =" pluginClass" type =" Magento\Catalog\Plugin\PluginClass" />
14
+ </type >
6
15
<type name =" Magento\Framework\Mview\View\StateInterface" >
7
16
<plugin name =" setStatusForMview"
8
17
type =" Magento\Catalog\Model\Indexer\Category\Product\Plugin\MviewState" />
Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright © Magento, Inc. All rights reserved.
3
+ * See COPYING.txt for license details.
4
+ */
5
+
6
+ package com .magento .idea .magento2plugin .linemarker .php ;
7
+
8
+ import com .magento .idea .magento2plugin .linemarker .LinemarkerFixtureTestCase ;
9
+
10
+ public class PluginLinemarkerRegistrarTest extends LinemarkerFixtureTestCase {
11
+
12
+ /**
13
+ * Tests linemarker in a class which has plugins.
14
+ */
15
+ public void testClassWithPluginShouldHaveLinemarker () {
16
+ myFixture .configureByFile (this .getFixturePath ("PluginClass.php" , "php" ));
17
+
18
+ assertHasLinemarkerWithTooltipAndIcon ("Navigate to plugins" , "/nodes/plugin.svg" );
19
+ }
20
+
21
+ /**
22
+ * Tests linemarker in a class which does not have plugins.
23
+ */
24
+ public void testClassWithoutPluginShouldNotHaveLinemarker () {
25
+ myFixture .configureByFile (this .getFixturePath ("RegularClass.php" , "php" ));
26
+
27
+ assertHasNoLinemarkerWithTooltipAndIcon ("Navigate to plugins" , "/nodes/plugin.svg" );
28
+ }
29
+ }
You can’t perform that action at this time.
0 commit comments