File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed
Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff 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 ();
You can’t perform that action at this time.
0 commit comments