Skip to content

Commit 1432f71

Browse files
committed
rename targets to kebab-case
1 parent ed5360c commit 1432f71

2 files changed

Lines changed: 34 additions & 34 deletions

File tree

tests/CopyFilesTaskIntegrationTest.php

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class CopyFilesTaskIntegrationTest extends \PHPUnit\Framework\TestCase
2020
public function copyFileDataProvider(): Generator
2121
{
2222
yield 'copy file' => [
23-
'target' => 'testCopyFile',
23+
'target' => 'copy-file',
2424
'sourceFileName' => '/foo',
2525
'targetFileName' => '/foo-copy',
2626
'existingSourceFileContents' => 'FOO',
@@ -31,7 +31,7 @@ public function copyFileDataProvider(): Generator
3131
];
3232

3333
yield 'copy file with absolute path' => [
34-
'target' => 'testCopyFileWithAbsolutePath',
34+
'target' => 'copy-file-with-absolute-path',
3535
'sourceFileName' => '/foo',
3636
'targetFileName' => '/foo-copy',
3737
'existingSourceFileContents' => 'FOO',
@@ -42,7 +42,7 @@ public function copyFileDataProvider(): Generator
4242
];
4343

4444
yield 'target file exists' => [
45-
'target' => 'testTargetFileExists',
45+
'target' => 'target-file-exists',
4646
'sourceFileName' => '/new',
4747
'targetFileName' => '/existing',
4848
'existingSourceFileContents' => 'NEW',
@@ -53,7 +53,7 @@ public function copyFileDataProvider(): Generator
5353
];
5454

5555
yield 'target file exists skip' => [
56-
'target' => 'testTargetFileExistsSkip',
56+
'target' => 'target-file-exists-skip',
5757
'sourceFileName' => '/new',
5858
'targetFileName' => '/existing',
5959
'existingSourceFileContents' => 'NEW',
@@ -64,7 +64,7 @@ public function copyFileDataProvider(): Generator
6464
];
6565

6666
yield 'target file exists replace' => [
67-
'target' => 'testTargetFileExistsReplace',
67+
'target' => 'target-file-exists-replace',
6868
'sourceFileName' => '/new',
6969
'targetFileName' => '/existing',
7070
'existingSourceFileContents' => 'NEW',
@@ -124,7 +124,7 @@ public function testTargetFileExistsFail(): void
124124
file_put_contents($targetFilePath, 'EXISTING');
125125

126126
$tester = new PhingTester(__DIR__ . '/copy-files-task-integration-test.xml', self::TEMP_DIRECTORY_PATH);
127-
$target = __FUNCTION__;
127+
$target = 'target-file-exists-fail';
128128

129129
$tester->expectFailedBuild($target);
130130

@@ -149,7 +149,7 @@ public function testCopyMultipleFiles(): void
149149
}
150150

151151
$tester = new PhingTester(__DIR__ . '/copy-files-task-integration-test.xml', self::TEMP_DIRECTORY_PATH);
152-
$target = __FUNCTION__;
152+
$target = 'copy-multiple-files';
153153
$tester->executeTarget($target);
154154

155155
Assert::assertFileEquals($sourceFooFilePath, $targetFooFilePath);
@@ -171,7 +171,7 @@ public function testReplaceMultipleFilesWithExistingTargets(): void
171171
file_put_contents($targetBarFilePath, 'BAR-EXISTING');
172172

173173
$tester = new PhingTester(__DIR__ . '/copy-files-task-integration-test.xml', self::TEMP_DIRECTORY_PATH);
174-
$target = __FUNCTION__;
174+
$target = 'replace-multiple-files-with-existing-targets';
175175
$tester->executeTarget($target);
176176

177177
Assert::assertFileEquals($sourceFooFilePath, $targetFooFilePath);
@@ -201,7 +201,7 @@ public function testCopyMultipleFilesWithExistingTargetsUsingDifferentModes(): v
201201
file_put_contents($targetDefaultFilePath, 'DEFAULT-EXISTING');
202202

203203
$tester = new PhingTester(__DIR__ . '/copy-files-task-integration-test.xml', self::TEMP_DIRECTORY_PATH);
204-
$target = __FUNCTION__;
204+
$target = 'copy-multiple-files-with-existing-targets-using-different-modes';
205205
$tester->executeTarget($target);
206206

207207
Assert::assertFileExists($targetSkipFilePath);
@@ -233,7 +233,7 @@ public function testCopyMultipleFilesWithExistingTargetsUsingDifferentModesWithR
233233
file_put_contents($targetDefaultFilePath, 'DEFAULT-EXISTING');
234234

235235
$tester = new PhingTester(__DIR__ . '/copy-files-task-integration-test.xml', self::TEMP_DIRECTORY_PATH);
236-
$target = __FUNCTION__;
236+
$target = 'copy-multiple-files-with-existing-targets-using-different-modes-with-replace-fallback';
237237
$tester->executeTarget($target);
238238

239239
Assert::assertFileExists($targetSkipFilePath);
@@ -251,7 +251,7 @@ public function testCopyMultipleFilesWithExistingTargetsUsingDifferentModesWithR
251251
public function testCopyNonExistentFile(): void
252252
{
253253
$tester = new PhingTester(__DIR__ . '/copy-files-task-integration-test.xml');
254-
$target = __FUNCTION__;
254+
$target = 'copy-non-existent-file';
255255

256256
$tester->expectFailedBuild($target);
257257

@@ -261,7 +261,7 @@ public function testCopyNonExistentFile(): void
261261
public function testCopyMultipleNonExistentFiles(): void
262262
{
263263
$tester = new PhingTester(__DIR__ . '/copy-files-task-integration-test.xml');
264-
$target = __FUNCTION__;
264+
$target = 'copy-multiple-non-existent-files';
265265

266266
$tester->expectFailedBuild($target);
267267

@@ -279,7 +279,7 @@ public function testCopyFileToNonExistingDirectory(): void
279279
}
280280

281281
$tester = new PhingTester(__DIR__ . '/copy-files-task-integration-test.xml', self::TEMP_DIRECTORY_PATH);
282-
$target = __FUNCTION__;
282+
$target = 'copy-file-to-non-existing-directory';
283283

284284
$tester->expectFailedBuild($target);
285285

@@ -292,22 +292,22 @@ public function testCopyFileToNonExistingDirectory(): void
292292
public function throwBuildExceptionDataProvider(): Generator
293293
{
294294
yield 'missing copy file element' => [
295-
'target' => 'testMissingCopyFileElement',
295+
'target' => 'missing-copy-file-element',
296296
'expectedMessagePatternRegExp' => '~one.+<file>.+expected~',
297297
];
298298

299299
yield 'missing source' => [
300-
'target' => 'testMissingSource',
300+
'target' => 'missing-source',
301301
'expectedMessagePatternRegExp' => '~<file>.+`source`~',
302302
];
303303

304304
yield 'missing target' => [
305-
'target' => 'testMissingTarget',
305+
'target' => 'missing-target',
306306
'expectedMessagePatternRegExp' => '~<file>.+`target`~',
307307
];
308308

309309
yield 'invalid file exists mode' => [
310-
'target' => 'testInvalidFileExistsMode',
310+
'target' => 'invalid-file-exists-mode',
311311
'expectedMessagePatternRegExp' => '~invalid.+mode~i',
312312
];
313313
}

tests/copy-files-task-integration-test.xml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,109 +3,109 @@
33

44
<taskdef name="copy-files" classname="VasekPurchart\Phing\CopyFiles\CopyFilesTask"/>
55

6-
<target name="testCopyFile">
6+
<target name="copy-file">
77
<copy-files>
88
<file source="foo" target="foo-copy"/>
99
</copy-files>
1010
</target>
1111

12-
<target name="testCopyFileWithAbsolutePath">
12+
<target name="copy-file-with-absolute-path">
1313
<copy-files>
1414
<file source="${project.basedir}/foo" target="${project.basedir}/foo-copy"/>
1515
</copy-files>
1616
</target>
1717

18-
<target name="testTargetFileExists">
18+
<target name="target-file-exists">
1919
<copy-files>
2020
<file source="new" target="existing"/>
2121
</copy-files>
2222
</target>
2323

24-
<target name="testTargetFileExistsSkip">
24+
<target name="target-file-exists-skip">
2525
<copy-files existsmode="skip">
2626
<file source="new" target="existing"/>
2727
</copy-files>
2828
</target>
2929

30-
<target name="testTargetFileExistsReplace">
30+
<target name="target-file-exists-replace">
3131
<copy-files existsmode="replace">
3232
<file source="new" target="existing"/>
3333
</copy-files>
3434
</target>
3535

36-
<target name="testTargetFileExistsFail">
36+
<target name="target-file-exists-fail">
3737
<copy-files existsmode="fail">
3838
<file source="new" target="existing"/>
3939
</copy-files>
4040
</target>
4141

42-
<target name="testCopyMultipleFiles">
42+
<target name="copy-multiple-files">
4343
<copy-files>
4444
<file source="foo" target="foo-copy"/>
4545
<file source="bar" target="bar-copy"/>
4646
</copy-files>
4747
</target>
4848

49-
<target name="testReplaceMultipleFilesWithExistingTargets">
49+
<target name="replace-multiple-files-with-existing-targets">
5050
<copy-files existsmode="replace">
5151
<file source="foo-new" target="foo-existing"/>
5252
<file source="bar-new" target="bar-existing"/>
5353
</copy-files>
5454
</target>
5555

56-
<target name="testCopyMultipleFilesWithExistingTargetsUsingDifferentModes">
56+
<target name="copy-multiple-files-with-existing-targets-using-different-modes">
5757
<copy-files>
5858
<file source="skip-new" target="skip-existing" existsmode="skip"/>
5959
<file source="replace-new" target="replace-existing" existsmode="replace"/>
6060
<file source="default-new" target="default-existing"/>
6161
</copy-files>
6262
</target>
6363

64-
<target name="testCopyMultipleFilesWithExistingTargetsUsingDifferentModesWithReplaceFallback">
64+
<target name="copy-multiple-files-with-existing-targets-using-different-modes-with-replace-fallback">
6565
<copy-files existsmode="replace">
6666
<file source="skip-new" target="skip-existing" existsmode="skip"/>
6767
<file source="replace-new" target="replace-existing" existsmode="replace"/>
6868
<file source="default-new" target="default-existing"/>
6969
</copy-files>
7070
</target>
7171

72-
<target name="testCopyNonExistentFile">
72+
<target name="copy-non-existent-file">
7373
<copy-files>
7474
<file source="XXX" target="YYY"/>
7575
</copy-files>
7676
</target>
7777

78-
<target name="testCopyMultipleNonExistentFiles">
78+
<target name="copy-multiple-non-existent-files">
7979
<copy-files>
8080
<file source="FOO" target="LOREM"/>
8181
<file source="BAR" target="LOREM"/>
8282
</copy-files>
8383
</target>
8484

85-
<target name="testCopyFileToNonExistingDirectory">
85+
<target name="copy-file-to-non-existing-directory">
8686
<copy-files>
8787
<file source="foo" target="non-existing-directory/foo-copy"/>
8888
</copy-files>
8989
</target>
9090

91-
<target name="testMissingCopyFileElement">
91+
<target name="missing-copy-file-element">
9292
<copy-files>
9393
</copy-files>
9494
</target>
9595

96-
<target name="testMissingSource">
96+
<target name="missing-source">
9797
<copy-files>
9898
<file target="BAR"/>
9999
</copy-files>
100100
</target>
101101

102-
<target name="testMissingTarget">
102+
<target name="missing-target">
103103
<copy-files>
104104
<file source="FOO"/>
105105
</copy-files>
106106
</target>
107107

108-
<target name="testInvalidFileExistsMode">
108+
<target name="invalid-file-exists-mode">
109109
<copy-files existsmode="invalid-mode">
110110
<file source="new" target="existing"/>
111111
</copy-files>

0 commit comments

Comments
 (0)