<commit_before><?php

use Carbon\Carbon;
use Illuminate\Support\Facades\File;
use Illuminated\Testing\Asserts\LogFileAsserts;

class LogFileAssertsTest extends TestCase
{
    use LogFileAsserts;

    protected function setUp()
    {
        parent::setUp();

        $this->createSampleLogFile();
    }

    private function createSampleLogFile()
    {
        $date = Carbon::now();
        $path = storage_path('logs/example.log');

        File::put($path, "[{$date}]: Sample log message 1!\n");
        File::append($path, "[{$date}]: Sample log message 2!\n");
        File::append($path, "[{$date}]: Sample log message 3!\n");
    }

    /** @test */
    public function it_has_log_file_exists_assertion()
    {
        $this->assertLogFileExists('example.log');
    }

    /** @test */
    public function it_has_log_file_not_exists_assertion()
    {
        $this->assertLogFileNotExists('foobar.log');
    }

    /** @test */
    public function it_has_log_file_contains_assertion()
    {
        $this->assertLogFileContains('example.log', 'Sample log message 1!');
        $this->assertLogFileContains('example.log', 'Sample log message 2!');
        $this->assertLogFileContains('example.log', 'Sample log message 3!');
    }

    /** @test */
    public function which_supports_array_of_contents()
    {
        $this->assertLogFileContains('example.log', [
            'Sample log message 1!',
            'Sample log message 2!',
            'Sample log message 3!',
        ]);
    }

    /** @test */
    public function which_supports_datetime_placeholder()
    {
        $this->assertLogFileContains('example.log', '[%datetime%]: Sample log message 1!');
        $this->assertLogFileContains('example.log', '[%datetime%]: Sample log message 2!');
        $this->assertLogFileContains('example.log', '[%datetime%]: Sample log message 3!');
    }

    /** @test */
    public function it_has_log_file_not_contains_assertion()
    {
        $this->assertLogFileNotContains('example.log', 'Sample log message 111!');
        $this->assertLogFileNotContains('example.log', 'Sample log message 222!');
        $this->assertLogFileNotContains('example.log', 'Sample log message 333!');
    }

    /** @test */
    public function which_also_supports_array_of_contents()
    {
        $this->assertLogFileNotContains('example.log', [
            'Sample log message 111!',
            'Sample log message 222!',
            'Sample log message 333!',
        ]);
    }<commit_msg>ITT: ScheduleAsserts tests minor fixes.<commit_after><?php

use Carbon\Carbon;
use Illuminate\Support\Facades\File;
use Illuminated\Testing\Asserts\LogFileAsserts;

class LogFileAssertsTest extends TestCase
{
    use LogFileAsserts;

    protected function setUp()
    {
        parent::setUp();

        $this->createSampleLogFile();
    }

    private function createSampleLogFile()
    {
        $date = Carbon::now();
        $path = storage_path('logs/example.log');

        File::put($path, "[{$date}]: Sample log message 1!\n");
        File::append($path, "[{$date}]: Sample log message 2!\n");
        File::append($path, "[{$date}]: Sample log message 3!\n");
    }

    /** @test */
    public function it_has_log_file_exists_assertion()
    {
        $this->assertLogFileExists('example.log');
    }

    /** @test */
    public function it_has_log_file_not_exists_assertion()
    {
        $this->assertLogFileNotExists('foobarbaz.log');
    }

    /** @test */
    public function it_has_log_file_contains_assertion()
    {
        $this->assertLogFileContains('example.log', 'Sample log message 1!');
        $this->assertLogFileContains('example.log', 'Sample log message 2!');
        $this->assertLogFileContains('example.log', 'Sample log message 3!');
    }

    /** @test */
    public function which_supports_array_of_contents()
    {
        $this->assertLogFileContains('example.log', [
            'Sample log message 1!',
            'Sample log message 2!',
            'Sample log message 3!',
        ]);
    }

    /** @test */
    public function which_supports_datetime_placeholder()
    {
        $this->assertLogFileContains('example.log', '[%datetime%]: Sample log message 1!');
        $this->assertLogFileContains('example.log', '[%datetime%]: Sample log message 2!');
        $this->assertLogFileContains('example.log', '[%datetime%]: Sample log message 3!');
    }

    /** @test */
    public function it_has_log_file_not_contains_assertion()
    {
        $this->assertLogFileNotContains('example.log', 'Unexisting log message 1!');
        $this->assertLogFileNotContains('example.log', 'Unexisting log message 2!');
        $this->assertLogFileNotContains('example.log', 'Unexisting log message 3!');
    }

    /** @test */
    public function which_also_supports_array_of_contents()
    {
        $this->assertLogFileNotContains('example.log', [
            'Unexisting log message 1!',
            'Unexisting log message 2!',
            'Unexisting log message 3!',
        ]);
    }
{'fraction_non_alphanumeric': 0.14811865419072268, 'fraction_numerical': 0.009556042205853077, 'mean_word_length': 2.912772585669782, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 31, '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': '3852343', 'n_tokens_mistral': 1539, 'n_tokens_neox': 1465, 'n_words': 298}