ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Twig_Tests_Profiler_Dumper_AbstractTest Class Reference
+ Inheritance diagram for Twig_Tests_Profiler_Dumper_AbstractTest:
+ Collaboration diagram for Twig_Tests_Profiler_Dumper_AbstractTest:

Protected Member Functions

 getProfile ()
 

Private Member Functions

 getIndexProfile (array $subProfiles=array())
 
 getEmbeddedBlockProfile (array $subProfiles=array())
 
 getEmbeddedTemplateProfile (array $subProfiles=array())
 
 getIncludedTemplateProfile (array $subProfiles=array())
 
 getMacroProfile (array $subProfiles=array())
 
 generateProfile ($name, $duration, $isTemplate, $type, $templateName, array $subProfiles=array())
 

Detailed Description

Definition at line 12 of file AbstractTest.php.

Member Function Documentation

◆ generateProfile()

Twig_Tests_Profiler_Dumper_AbstractTest::generateProfile (   $name,
  $duration,
  $isTemplate,
  $type,
  $templateName,
array  $subProfiles = array() 
)
private
Parameters
string$name
float$duration
bool$isTemplate
string$type
string$templateName
array$subProfiles
Returns
Twig_Profiler_Profile

Definition at line 84 of file AbstractTest.php.

85 {
86 $profile = $this->getMockBuilder('Twig_Profiler_Profile')->disableOriginalConstructor()->getMock();
87
88 $profile->expects($this->any())->method('isRoot')->will($this->returnValue(false));
89 $profile->expects($this->any())->method('getName')->will($this->returnValue($name));
90 $profile->expects($this->any())->method('getDuration')->will($this->returnValue($duration));
91 $profile->expects($this->any())->method('getMemoryUsage')->will($this->returnValue(0));
92 $profile->expects($this->any())->method('getPeakMemoryUsage')->will($this->returnValue(0));
93 $profile->expects($this->any())->method('isTemplate')->will($this->returnValue($isTemplate));
94 $profile->expects($this->any())->method('getType')->will($this->returnValue($type));
95 $profile->expects($this->any())->method('getTemplate')->will($this->returnValue($templateName));
96 $profile->expects($this->any())->method('getProfiles')->will($this->returnValue($subProfiles));
97 $profile->expects($this->any())->method('getIterator')->will($this->returnValue(new ArrayIterator($subProfiles)));
98
99 return $profile;
100 }
$type

References $name, and $type.

Referenced by getEmbeddedBlockProfile(), getEmbeddedTemplateProfile(), getIncludedTemplateProfile(), getIndexProfile(), and getMacroProfile().

+ Here is the caller graph for this function:

◆ getEmbeddedBlockProfile()

Twig_Tests_Profiler_Dumper_AbstractTest::getEmbeddedBlockProfile ( array  $subProfiles = array())
private

Definition at line 54 of file AbstractTest.php.

55 {
56 return $this->generateProfile('body', 0.0001, false, 'block', 'embedded.twig', $subProfiles);
57 }
generateProfile($name, $duration, $isTemplate, $type, $templateName, array $subProfiles=array())

References generateProfile().

Referenced by getProfile().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getEmbeddedTemplateProfile()

Twig_Tests_Profiler_Dumper_AbstractTest::getEmbeddedTemplateProfile ( array  $subProfiles = array())
private

Definition at line 59 of file AbstractTest.php.

60 {
61 return $this->generateProfile('main', 0.0001, true, 'template', 'embedded.twig', $subProfiles);
62 }

References generateProfile().

Referenced by getProfile().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getIncludedTemplateProfile()

Twig_Tests_Profiler_Dumper_AbstractTest::getIncludedTemplateProfile ( array  $subProfiles = array())
private

Definition at line 64 of file AbstractTest.php.

65 {
66 return $this->generateProfile('main', 0.0001, true, 'template', 'included.twig', $subProfiles);
67 }

References generateProfile().

Referenced by getProfile().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getIndexProfile()

Twig_Tests_Profiler_Dumper_AbstractTest::getIndexProfile ( array  $subProfiles = array())
private

Definition at line 49 of file AbstractTest.php.

50 {
51 return $this->generateProfile('main', 1, true, 'template', 'index.twig', $subProfiles);
52 }

References generateProfile().

Referenced by getProfile().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMacroProfile()

Twig_Tests_Profiler_Dumper_AbstractTest::getMacroProfile ( array  $subProfiles = array())
private

Definition at line 69 of file AbstractTest.php.

70 {
71 return $this->generateProfile('foo', 0.0001, false, 'macro', 'index.twig', $subProfiles);
72 }

References generateProfile().

Referenced by getProfile().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getProfile()

Twig_Tests_Profiler_Dumper_AbstractTest::getProfile ( )
protected

Definition at line 14 of file AbstractTest.php.

15 {
16 $profile = $this->getMockBuilder('Twig_Profiler_Profile')->disableOriginalConstructor()->getMock();
17
18 $profile->expects($this->any())->method('isRoot')->will($this->returnValue(true));
19 $profile->expects($this->any())->method('getName')->will($this->returnValue('main'));
20 $profile->expects($this->any())->method('getDuration')->will($this->returnValue(1));
21 $profile->expects($this->any())->method('getMemoryUsage')->will($this->returnValue(0));
22 $profile->expects($this->any())->method('getPeakMemoryUsage')->will($this->returnValue(0));
23
24 $subProfiles = array(
25 $this->getIndexProfile(
26 array(
29 array(
31 )
32 ),
33 $this->getMacroProfile(),
35 array(
37 )
38 ),
39 )
40 ),
41 );
42
43 $profile->expects($this->any())->method('getProfiles')->will($this->returnValue($subProfiles));
44 $profile->expects($this->any())->method('getIterator')->will($this->returnValue(new ArrayIterator($subProfiles)));
45
46 return $profile;
47 }
getIndexProfile(array $subProfiles=array())
getMacroProfile(array $subProfiles=array())
getEmbeddedTemplateProfile(array $subProfiles=array())
getEmbeddedBlockProfile(array $subProfiles=array())
getIncludedTemplateProfile(array $subProfiles=array())

References getEmbeddedBlockProfile(), getEmbeddedTemplateProfile(), getIncludedTemplateProfile(), getIndexProfile(), and getMacroProfile().

+ Here is the call graph for this function:

The documentation for this class was generated from the following file: