Open mariano-dagostino opened 5 days ago
My trick is usually going into the markEntityForCleanup
method and comment the method's body.
I've been using what @amitaibu suggested. Also one from @AronNovak :
$html = $this->getSession()->getPage()->getOuterHtml();
file_put_contents('/var/www/html/web/' . md5($html) . '.html', $html);
Maybe we can have a custom ddev command to make this even simpler. Like ddev phpunit-keep Test.php
so if some test fail it can be easilly re-run keeping the created entities with one simple cli change.
You can also just add a die()
before the end of the test and it will keep the entities btw.
Or adding sleep()
.
The
weitzman\DrupalTestTraits\ExistingSiteBase
class uses$this->markEntityForCleanup
to delete entities after tests.It would be handy to have an option to retain these entities for debugging purposes.
Proposed solution:
More concise or better names welcome.