Skip to content

Commit 06876f6

Browse files
committed
tests
1 parent 7bc6a6a commit 06876f6

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

tests/MissionTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ public function testNeed()
4141

4242
public function testRun()
4343
{
44-
$logger = new \Monolog\Logger(new \Monolog\Handler\StreamHandler($this->log_file));
44+
$stream = new \Monolog\Handler\StreamHandler($this->log_file);
45+
$logger = new \Monolog\Logger($stream);
4546

4647
$this->mission = new \Jenner\Crontab\Mission(
4748
"mission_test",
@@ -52,6 +53,7 @@ public function testRun()
5253

5354
$this->mission->start();
5455
$this->mission->wait();
56+
5557
$this->assertEquals($this->mission->errno(), 0);
5658
$out = file_get_contents($this->log_file);
5759
$except = shell_exec("ls /");

tests/logger.test.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
/**
3+
* Created by PhpStorm.
4+
* User: Jenner
5+
* Date: 2016/7/9
6+
* Time: 9:29
7+
*/
8+
9+
require dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php';
10+
11+
$logger = new \Monolog\Logger(new \Monolog\Handler\StreamHandler("/tmp/monolog.log"));
12+
$logger->info("test");

0 commit comments

Comments
 (0)