Skip to content

Commit 82916b4

Browse files
committed
rename targets to kebab-case
1 parent 8c554d7 commit 82916b4

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',
@@ -126,7 +126,7 @@ public function testTargetFileExistsFail(): void
126126
file_put_contents($targetFilePath, 'EXISTING');
127127

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

131131
$tester->expectFailedBuild($target);
132132

@@ -151,7 +151,7 @@ public function testCopyMultipleFiles(): void
151151
}
152152

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

157157
Assert::assertFileEquals($sourceFooFilePath, $targetFooFilePath);
@@ -173,7 +173,7 @@ public function testReplaceMultipleFilesWithExistingTargets(): void
173173
file_put_contents($targetBarFilePath, 'BAR-EXISTING');
174174

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

179179
Assert::assertFileEquals($sourceFooFilePath, $targetFooFilePath);
@@ -203,7 +203,7 @@ public function testCopyMultipleFilesWithExistingTargetsUsingDifferentModes(): v
203203
file_put_contents($targetDefaultFilePath, 'DEFAULT-EXISTING');
204204

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

209209
Assert::assertFileExists($targetSkipFilePath);
@@ -235,7 +235,7 @@ public function testCopyMultipleFilesWithExistingTargetsUsingDifferentModesWithR
235235
file_put_contents($targetDefaultFilePath, 'DEFAULT-EXISTING');
236236

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

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

258258
$tester->expectFailedBuild($target);
259259

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

268268
$tester->expectFailedBuild($target);
269269

@@ -281,7 +281,7 @@ public function testCopyFileToNonExistingDirectory(): void
281281
}
282282

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

286286
$tester->expectFailedBuild($target);
287287

@@ -294,22 +294,22 @@ public function testCopyFileToNonExistingDirectory(): void
294294
public function throwBuildExceptionDataProvider(): Generator
295295
{
296296
yield 'missing copy file element' => [
297-
'target' => 'testMissingCopyFileElement',
297+
'target' => 'missing-copy-file-element',
298298
'expectedMessagePatternRegExp' => '~one.+<file>.+expected~',
299299
];
300300

301301
yield 'missing source' => [
302-
'target' => 'testMissingSource',
302+
'target' => 'missing-source',
303303
'expectedMessagePatternRegExp' => '~<file>.+`source`~',
304304
];
305305

306306
yield 'missing target' => [
307-
'target' => 'testMissingTarget',
307+
'target' => 'missing-target',
308308
'expectedMessagePatternRegExp' => '~<file>.+`target`~',
309309
];
310310

311311
yield 'invalid file exists mode' => [
312-
'target' => 'testInvalidFileExistsMode',
312+
'target' => 'invalid-file-exists-mode',
313313
'expectedMessagePatternRegExp' => '~invalid.+mode~i',
314314
];
315315
}

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)