Skip to content

Commit 7eb8415

Browse files
author
Vitaliy Boyko
committed
Merge branch '3.0.0-develop' of github.com:magento/magento2-phpstorm-plugin into 3.0.2-develop
2 parents b9db41d + facb7e8 commit 7eb8415

File tree

4 files changed

+125
-0
lines changed

4 files changed

+125
-0
lines changed
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
<!--
2+
/*
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
-->
7+
<html>
8+
<body>
9+
<table width="100%" border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse">
10+
<tr>
11+
<td><font face="verdana" size="-1">
12+
The Regular Class it is a php class which represents itself template for creating objects.
13+
</font><br>
14+
</td>
15+
</tr>
16+
<tr>
17+
<td><font face="verdana" size="-1">
18+
Link to documentation
19+
<a href="https://www.php.net/manual/en/language.oop5.basic.php">
20+
PHPDocs</a>.
21+
</font><br>
22+
</td>
23+
</tr>
24+
</table>
25+
<table width="100%" border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse">
26+
<tr>
27+
<td colspan="3"><font face="verdana" size="-1">Predefined variables explanation:</font></td>
28+
</tr>
29+
<tr>
30+
<td valign="top"><nobr><font face="verdana" size="-2"><b>${NAMESPACE}</b></font></nobr></td>
31+
<td width="10">&nbsp;</td>
32+
<td width="100%" valign="top"><font face="verdana" size="-1">A fully qualified name of the field namespace without a leading slash.
33+
</font>
34+
</td>
35+
</tr>
36+
<tr>
37+
<td valign="top"><nobr><font face="verdana" size="-2"><b>${USE}</b></font></nobr></td>
38+
<td width="10">&nbsp;</td>
39+
<td width="100%" valign="top"><font face="verdana" size="-1">List of imports separated by comma.
40+
</font>
41+
</td>
42+
</tr>
43+
<tr>
44+
<td valign="top"><nobr><font face="verdana" size="-2"><b>${NAME}</b></font></nobr></td>
45+
<td width="10">&nbsp;</td>
46+
<td width="100%" valign="top"><font face="verdana" size="-1">PHP Class name.
47+
</font>
48+
</td>
49+
</tr>
50+
<tr>
51+
<td valign="top"><nobr><font face="verdana" size="-2"><b>${EXTENDS}</b></font></nobr></td>
52+
<td width="10">&nbsp;</td>
53+
<td width="100%" valign="top"><font face="verdana" size="-1">Name of PHP class that the Class extends.
54+
</font>
55+
</td>
56+
</tr>
57+
<tr>
58+
<td valign="top"><nobr><font face="verdana" size="-2"><b>${IMPLEMENTS}</b></font></nobr></td>
59+
<td width="10">&nbsp;</td>
60+
<td width="100%" valign="top"><font face="verdana" size="-1">Name of PHP class that the Class implements.
61+
</font>
62+
</td>
63+
</tr>
64+
</table>
65+
</body>
66+
</html>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<config>
9+
<event name="test_event_in_test_class">
10+
<observer name="test_observer" instance="Magento\Catalog\Observer\TestObserver" />
11+
</event>
12+
</config>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<config>
9+
<event name="some_random_event">
10+
<observer name="observer_one" instance="Vendor\Module\Observer\Class" />
11+
<observer name="observer_two" instance="Vendor\Module\Observer\Class" />
12+
</event>
13+
</config>
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
* Copyright © Magento, Inc. All rights reserved.
3+
* See COPYING.txt for license details.
4+
*/
5+
6+
package com.magento.idea.magento2plugin.inspections.xml;
7+
8+
import com.magento.idea.magento2plugin.magento.files.ModuleEventsXml;
9+
10+
@SuppressWarnings({"PMD.JUnitTestsShouldIncludeAssert"})
11+
public class ObserverDeclarationInspectionTest extends InspectionXmlFixtureTestCase {
12+
13+
@Override
14+
public void setUp() throws Exception {
15+
super.setUp();
16+
myFixture.enableInspections(ObserverDeclarationInspection.class);
17+
}
18+
19+
/**
20+
* Tests for duplicate observer name inspection warning in the same events.xml
21+
*/
22+
public void testObserverNameUsedInSameFile() {
23+
myFixture.configureByFile(getFixturePath(ModuleEventsXml.FILE_NAME));
24+
myFixture.testHighlighting(true, false, false);
25+
}
26+
27+
/**
28+
* Tests for duplicate observer name inspection warning in a different events.xml
29+
*/
30+
public void testObserverNameUsedInDifferentFile() {
31+
myFixture.configureByFile(getFixturePath(ModuleEventsXml.FILE_NAME));
32+
myFixture.testHighlighting(true, false, false);
33+
}
34+
}

0 commit comments

Comments
 (0)