<commit_before><?php namespace Adviser\Validators;

use Mockery;
use Adviser\Messages\Message;

// Mock for testing purposes.
function file_exists()
{
    static $returnValue = [
        true, // 1st scenario.
        false, false, false, false, true, // 2nd scenario.
        false, false, false, false, false, // 3rd scenario.
    ];

    return array_shift($returnValue);
}

class ReadmeValidatorTest extends ValidatorTestCase
{

    /** @test */ public function it_does_its_job()
    {
        // Setup.
        $validator = new ReadmeValidator(null);

        // Testing.
        // 1st scenario: there is a README.md file, everything is cool.
        $messages = $validator->handle();
        $this->isMessageBag($messages);

        $this->assertEquals($messages->first()->getLevel(), Message::NORMAL);<commit_msg>This looks better.<commit_after><?php namespace Adviser\Validators;

use Mockery;
use Adviser\Messages\Message;

class ReadmeValidatorTest extends ValidatorTestCase
{

    /** @test */ public function it_does_its_job()
    {
        // Setup.
        $validator = new ReadmeValidator(null);

        $file = Mockery::mock("Adviser\Utility\File");

        $file->shouldReceive("exists")
             ->times(1 + (1 + 4) + (1 + 4))
             ->andReturn(
                 true, // 1st scenario.
                 false, false, false, false, true, // 2nd scenario.
                 false, false, false, false, false // 3rd scenario.
             );

        $validator->utility("File", $file);

        // Testing.
        // 1st scenario: there is a README.md file, everything is cool.
        $messages = $validator->handle();
        $this->isMessageBag($messages);

        $this->assertEquals($messages->first()->getLevel(), Message::NORMAL);
{'fraction_non_alphanumeric': 0.13744343891402716, 'fraction_numerical': 0.007352941176470588, 'mean_word_length': 2.382409177820268, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, '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': '2492975', 'n_tokens_mistral': 506, 'n_tokens_neox': 496, 'n_words': 126}