Project

General

Profile

Actions

Task #56792

closed

Enhance assertion of error log entries

Added by Oliver Hader about 10 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Tests
Start date:
2014-03-11
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
5.3
Tags:
testing-framework
Complexity:
medium
Sprint Focus:
Remote Sprint

Description

During the action tests it might happen, that errors occur. To assert expected or unexpected error log entries in the sys_log table, this functionality shall be added to the functional testing framework.
The current implementation just checks the amount of entries, which should be "0" in most cases - which is a bit weak to be considered as complete assertion.

Peter Niederlag shared some ideas during the review process which shall be part of a separate follow-up change.

// set by freezeErrorId() and used by assertErrorLogCreated()
protected $frozenErrorId = NULL;

// freeze ErrorLog
protected freezeErrorLog() { if $this->latestErrorId !== NULL { raise Exception('errorLog already frozen, use assertErrorLogCreated() before freezing again') }
$this->latestErrorId = sqlfetchIdofLatestErrorbyTimestamp();
}

assertErrorLogsCreated($expectedCount = 1, $detailPatterns = array() ) {
// check/warning on frozenErrorId (should be called prior to this assertion)
// check if there are $expectedCount new errorLogs (id > this->frozenErrorId)
// optionally check with regex
// finally reset frozenErrorId
$this->frozenErrorId = NULL;
}

(find discussion here https://review.typo3.org/#/c/27886/2/typo3/sysext/core/Tests/Functional/DataHandling/AbstractDataHandlerActionTestCase.php,unified)


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Task #56369: Add possibility to assert error log entriesClosedOliver Hader2014-02-27

Actions
Actions #1

Updated by Mathias Schreiber over 9 years ago

  • Target version set to 7.5
Actions #2

Updated by Anja Leichsenring about 9 years ago

  • Sprint Focus set to On Location Sprint
Actions #3

Updated by Anja Leichsenring over 8 years ago

  • Sprint Focus changed from On Location Sprint to Remote Sprint
Actions #4

Updated by Oliver Hader over 8 years ago

  • Target version changed from 7.5 to 8 LTS
  • Complexity set to medium
Actions #5

Updated by Benni Mack almost 7 years ago

  • Target version changed from 8 LTS to Candidate for patchlevel
Actions #6

Updated by Susanne Moog over 6 years ago

  • Status changed from New to Accepted
  • Tags set to testing-framework
Actions #7

Updated by Susanne Moog over 6 years ago

  • Status changed from Accepted to Closed

We will track this issue in the testing framework project on github, see https://github.com/TYPO3/testing-framework/issues/38

Actions

Also available in: Atom PDF