File tree 1 file changed +19
-0
lines changed
1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -110,6 +110,25 @@ public function testBuildLocalTemplate(): void
110
110
$ this ->assertStringContainsString ('pre-commit ' , $ code );
111
111
$ this ->assertStringContainsString ('$captainHook->run ' , $ code );
112
112
}
113
+ /**
114
+ * Tests Builder::build
115
+ */
116
+ public function testBuildWSLTemplate (): void
117
+ {
118
+ $ resolver = $ this ->createResolverMock (CH_PATH_FILES . '/bin/captainhook ' , false );
119
+ $ repository = $ this ->createRepositoryMock (CH_PATH_FILES );
120
+ $ config = $ this ->createConfigMock (true , CH_PATH_FILES . '/template/captainhook.json ' );
121
+ $ runConfig = new Run (['mode ' => 'wsl ' , 'exec ' => '' , 'path ' => '' ]);
122
+ $ config ->method ('getRunConfig ' )->willReturn ($ runConfig );
123
+ $ config ->method ('getBootstrap ' )->willReturn ('vendor/autoload.php ' );
124
+
125
+ $ template = Builder::build ($ config , $ repository , $ resolver );
126
+ $ this ->assertInstanceOf (Local \WSL ::class, $ template );
127
+
128
+ $ code = $ template ->getCode ('pre-commit ' );
129
+ $ this ->assertStringContainsString ('pre-commit ' , $ code );
130
+ $ this ->assertStringContainsString ('wsl.exe ' , $ code );
131
+ }
113
132
114
133
/**
115
134
* Tests Builder::build
You can’t perform that action at this time.
0 commit comments