forked from magento/magento2-phpstorm-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTableAndColumnNameCompletionRegistrarTest.java
60 lines (52 loc) · 2.37 KB
/
TableAndColumnNameCompletionRegistrarTest.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/*
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
package com.magento.idea.magento2plugin.completion.xml;
import com.magento.idea.magento2plugin.magento.files.ModuleDbSchemaXml;
/**
* Test table and column names completion in the db_schema.xml file.
*/
public class TableAndColumnNameCompletionRegistrarTest extends CompletionXmlFixtureTestCase {
private static final String CATALOG_PRODUCT_ENTITY_TABLE_NAME = "catalog_product_entity";
/**
* The `name` attribute of the `table` tag in `db_schema.xml` file must
* have completion based on table and column names index.
*/
public void testTableNameMustHaveCompletion() {
final String filePath = this.getFixturePath(ModuleDbSchemaXml.FILE_NAME);
assertCompletionContains(filePath, "catalog_category_entity");
}
/**
* The `table` attribute of the `constraint` tag in `db_schema.xml` file must
* have completion based on table and column names index.
*/
public void testConstraintTagTableMustHaveCompletion() {
final String filePath = this.getFixturePath(ModuleDbSchemaXml.FILE_NAME);
assertCompletionContains(filePath, CATALOG_PRODUCT_ENTITY_TABLE_NAME);
}
/**
* The `referenceTable` attribute of the `constraint` tag in `db_schema.xml` file must
* have completion based on table and column names index.
*/
public void testConstraintTagReferenceTableMustHaveCompletion() {
final String filePath = this.getFixturePath(ModuleDbSchemaXml.FILE_NAME);
assertCompletionContains(filePath, CATALOG_PRODUCT_ENTITY_TABLE_NAME);
}
/**
* The `column` attribute of the `constraint` tag in `db_schema.xml` file must
* have completion based on table and column names index.
*/
public void testConstraintColumnNameMustHaveCompletion() {
final String filePath = this.getFixturePath(ModuleDbSchemaXml.FILE_NAME);
assertCompletionContains(filePath, "children_count");
}
/**
* The `referenceColumn` attribute of the `constraint` tag in `db_schema.xml` file must
* have completion based on table and column names index.
*/
public void testConstraintReferenceColumnNameMustHaveCompletion() {
final String filePath = this.getFixturePath(ModuleDbSchemaXml.FILE_NAME);
assertCompletionContains(filePath, "attribute_set_id");
}
}