Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd9ad1e4

Browse files
committed
FixedHaehnchen#1667: Rename refactoring ignores constants inside yaml files (tests)
1 parent8a6621c commitd9ad1e4

File tree

2 files changed

+53
-0
lines changed

2 files changed

+53
-0
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
packagefr.adrienbrault.idea.symfony2plugin.tests.config.yaml;
2+
3+
importcom.intellij.patterns.PlatformPatterns;
4+
importcom.jetbrains.php.lang.psi.elements.Field;
5+
importcom.jetbrains.php.lang.psi.elements.PhpDefine;
6+
importfr.adrienbrault.idea.symfony2plugin.tests.SymfonyLightCodeInsightFixtureTestCase;
7+
importorg.jetbrains.yaml.YAMLFileType;
8+
9+
publicclassYamlReferenceContributorTestextendsSymfonyLightCodeInsightFixtureTestCase {
10+
11+
publicvoidsetUp()throwsException {
12+
super.setUp();
13+
myFixture.copyFileToProject("YamlReferenceContributor.php");
14+
}
15+
16+
publicStringgetTestDataPath() {
17+
return"src/test/java/fr/adrienbrault/idea/symfony2plugin/tests/config/yaml/fixtures";
18+
}
19+
20+
publicvoidtestConstantProvidesReferences() {
21+
assertReferenceMatchOnParent(
22+
YAMLFileType.YML,
23+
"services:\n" +
24+
" app.service.example:\n" +
25+
" arguments:\n" +
26+
" - !php/const CONST_<caret>FOO\n",
27+
PlatformPatterns.psiElement(PhpDefine.class).withName("CONST_FOO")
28+
);
29+
30+
assertReferenceMatchOnParent(
31+
YAMLFileType.YML,
32+
"services:\n" +
33+
" app.service.example:\n" +
34+
" arguments:\n" +
35+
" - !php/const Foo\\Bar::F<caret>OO\n",
36+
PlatformPatterns.psiElement(Field.class).withName("FOO")
37+
);
38+
}
39+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
3+
namespace
4+
{
5+
define('CONST_FOO','CONST_FOO');
6+
}
7+
8+
namespaceFoo
9+
{
10+
class Bar
11+
{
12+
constFOO ='foo';
13+
}
14+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp