File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed
Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -103,7 +103,7 @@ public function source(): string
103103 try {
104104 $ ret .= $ this ->json ();
105105 } catch (DriverException $ e ) {
106- $ ret .= $ this ->page ()->getContent ();
106+ $ ret .= \trim ( $ this ->getDriver ()->getContent () );
107107 }
108108
109109 return $ ret ;
Original file line number Diff line number Diff line change @@ -506,6 +506,22 @@ public function can_save_formatted_json_source(): void
506506 $ this ->assertStringContainsString (' "content": null, ' , $ contents );
507507 }
508508
509+ /**
510+ * @test
511+ */
512+ public function can_save_source_when_exception (): void
513+ {
514+ $ contents = self ::catchFileContents (__DIR__ .'/../var/browser/source/source.txt ' , function () {
515+ $ this ->browser ()
516+ ->visit ('/invalid-page ' )
517+ ->assertStatus (404 )
518+ ->saveSource ('/source.txt ' )
519+ ;
520+ });
521+
522+ $ this ->assertStringContainsString ('No route found for ' , $ contents );
523+ }
524+
509525 /**
510526 * @test
511527 */
You can’t perform that action at this time.
0 commit comments