2015-08-25 11:14:15 +02:00
|
|
|
<?php
|
2016-08-19 00:51:35 +02:00
|
|
|
|
2016-10-14 03:30:05 +02:00
|
|
|
namespace SilverStripe\Dev\Tests;
|
|
|
|
|
2016-08-19 00:51:35 +02:00
|
|
|
use SilverStripe\Dev\TaskRunner;
|
|
|
|
use SilverStripe\Dev\SapphireTest;
|
2016-10-14 03:30:05 +02:00
|
|
|
use ReflectionMethod;
|
|
|
|
|
2015-08-25 11:14:15 +02:00
|
|
|
class TaskRunnerTest extends SapphireTest {
|
|
|
|
|
|
|
|
public function testTaskEnabled() {
|
|
|
|
$runner = new TaskRunner();
|
|
|
|
$method = new ReflectionMethod($runner, 'taskEnabled');
|
|
|
|
$method->setAccessible(true);
|
|
|
|
|
2016-10-14 03:30:05 +02:00
|
|
|
$this->assertTrue($method->invoke($runner, TaskRunnerTest\TaskRunnerTest_EnabledTask::class),
|
2015-08-25 11:14:15 +02:00
|
|
|
'Enabled task incorrectly marked as disabled');
|
2016-10-14 03:30:05 +02:00
|
|
|
$this->assertFalse($method->invoke($runner, TaskRunnerTest\TaskRunnerTest_DisabledTask::class),
|
2015-08-25 11:14:15 +02:00
|
|
|
'Disabled task incorrectly marked as enabled');
|
2016-10-14 03:30:05 +02:00
|
|
|
$this->assertFalse($method->invoke($runner, TaskRunnerTest\TaskRunnerTest_AbstractTask::class),
|
2015-08-25 11:14:15 +02:00
|
|
|
'Disabled task incorrectly marked as enabled');
|
2016-10-14 03:30:05 +02:00
|
|
|
$this->assertTrue($method->invoke($runner, TaskRunnerTest\TaskRunnerTest_ChildOfAbstractTask::class),
|
2015-08-25 11:14:15 +02:00
|
|
|
'Enabled task incorrectly marked as disabled');
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|