File tree Expand file tree Collapse file tree 2 files changed +7
-9
lines changed
packages/router/src/Static
tests/Integration/Http/Static Expand file tree Collapse file tree 2 files changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -62,10 +62,8 @@ public function __invoke(
6262 ?string $ filter = null ,
6363 #[ConsoleArgument(description: 'Crawl the site for dead links ' )]
6464 bool $ crawl = false ,
65- #[ConsoleArgument(description: 'Allow dead links, only works when the --crawl flag is set ' )]
66- bool $ allowDeadLinks = false ,
67- #[ConsoleArgument(description: 'Allow external dead links, only works when the --crawl flag is set ' )]
68- bool $ allowExternalDeadLinks = true ,
65+ #[ConsoleArgument(description: 'Crawl external links, only works when the --crawl flag is set ' )]
66+ bool $ external = false ,
6967 #[ConsoleArgument(aliases: ['v ' ])]
7068 bool $ verbose = false ,
7169 ): ExitCode {
@@ -155,9 +153,9 @@ public function __invoke(
155153 }
156154
157155 if ($ crawl ) {
158- $ deadLinks = $ this ->detectDeadLinks ($ uri , $ content , checkExternal: ! $ allowExternalDeadLinks );
156+ $ deadLinks = $ this ->detectDeadLinks ($ uri , $ content , checkExternal: $ external );
159157
160- if (! $ allowDeadLinks && $ deadLinks !== []) {
158+ if ($ deadLinks !== []) {
161159 $ deadlinks [$ uri ] = $ deadLinks ;
162160 throw new DeadLinksDetectedException ($ uri , $ deadLinks );
163161 }
Original file line number Diff line number Diff line change @@ -112,7 +112,7 @@ public function test_dead_link_with_redirect(): void
112112 $ this ->container ->config (new AppConfig (baseUri: 'https://test.com ' ));
113113
114114 $ this ->console
115- ->call (StaticGenerateCommand::class, ['--crawl ' => true , ' --allow-external-dead-links ' => false ])
115+ ->call (StaticGenerateCommand::class, ['--crawl ' => true ])
116116 ->assertExitCode (ExitCode::SUCCESS );
117117 }
118118
@@ -124,7 +124,7 @@ public function test_allow_dead_links(): void
124124 $ this ->container ->config (new AppConfig (baseUri: 'https://test.com ' ));
125125
126126 $ this ->console
127- ->call (StaticGenerateCommand::class, ['--crawl ' => true , ' --allow-dead-links ' => true ])
127+ ->call (StaticGenerateCommand::class, ['--crawl ' => false ])
128128 ->assertExitCode (ExitCode::SUCCESS );
129129 }
130130
@@ -136,7 +136,7 @@ public function test_external_dead_links(): void
136136 $ this ->container ->config (new AppConfig (baseUri: 'https://test.com ' ));
137137
138138 $ this ->console
139- ->call (StaticGenerateCommand::class, ['--crawl ' => true , '--allow- external-dead-links ' => false ])
139+ ->call (StaticGenerateCommand::class, ['--crawl ' => true , '--external ' => true ])
140140 ->assertSee ('2 DEAD LINKS ' )
141141 ->assertSee ('https://test.com/404 ' )
142142 ->assertSee ('https://google.com/404 ' )
You can’t perform that action at this time.
0 commit comments