<commit_before><?php
namespace Bolt\Tests\Extensions;

use Bolt\Extensions\ExtensionsInfoService;
use Bolt\Tests\BoltUnitTest;

/**
 * Class to test src/Extensions/ExtensionsInfoService.
 *
 * @author <NAME> <<EMAIL>>
 */
class InfoServiceTest extends BoltUnitTest
{
    public function testPackageInfo()
    {
        $app = $this->getApp();
        $service = new ExtensionsInfoService($app['extend.site'], $app['extend.urls']);
        $service->setFormat('raw');

        $response = $service->info("mytest", '2.0.0');
        $this->assertEquals($app['extend.site'].'info.json?package=mytest&bolt=2.0.0', $response);
    }

    public function testInfoList()
    {
        $app = $this->getApp();
        $service = new ExtensionsInfoService($app['extend.site'], $app['extend.urls']);
        $service->setFormat('raw');

        $response = $service->all();
        $this->assertEquals($app['extend.site'].'list.json', $response);
    }
}

namespace Bolt\Extensions;

function file_get_contents($url)
{
    return $url;
}<commit_msg>Update InfoServiceTest<commit_after><?php
namespace Bolt\Tests\Extensions;

use Bolt\Extensions\ExtensionsInfoService;
use Bolt\Tests\BoltUnitTest;

/**
 * Class to test src/Extensions/ExtensionsInfoService.
 *
 * @author <NAME> <<EMAIL>>
 */
class InfoServiceTest extends BoltUnitTest
{
    public function testPackageInfoValid()
    {
        $app = $this->getApp();
        $service = new ExtensionsInfoService($app['guzzle.client'], $app['extend.site'], $app['extend.urls'], $app['deprecated.php']);

        $response = $service->info('gawain/clippy', '2.0.0');
        $this->assertObjectHasAttribute('package', $response);
        $this->assertObjectHasAttribute('version', $response);
    }

    public function testPackageInfoInvalid()
    {
        $app = $this->getApp();
        $service = new ExtensionsInfoService($app['guzzle.client'], $app['extend.site'], $app['extend.urls'], $app['deprecated.php']);

        $response = $service->info('rossriley/mytest', '2.0.0');
        $this->assertObjectHasAttribute('package', $response);
        $this->assertObjectHasAttribute('version', $response);
        $this->assertFalse($response->package);
        $this->assertFalse($response->version);
    }

    public function testInfoList()
    {
        $app = $this->getApp();
        $service = new ExtensionsInfoService($app['guzzle.client'], $app['extend.site'], $app['extend.urls'], $app['deprecated.php']);

        $response = $service->all();
        $this->assertObjectHasAttribute('packages', $response);
        $this->assertNotCount(0, $response->packages);
    }
}
{'fraction_non_alphanumeric': 0.17835365853658536, 'fraction_numerical': 0.004954268292682927, 'mean_word_length': 3.7814207650273226, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 34, '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': '5038249', 'n_tokens_mistral': 789, 'n_tokens_neox': 788, 'n_words': 127}