Skip to content

Commit 7bc6a6a

Browse files
committed
tests
1 parent e0a08f2 commit 7bc6a6a

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

tests/MissionTest.php

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ class MissionTest extends PHPUnit_Framework_TestCase
1919
protected $log_file = "/tmp/mission_test.log";
2020

2121
public function setUp()
22+
{
23+
24+
}
25+
26+
public function testNeed()
2227
{
2328
$logger = new \Monolog\Logger(new \Monolog\Handler\StreamHandler($this->log_file));
2429

@@ -28,10 +33,6 @@ public function setUp()
2833
"* * * * *",
2934
$logger
3035
);
31-
}
32-
33-
public function testNeed()
34-
{
3536
$this->assertTrue($this->mission->needRun(time()));
3637
$this->assertTrue($this->mission->needRun(time() + 60));
3738
$this->assertTrue($this->mission->needRun(time() + 120));
@@ -40,6 +41,14 @@ public function testNeed()
4041

4142
public function testRun()
4243
{
44+
$logger = new \Monolog\Logger(new \Monolog\Handler\StreamHandler($this->log_file));
45+
46+
$this->mission = new \Jenner\Crontab\Mission(
47+
"mission_test",
48+
"ls /",
49+
"* * * * *",
50+
$logger
51+
);
4352

4453
$this->mission->start();
4554
$this->mission->wait();

0 commit comments

Comments
 (0)