Source of file ViewableDataProcessorTest.php
Size: 1,225 Bytes - Last Modified: 2021-12-24T06:50:57+00:00
/var/www/docs.ssmods.com/process/src/tests/Processors/ViewableDataProcessorTest.php
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 | <?php namespace Heyday\CacheInclude\Tests; use Heyday\CacheInclude\Processors\ViewableDataProcessor; use SilverStripe\Dev\SapphireTest; use SilverStripe\View\ViewableData; class ViewableDataProcessorTest extends SapphireTest { protected $processor; protected function setUp() { $this->processor = new ViewableDataProcessor; } protected function tearDown() { $this->processor = null; } /** * @expectedException \InvalidArgumentException */ public function testException() { $processor = $this->processor; $processor('test'); } public function testHasMethod() { $processor = $this->processor; $processor->setContext(new TestObject); $this->assertEquals('hello', $processor('hello')); } public function testRenderWith() { $processor = $this->processor; $processor->setContext(new TestObject); $this->assertEquals('testing', $processor('testing')); } } class TestObject extends ViewableData { public function hello() { return 'hello'; } public function renderWith($template, $customFields = null) { return $template; } } |