31 $cache = $this->getMock(
'TYPO3\\CMS\\Core\\Cache\\Frontend\\StringFrontend', array(
'isValidEntryIdentifier'), array(),
'', FALSE);
32 $cache->expects($this->once())->method(
'isValidEntryIdentifier')->with(
'foo')->will($this->returnValue(FALSE));
33 $cache->set(
'foo',
'bar');
40 $originalSourceCode =
'return "hello world!";';
41 $modifiedSourceCode =
'<?php' . chr(10) . $originalSourceCode . chr(10) .
'#';
42 $mockBackend = $this->getMock(
'TYPO3\\CMS\\Core\\Cache\\Backend\\PhpCapableBackendInterface', array(), array(),
'', FALSE);
43 $mockBackend->expects($this->once())->method(
'set')->with(
'Foo-Bar', $modifiedSourceCode, array(
'tags'), 1234);
45 $cache->set(
'Foo-Bar', $originalSourceCode, array(
'tags'), 1234);
53 $cache = $this->getMock(
'TYPO3\\CMS\\Core\\Cache\\Frontend\\PhpFrontend', array(
'dummy'), array(),
'', FALSE);
54 $cache->set(
'Foo-Bar', array());
61 $mockBackend = $this->getMock(
'TYPO3\\CMS\\Core\\Cache\\Backend\\PhpCapableBackendInterface', array(), array(),
'', FALSE);
62 $mockBackend->expects($this->once())->method(
'requireOnce')->with(
'Foo-Bar')->will($this->returnValue(
'hello world!'));
64 $result = $cache->requireOnce(
'Foo-Bar');
65 $this->assertSame(
'hello world!',
$result);
requireOnceCallsTheBackendsRequireOnceMethod()
static makeInstance($className)
setThrowsInvalidDataExceptionOnNonStringValues()
if($list_of_literals) if(!empty($literals)) if(!empty($literals)) $result
Analyse literals to prepend the N char to them if their contents aren't numeric.
setPassesPhpSourceCodeTagsAndLifetimeToBackend()
setChecksIfTheIdentifierIsValid()