silverstripe-framework/tests/php/Dev/TaskRunnerTest.php

27 lines
942 B
PHP
Raw Normal View History

<?php
2016-10-14 03:30:05 +02:00
namespace SilverStripe\Dev\Tests;
use SilverStripe\Dev\TaskRunner;
use SilverStripe\Dev\SapphireTest;
2016-10-14 03:30:05 +02:00
use ReflectionMethod;
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),
'Enabled task incorrectly marked as disabled');
2016-10-14 03:30:05 +02:00
$this->assertFalse($method->invoke($runner, TaskRunnerTest\TaskRunnerTest_DisabledTask::class),
'Disabled task incorrectly marked as enabled');
2016-10-14 03:30:05 +02:00
$this->assertFalse($method->invoke($runner, TaskRunnerTest\TaskRunnerTest_AbstractTask::class),
'Disabled task incorrectly marked as enabled');
2016-10-14 03:30:05 +02:00
$this->assertTrue($method->invoke($runner, TaskRunnerTest\TaskRunnerTest_ChildOfAbstractTask::class),
'Enabled task incorrectly marked as disabled');
}
}