Skip to content

Commit 5a6a0ea

Browse files
authored
Merge pull request #394 from drpayyne/tests-06
Added test coverage for PhpServiceMethodCompletionContributor
2 parents 3b37a61 + e8ab0a1 commit 5a6a0ea

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Webapi:etc/webapi.xsd">
10+
11+
<!-- Product Service -->
12+
<route url="/V1/products" method="POST">
13+
<service class="Magento\Catalog\Api\ProductRepositoryInterface" method="<caret>"/>
14+
<resources>
15+
<resource ref="Magento_Catalog::products" />
16+
</resources>
17+
</route>
18+
19+
</routes>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/**
2+
* Copyright © Magento, Inc. All rights reserved.
3+
* See COPYING.txt for license details.
4+
*/
5+
6+
package com.magento.idea.magento2plugin.completion.xml;
7+
8+
public class PhpServiceMethodCompletionRegistrarTest extends CompletionXmlFixtureTestCase {
9+
10+
/**
11+
* Tests for the completion in `method` attribute of the `service` tag in webapi.xml.
12+
*/
13+
public void testWebApiXmlMustHaveCompletion() {
14+
final String filePath = this.getFixturePath("webapi.xml");
15+
myFixture.configureByFile(filePath);
16+
17+
assertCompletionContains(filePath, "save");
18+
}
19+
}

0 commit comments

Comments
 (0)