@@ -25,4 +25,53 @@ public function testGitExists()
25
25
$ this ->assertFileExists ($ laravelPath . '/phpmd.xml ' );
26
26
$ this ->assertFileExists ($ laravelPath . '/.git/hooks/pre-commit ' );
27
27
}
28
+
29
+ public function testPhpcsExists ()
30
+ {
31
+ $ laravelPath = __DIR__ . '/../vendor/orchestra/testbench-core/laravel ' ;
32
+ File::delete ($ laravelPath . '/phpcs.xml ' );
33
+ $ this ->assertFileDoesNotExist ($ laravelPath . '/phpcs.xml ' );
34
+ File::append ($ laravelPath . '/phpcs.xml ' , 'phpcs ' );
35
+ $ this ->assertFileExists ($ laravelPath . '/phpcs.xml ' );
36
+ $ this ->artisan ('lint:publish ' )->run ();
37
+ $ this ->assertEquals ('phpcs ' , File::get ($ laravelPath . '/phpcs.xml ' ));
38
+ $ this ->assertFileExists ($ laravelPath . '/phpmd.xml ' );
39
+ $ this ->assertFileExists ($ laravelPath . '/.git/hooks/pre-commit ' );
40
+ }
41
+
42
+ public function testPhpcsNotExists ()
43
+ {
44
+ $ laravelPath = __DIR__ . '/../vendor/orchestra/testbench-core/laravel ' ;
45
+ File::delete ($ laravelPath . '/phpcs.xml ' );
46
+ $ this ->assertFileDoesNotExist ($ laravelPath . '/phpcs.xml ' );
47
+ $ this ->artisan ('lint:publish ' )->run ();
48
+ $ this ->assertFileExists ($ laravelPath . '/phpcs.xml ' );
49
+ $ this ->assertXmlFileEqualsXmlFile (__DIR__ . '/../src/stubs/phpcs.xml ' , $ laravelPath . '/phpcs.xml ' );
50
+ $ this ->assertFileExists ($ laravelPath . '/phpmd.xml ' );
51
+ $ this ->assertFileExists ($ laravelPath . '/.git/hooks/pre-commit ' );
52
+ }
53
+
54
+ public function testPhpmdExists ()
55
+ {
56
+ $ laravelPath = __DIR__ . '/../vendor/orchestra/testbench-core/laravel ' ;
57
+ File::delete ($ laravelPath . '/phpmd.xml ' );
58
+ $ this ->assertFileDoesNotExist ($ laravelPath . '/phpmd.xml ' );
59
+ File::append ($ laravelPath . '/phpmd.xml ' , 'phpmd ' );
60
+ $ this ->assertFileExists ($ laravelPath . '/phpmd.xml ' );
61
+ $ this ->artisan ('lint:publish ' )->run ();
62
+ $ this ->assertEquals ('phpmd ' , File::get ($ laravelPath . '/phpmd.xml ' ));
63
+ $ this ->assertFileExists ($ laravelPath . '/phpcs.xml ' );
64
+ $ this ->assertFileExists ($ laravelPath . '/.git/hooks/pre-commit ' );
65
+ }
66
+ public function testPhpmdNotExists ()
67
+ {
68
+ $ laravelPath = __DIR__ . '/../vendor/orchestra/testbench-core/laravel ' ;
69
+ File::delete ($ laravelPath . '/phpmd.xml ' );
70
+ $ this ->assertFileDoesNotExist ($ laravelPath . '/phpmd.xml ' );
71
+ $ this ->artisan ('lint:publish ' )->run ();
72
+ $ this ->assertFileExists ($ laravelPath . '/phpmd.xml ' );
73
+ $ this ->assertXmlFileEqualsXmlFile (__DIR__ . '/../src/stubs/phpmd.xml ' , $ laravelPath . '/phpmd.xml ' );
74
+ $ this ->assertFileExists ($ laravelPath . '/phpcs.xml ' );
75
+ $ this ->assertFileExists ($ laravelPath . '/.git/hooks/pre-commit ' );
76
+ }
28
77
}
0 commit comments