<commit_before><?php
/**
 * Created by PhpStorm.
 * User: Jenner
 * Date: 2016/6/23
 * Time: 11:06
 */

namespace Jenner\LogMonitor\Test\Reader;

use Jenner\LogMonitor\Reader\TailReader;

class ReaderTest extends \PHPUnit_Framework_TestCase
{
    public function testException()
    {
        $file = "/tmp/log-monitor.log";
        $this->setExpectedException("\\RuntimeException", "log file is not exists. file:" . $file);
        if(file_exists($file)) unlink($file);
        $config = array('log_file' => $file);
        $reader = new TailReader();
        $reader->configure($config);
    }

    public function testRead() {
        $file = "/tmp/log-monitor.log";
        touch($file);
        $reader = new TailReader();
        $config = array(
            TailReader::LOG_FILE => $file,
        );<commit_msg>tests<commit_after><?php
/**
 * Created by PhpStorm.
 * User: Jenner
 * Date: 2016/6/23
 * Time: 11:06
 */

namespace Jenner\LogMonitor\Test\Reader;

use Jenner\LogMonitor\Reader\TailReader;

class ReaderTest extends \PHPUnit_Framework_TestCase
{
    public function testException()
    {
        $file = "/tmp/log-monitor.log";
        $this->setExpectedException("\\RuntimeException");
        if(file_exists($file)) unlink($file);
        $config = array('log_file' => $file);
        $reader = new TailReader();
        $reader->configure($config);
    }

    public function testRead() {
        $file = "/tmp/log-monitor.log";
        touch($file);
        $reader = new TailReader();
        $config = array(
            TailReader::LOG_FILE => $file,
        );
{'fraction_non_alphanumeric': 0.1518588531821046, 'fraction_numerical': 0.013862633900441084, 'mean_word_length': 2.6338672768878717, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3683886', 'n_tokens_mistral': 508, 'n_tokens_neox': 489, 'n_words': 99}