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
|
|
|
|
{
|
2016-12-16 05:34:21 +01:00
|
|
|
public $Content = "default content";
|
2016-10-14 03:30:05 +02:00
|
|
|
|
2016-12-16 05:34:21 +01:00
|
|
|
private static $allowed_actions = array(
|
|
|
|
'methodaction',
|
|
|
|
'stringaction',
|
|
|
|
'redirectbacktest',
|
|
|
|
'templateaction'
|
|
|
|
);
|
2016-10-14 03:30:05 +02:00
|
|
|
|
2016-12-16 05:34:21 +01:00
|
|
|
public function methodaction()
|
|
|
|
{
|
|
|
|
return array(
|
|
|
|
"Content" => "methodaction content"
|
|
|
|
);
|
|
|
|
}
|
2016-10-14 03:30:05 +02:00
|
|
|
|
2016-12-16 05:34:21 +01:00
|
|
|
public function stringaction()
|
|
|
|
{
|
|
|
|
return "stringaction was called.";
|
|
|
|
}
|
2016-10-14 03:30:05 +02:00
|
|
|
|
2016-12-16 05:34:21 +01:00
|
|
|
public function redirectbacktest()
|
|
|
|
{
|
|
|
|
return $this->redirectBack();
|
|
|
|
}
|
2016-10-14 03:30:05 +02:00
|
|
|
}
|