From 9c1b01b41c5a7ca21e19b907de7fc06131f23788 Mon Sep 17 00:00:00 2001 From: Adarsh Manickam Date: Sun, 15 Nov 2020 10:14:15 +0530 Subject: [PATCH] Added test coverage for PhpServiceMethodCompletionContributor --- .../webApiXmlMustHaveCompletion/webapi.xml | 19 +++++++++++++++++++ ...pServiceMethodCompletionRegistrarTest.java | 19 +++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 testData/completion/xml/PhpServiceMethodCompletionRegistrar/webApiXmlMustHaveCompletion/webapi.xml create mode 100644 tests/com/magento/idea/magento2plugin/completion/xml/PhpServiceMethodCompletionRegistrarTest.java diff --git a/testData/completion/xml/PhpServiceMethodCompletionRegistrar/webApiXmlMustHaveCompletion/webapi.xml b/testData/completion/xml/PhpServiceMethodCompletionRegistrar/webApiXmlMustHaveCompletion/webapi.xml new file mode 100644 index 000000000..5e8e7cf5c --- /dev/null +++ b/testData/completion/xml/PhpServiceMethodCompletionRegistrar/webApiXmlMustHaveCompletion/webapi.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + diff --git a/tests/com/magento/idea/magento2plugin/completion/xml/PhpServiceMethodCompletionRegistrarTest.java b/tests/com/magento/idea/magento2plugin/completion/xml/PhpServiceMethodCompletionRegistrarTest.java new file mode 100644 index 000000000..7cbab9509 --- /dev/null +++ b/tests/com/magento/idea/magento2plugin/completion/xml/PhpServiceMethodCompletionRegistrarTest.java @@ -0,0 +1,19 @@ +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +package com.magento.idea.magento2plugin.completion.xml; + +public class PhpServiceMethodCompletionRegistrarTest extends CompletionXmlFixtureTestCase { + + /** + * Tests for the completion in `method` attribute of the `service` tag in webapi.xml. + */ + public void testWebApiXmlMustHaveCompletion() { + final String filePath = this.getFixturePath("webapi.xml"); + myFixture.configureByFile(filePath); + + assertCompletionContains(filePath, "save"); + } +}