Set('log_level_min', [LogChannels::DM_CRUD => 'Trace', LogChannels::EVENT_SERVICE => 'Trace']); } } protected function tearDown(): void { if (is_file(APPROOT.static::$sLogFile)) { $sLog = file_get_contents(APPROOT.static::$sLogFile); echo "--- error.log\n$sLog\n\n"; @unlink(APPROOT.static::$sLogFile); } parent::tearDown(); } public function testDBLinksChangedNotCalledOnDeletedObjects() { $sObjectParentKey = $this->GivenObjectInDB('TestDBObject', ['name' => 'parent']); $sObjectChildKey = $this->GivenObjectInDB('TestDBObject', ['name' => 'child', 'parent_id' => $sObjectParentKey]); $oParent = MetaModel::GetObject('TestDBObject', $sObjectParentKey); static::CleanCallCount(); $oParent->DBDelete(); $oChild = MetaModel::GetObject('TestDBObject', $sObjectChildKey); $this->assertEquals(0, $oChild->Get('parent_id')); $this->AssertEventCountEquals(0, EVENT_DB_LINKS_CHANGED, 'Event EVENT_DB_LINKS_CHANGED should not have been thrown on deleted objects'); } }