forked from white-poto/php_crontab
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJobParseTest.php
41 lines (36 loc) · 1.03 KB
/
JobParseTest.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
<?php
/**
* Created by PhpStorm.
* User: Jenner
* Date: 2015/10/22
* Time: 9:20
*/
class JobParseTest extends PHPUnit_Framework_TestCase
{
/**
* @var \Jenner\Crontab\Parser\JobParse
*/
protected $job_parser;
public function setUp()
{
$this->job_parser = new \Jenner\Crontab\Parser\JobParse();
}
/**
* @dataProvider parseProvider
*/
public function testParse($raw, $time, $command)
{
$this->job_parser->parse($raw);
$this->assertEquals($this->job_parser->time(), $time);
$this->assertEquals($this->job_parser->command(), $command);
}
public function parseProvider()
{
return array(
array('* * * * * ls -al > test.log', '* * * * *', 'ls -al > test.log'),
array('* * * * * ls -al > test.log', '* * * * *', 'ls -al > test.log'),
array('* * * * * ls -al > test.log', '* * * * *', 'ls -al > test.log'),
array('* * * * * ls -al > test.log', '* * * * *', 'ls -al > test.log')
);
}
}