silverstripe-framework/tests/php/Control/ControllerTest/TestController.php

41 lines
793 B
PHP
Raw Normal View History

2016-10-14 03:30:05 +02:00
<?php
namespace SilverStripe\Control\Tests\ControllerTest;
use SilverStripe\Control\Controller;
use SilverStripe\Dev\TestOnly;
/**
* Simple controller for testing
*/
class TestController extends Controller implements TestOnly
{
private static $url_segment = 'TestController';
public $Content = "default content";
2016-10-14 03:30:05 +02:00
private static $allowed_actions = array(
'methodaction',
'stringaction',
'redirectbacktest',
'templateaction'
);
2016-10-14 03:30:05 +02:00
public function methodaction()
{
return array(
"Content" => "methodaction content"
);
}
2016-10-14 03:30:05 +02:00
public function stringaction()
{
return "stringaction was called.";
}
2016-10-14 03:30:05 +02:00
public function redirectbacktest()
{
return $this->redirectBack();
}
2016-10-14 03:30:05 +02:00
}