clear in setUp
This commit is contained in:
parent
30bf856f98
commit
e8a72b0291
1 changed files with 7 additions and 7 deletions
|
@ -39,7 +39,7 @@ abstract class ShimmiePHPUnitTestCase extends \PHPUnit\Framework\TestCase
|
|||
|
||||
public function setUp(): void
|
||||
{
|
||||
global $_tracer;
|
||||
global $database, $_tracer;
|
||||
$_tracer->begin($this->getName());
|
||||
$_tracer->begin("setUp");
|
||||
$class = str_replace("Test", "", get_class($this));
|
||||
|
@ -54,6 +54,12 @@ abstract class ShimmiePHPUnitTestCase extends \PHPUnit\Framework\TestCase
|
|||
// log in as anon
|
||||
$this->log_out();
|
||||
|
||||
$_tracer->begin("tearDown");
|
||||
foreach ($database->get_col("SELECT id FROM images") as $image_id) {
|
||||
send_event(new ImageDeletionEvent(Image::by_id($image_id)));
|
||||
}
|
||||
$_tracer->end();
|
||||
|
||||
$_tracer->end();
|
||||
$_tracer->begin("test");
|
||||
}
|
||||
|
@ -62,12 +68,6 @@ abstract class ShimmiePHPUnitTestCase extends \PHPUnit\Framework\TestCase
|
|||
{
|
||||
global $_tracer;
|
||||
$_tracer->end();
|
||||
$_tracer->begin("tearDown");
|
||||
global $database, $_tracer;
|
||||
foreach ($database->get_col("SELECT id FROM images") as $image_id) {
|
||||
send_event(new ImageDeletionEvent(Image::by_id($image_id)));
|
||||
}
|
||||
$_tracer->end();
|
||||
$_tracer->end();
|
||||
$_tracer->clear();
|
||||
$_tracer->flush("tests/trace.json");
|
||||
|
|
Reference in a new issue