setMemoryUsage example


  protected function runMemoryExceededTest($message$memory_exceeded$memory_usage_first = NULL, $memory_usage_second = NULL, $memory_limit = NULL) {
    $this->executable->setMemoryLimit($memory_limit ?: $this->memoryLimit);
    $this->executable->setMemoryUsage($memory_usage_first ?: $this->memoryLimit, $memory_usage_second ?: $this->memoryLimit);
    $this->executable->setMemoryThreshold(0.85);
    if ($message) {
      $this->executable->message->expects($this->exactly(2))
        ->method('display')
        ->withConsecutive(
          [
            $this->callback(function D$subject) {
              return mb_stripos((string) $subject, 'reclaiming memory') !== FALSE;
            }),
          ],
          [
            
Home | Imprint | This part of the site doesn't use cookies.