Skip to content

Commit 274caf2

Browse files
author
Vitaliy
authored
Merge pull request magento#396 from drpayyne/tests-08
Added test coverage for PhpClassMemberCompletionProvider
2 parents 43e45c6 + 171e1d8 commit 274caf2

File tree

3 files changed

+40
-0
lines changed

3 files changed

+40
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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+
<type name="Magento\Backend\Model\Source\YesNo">
10+
<arguments>
11+
<argument name="logger" xsi:type="init_parameter">Magento\Backend\Model\Source\YesNo::<caret></argument>
12+
</arguments>
13+
</type>
14+
</config>

Diff for: testData/project/magento2/vendor/magento/module-backend/Model/Source/YesNo.php

+5
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ class YesNo implements ArrayInterface
1515
*/
1616
private $logger;
1717

18+
/**
19+
* Constant to hold test string
20+
*/
21+
public const TEST_STRING = "Test string";
22+
1823
/**
1924
* YesNo constructor.
2025
*
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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+
import com.magento.idea.magento2plugin.magento.files.ModuleDiXml;
9+
10+
public class PhpClassMemberCompletionRegistrarTest extends CompletionXmlFixtureTestCase {
11+
12+
/**
13+
* Tests for completion of init_parameter argument value in di.xml.
14+
*/
15+
public void testDiXmlMustHaveCompletion() {
16+
final String filePath = this.getFixturePath(ModuleDiXml.FILE_NAME);
17+
myFixture.configureByFile(filePath);
18+
19+
assertCompletionContains(filePath, "Magento\\Backend\\Model\\Source\\YesNo::TEST_STRING");
20+
}
21+
}

0 commit comments

Comments
 (0)