public function setUp() { parent::setUp(); if (!TestEntity::indexExists()) { TestEntity::createIndex(); } TestEntity::flushEventListeners(); TestEntity::boot(); //run event listeners TestEntity::removeAllFromIndex(); }