2016-10-14 03:30:05 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace SilverStripe\View\Tests\SSViewerTest;
|
|
|
|
|
|
|
|
use SilverStripe\Dev\TestOnly;
|
|
|
|
use SilverStripe\ORM\ArrayList;
|
|
|
|
use SilverStripe\View\ArrayData;
|
|
|
|
use SilverStripe\View\ViewableData;
|
|
|
|
|
|
|
|
class CacheTestData extends ViewableData implements TestOnly
|
|
|
|
{
|
|
|
|
|
2016-12-16 05:34:21 +01:00
|
|
|
public $testWithCalls = 0;
|
|
|
|
public $testLoopCalls = 0;
|
2016-10-14 03:30:05 +02:00
|
|
|
|
2016-12-16 05:34:21 +01:00
|
|
|
public function TestWithCall()
|
|
|
|
{
|
|
|
|
$this->testWithCalls++;
|
2020-04-20 19:58:09 +02:00
|
|
|
return ArrayData::create(['Message' => 'Hi']);
|
2016-12-16 05:34:21 +01:00
|
|
|
}
|
2016-10-14 03:30:05 +02:00
|
|
|
|
2016-12-16 05:34:21 +01:00
|
|
|
public function TestLoopCall()
|
|
|
|
{
|
|
|
|
$this->testLoopCalls++;
|
|
|
|
return ArrayList::create(
|
2020-04-20 19:58:09 +02:00
|
|
|
[
|
|
|
|
ArrayData::create(['Message' => 'One']),
|
|
|
|
ArrayData::create(['Message' => 'Two'])
|
|
|
|
]
|
2016-12-16 05:34:21 +01:00
|
|
|
);
|
|
|
|
}
|
2016-10-14 03:30:05 +02:00
|
|
|
}
|