silverstripe-framework/tests/php/View/SSViewerTest/CacheTestData.php

33 lines
730 B
PHP
Raw Normal View History

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
{
public $testWithCalls = 0;
public $testLoopCalls = 0;
2016-10-14 03:30:05 +02:00
public function TestWithCall()
{
$this->testWithCalls++;
return ArrayData::create(array('Message' => 'Hi'));
}
2016-10-14 03:30:05 +02:00
public function TestLoopCall()
{
$this->testLoopCalls++;
return ArrayList::create(
array(
ArrayData::create(array('Message' => 'One')),
ArrayData::create(array('Message' => 'Two'))
)
);
}
2016-10-14 03:30:05 +02:00
}