forked from MUlt1mate/cron-manager
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathTaskLoaderTest.php
53 lines (46 loc) · 1.42 KB
/
TaskLoaderTest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
namespace vm\cron_tests;
use vm\cron\TaskLoader;
/**
* @author mult1mate
* Date: 07.02.16
* Time: 13:49
*/
class TaskLoaderTest extends \PHPUnit_Framework_TestCase
{
public function testSetClassFolder()
{
$set = TaskLoader::setClassFolder(__DIR__);
$this->assertTrue(is_array($set));
}
public function testGetAllMethods()
{
$result = TaskLoader::getAllMethods(
[__DIR__ . '/..', __DIR__, __DIR__ . '/correct_mocks'],
[null, 'mult1mate\\crontab_tests\\']
);
$this->assertTrue(is_array($result));
}
public function testGetAllMethodsExceptions()
{
$this->setExpectedException('vm\cron\TaskManagerException');
TaskLoader::getAllMethods('/mocks/');
}
public function testGetControllerMethodsExceptions()
{
$this->setExpectedException('vm\cron\TaskManagerException');
TaskLoader::getControllerMethods('/mocks/');
}
public function testLoadControllerExceptionsFile()
{
$this->setExpectedException('vm\cron\TaskManagerException');
TaskLoader::setClassFolder(__DIR__ . '/wrong_mocks');
TaskLoader::loadController('FileWithoutClass');
}
public function testLoadControllerExceptions()
{
$this->setExpectedException('vm\cron\TaskManagerException');
TaskLoader::setClassFolder(__DIR__);
TaskLoader::loadController('MockClass');
}
}