<commit_before><?php

namespace NickMoline\Robots\Test;

use League\Uri\Http;
use NickMoline\Robots\RobotsTxt;
use PHPUnit_Framework_TestCase;

class UriPackageUsageTest extends PHPUnit_Framework_TestCase
{
    public function testUrl()
    {
        $this->assertTrue((new RobotsTxt('https://www.google.com/search'))->urlInfo() instanceof Http);
        $this->assertEquals('/search', (new RobotsTxt('https://www.google.com/search'))->getRelativeUrl());
        $this->assertEquals('https://www.google.com/robots.txt', (new RobotsTxt('https://www.google.com/search'))->getRobotsUrl());
        $this->assertEquals(false, (new RobotsTxt('https://www.google.com/search'))->validate());
        $this->assertEquals(true, (new RobotsTxt('https://www.google.com/search/about'))->validate());
        $this->assertEquals(false, (new RobotsTxt('https://www.google.com/sdch'))->validate());
        $this->assertEquals(false, (new RobotsTxt('https://www.google.com/ebooks/'))->validate());
        $this->assertEquals('https://www.google.com/', (new RobotsTxt('https://www.google.com/search/about'))->getHomepageUrl());
    }
}
<commit_msg>modifying the test<commit_after><?php

namespace NickMoline\Robots\Test;

use League\Uri\Http;
use NickMoline\Robots\RobotsTxt;
use PHPUnit_Framework_TestCase;

class UriPackageUsageTest extends PHPUnit_Framework_TestCase
{
    public function testUrl()
    {
        $validator = new RobotsTxt();

        $this->assertEquals('/search', $validator->setURL('https://www.google.com/search')->getRelativeUrl());
        $this->assertEquals('https://www.google.com/robots.txt', $validator->setURL('https://www.google.com/search')->getRobotsUrl());
        $this->assertEquals('https://www.google.com/', $validator->setURL('https://www.google.com/search')->getHomepageUrl());
        $this->assertEquals(true, $validator->setURL('https://www.google.com/search/about')->validate());
        $this->assertEquals(false, $validator->setURL('https://www.google.com/search')->validate());
        $this->assertEquals('Denied by robots.txt', $validator->getReason());
    }
}

{'fraction_non_alphanumeric': 0.19494756911344138, 'fraction_numerical': 0.0, 'mean_word_length': 4.582446808510638, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 36, 'https://': 17, 'lorem ipsum': 0, 'www.': 17, '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': '7294682', 'n_tokens_mistral': 638, 'n_tokens_neox': 643, 'n_words': 76}