You are here

private function Twig_Tests_Profiler_Dumper_AbstractTest::generateProfile in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/twig/twig/test/Twig/Tests/Profiler/Dumper/AbstractTest.php \Twig_Tests_Profiler_Dumper_AbstractTest::generateProfile()

Parameters

string $name:

float $duration:

bool $isTemplate:

string $type:

string $templateName:

array $subProfiles:

Return value

Twig_Profiler_Profile

5 calls to Twig_Tests_Profiler_Dumper_AbstractTest::generateProfile()
Twig_Tests_Profiler_Dumper_AbstractTest::getEmbeddedBlockProfile in vendor/twig/twig/test/Twig/Tests/Profiler/Dumper/AbstractTest.php
Twig_Tests_Profiler_Dumper_AbstractTest::getEmbeddedTemplateProfile in vendor/twig/twig/test/Twig/Tests/Profiler/Dumper/AbstractTest.php
Twig_Tests_Profiler_Dumper_AbstractTest::getIncludedTemplateProfile in vendor/twig/twig/test/Twig/Tests/Profiler/Dumper/AbstractTest.php
Twig_Tests_Profiler_Dumper_AbstractTest::getIndexProfile in vendor/twig/twig/test/Twig/Tests/Profiler/Dumper/AbstractTest.php
Twig_Tests_Profiler_Dumper_AbstractTest::getMacroProfile in vendor/twig/twig/test/Twig/Tests/Profiler/Dumper/AbstractTest.php

File

vendor/twig/twig/test/Twig/Tests/Profiler/Dumper/AbstractTest.php, line 84

Class

Twig_Tests_Profiler_Dumper_AbstractTest

Code

private function generateProfile($name, $duration, $isTemplate, $type, $templateName, array $subProfiles = array()) {
  $profile = $this
    ->getMockBuilder('Twig_Profiler_Profile')
    ->disableOriginalConstructor()
    ->getMock();
  $profile
    ->expects($this
    ->any())
    ->method('isRoot')
    ->will($this
    ->returnValue(false));
  $profile
    ->expects($this
    ->any())
    ->method('getName')
    ->will($this
    ->returnValue($name));
  $profile
    ->expects($this
    ->any())
    ->method('getDuration')
    ->will($this
    ->returnValue($duration));
  $profile
    ->expects($this
    ->any())
    ->method('getMemoryUsage')
    ->will($this
    ->returnValue(0));
  $profile
    ->expects($this
    ->any())
    ->method('getPeakMemoryUsage')
    ->will($this
    ->returnValue(0));
  $profile
    ->expects($this
    ->any())
    ->method('isTemplate')
    ->will($this
    ->returnValue($isTemplate));
  $profile
    ->expects($this
    ->any())
    ->method('getType')
    ->will($this
    ->returnValue($type));
  $profile
    ->expects($this
    ->any())
    ->method('getTemplate')
    ->will($this
    ->returnValue($templateName));
  $profile
    ->expects($this
    ->any())
    ->method('getProfiles')
    ->will($this
    ->returnValue($subProfiles));
  $profile
    ->expects($this
    ->any())
    ->method('getIterator')
    ->will($this
    ->returnValue(new ArrayIterator($subProfiles)));
  return $profile;
}