<commit_before><?php
namespace MOC\V\TestSuite\Tests\Core\FileSystem;

use MOC\V\Core\FileSystem\FileSystem;
use MOC\V\Core\FileSystem\Vendor\Vendor;
use MOC\V\TestSuite\AbstractTestCase;

/**
 * Class ModuleTest
 *
 * @package MOC\V\TestSuite\Tests\Core\FileSystem
 */
class ModuleTest extends AbstractTestCase
{

    public function testModule()
    {

        /** @var \MOC\V\Core\FileSystem\Component\Bridge\Bridge $MockBridge */
        $MockBridge = $this->getMockBuilder('MOC\V\Core\FileSystem\Component\Bridge\Bridge')->getMock();
        $Vendor = new Vendor(new $MockBridge);
        $Module = new FileSystem($Vendor);

        $this->assertInstanceOf('MOC\V\Core\FileSystem\Component\IVendorInterface',
            $Module->getVendorInterface()
        );
        $this->assertInstanceOf('MOC\V\Core\FileSystem\Component\IVendorInterface',
            $Module->setBridgeInterface($MockBridge)
        );
        $this->assertInstanceOf('MOC\V\Core\FileSystem\Component\IBridgeInterface',
            $Module->getBridgeInterface()
        );

    }

    public function testStaticUniversalDownload()
    {

        try {
            $this->invokeClassMethod('MOC\V\Core\FileSystem\FileSystem', 'getUniversalDownload', array(__DIR__));
        } catch (\Exception $E) {
            $this->assertInstanceOf('MOC\V\Core\FileSystem\Component\Exception\Repository\TypeFileException', $E);
        }

        $Loader = $this->invokeClassMethod('MOC\V\Core\FileSystem\FileSystem', 'getUniversalDownload',
            array(__FILE__)
        );
        $this->assertInstanceOf('MOC\V\Core\FileSystem\Component\IBridgeInterface', $Loader);

        $this->assertEquals(__FILE__, $Loader->getLocation());
        $this->assertEquals(__FILE__, $Loader->getRealPath());
        if (( $MimeType = $Loader->getMimeType() )) {
            $this->assertEquals('text/x-php', $MimeType);
        } else {
            $this->assertEquals(false, $MimeType);
        }
        $this->assertInternalType('string', (string)$Loader);
        $this->assertStringEqualsFile(__FILE__, (string)$Loader);

        $Loader = $this->invokeClassMethod('MOC\V\Core\FileSystem\FileSystem', 'getUniversalDownload',
            array(basename(__FILE__))
        );
        $this->assertInstanceOf('MOC\V\Core\FileSystem\Component\IBridgeInterface', $Loader);

        $this->assertEquals(basename(__FILE__), $Loader->getLocation());
        $this->assertEquals('', $Loader->getRealPath());
        if (( $MimeType = $Loader->getMimeType() )) {
            $this->assertEquals('text/x-php', $MimeType);
        } else {
            $this->assertEquals(false, $MimeType);
        }
        $this->assertInternalType('string', (string)$Loader);
        $this->assertEquals('', (string)$Loader);
    }

    public function testStaticUniversalFileLoader()
    {

        try {
            $this->invokeClassMethod('MOC\V\Core\FileSystem\FileSystem', 'getUniversalFileLoader', array(__DIR__));
        } catch (\Exception $E) {
            $this->assertInstanceOf('MOC\V\Core\FileSystem\Component\Exception\Repository\TypeFileException', $E);
        }

        $Loader = $this->invokeClassMethod('MOC\V\Core\FileSystem\FileSystem', 'getUniversalFileLoader',
            array(__FILE__)
        );
        $this->assertInstanceOf('MOC\V\Core\FileSystem\Component\IBridgeInterface', $Loader);

        $this->assertEquals(__FILE__, $Loader->getLocation());
        $this->assertEquals(__FILE__, $Loader->getRealPath());
        if (( $MimeType = $Loader->getMimeType() )) {
            $this->assertEquals('text/x-php', $MimeType);
        } else {
            $this->assertEquals(false, $MimeType);
        }
        $this->assertInternalType('string', (string)$Loader);
        $this->assertStringEqualsFile(__FILE__, (string)$Loader);

        $Loader = $this->invokeClassMethod('MOC\V\Core\FileSystem\FileSystem', 'getUniversalFileLoader',
            array(basename(__FILE__))
        );
        $this->assertInstanceOf('MOC\V\Core\FileSystem\Component\IBridgeInterface', $Loader);

        $this->assertEquals(basename(__FILE__), $Loader->getLocation());
        $this->assertEquals('', $Loader->getRealPath());
        if (( $MimeType = $Loader->getMimeType() )) {
            $this->assertEquals('text/x-php', $MimeType);
        } else {
            $this->assertEquals(false, $MimeType);
        }
        $this->assertInternalType('string', (string)$Loader);
        $this->assertEquals('', (string)$Loader);
    }

    public function testStaticSymfonyFinder()
    {

        try {
            $this->invokeClassMethod('MOC\V\Core\FileSystem\FileSystem', 'getSymfonyFinder', array(__DIR__));
        } catch (\Exception $E) {<commit_msg>Update: TestSuite<commit_after><?php
namespace MOC\V\TestSuite\Tests\Core\FileSystem;

use MOC\V\Core\FileSystem\FileSystem;
use MOC\V\Core\FileSystem\Vendor\Vendor;
use MOC\V\TestSuite\AbstractTestCase;

/**
 * Class ModuleTest
 *
 * @package MOC\V\TestSuite\Tests\Core\FileSystem
 */
class ModuleTest extends AbstractTestCase
{

    public function testModule()
    {

        /** @var \MOC\V\Core\FileSystem\Component\Bridge\Bridge $MockBridge */
        $MockBridge = $this->getMockBuilder('MOC\V\Core\FileSystem\Component\Bridge\Bridge')->getMock();
        $Vendor = new Vendor(new $MockBridge);
        $Module = new FileSystem($Vendor);

        $this->assertInstanceOf('MOC\V\Core\FileSystem\Component\IVendorInterface',
            $Module->getVendorInterface()
        );
        $this->assertInstanceOf('MOC\V\Core\FileSystem\Component\IVendorInterface',
            $Module->setBridgeInterface($MockBridge)
        );
        $this->assertInstanceOf('MOC\V\Core\FileSystem\Component\IBridgeInterface',
            $Module->getBridgeInterface()
        );

    }

    public function testStaticUniversalDownload()
    {

        try {
            $this->invokeClassMethod('MOC\V\Core\FileSystem\FileSystem', 'getUniversalDownload', array(__DIR__));
        } catch (\Exception $E) {
            $this->assertInstanceOf('MOC\V\Core\FileSystem\Component\Exception\Repository\TypeFileException', $E);
        }

        $Loader = $this->invokeClassMethod('MOC\V\Core\FileSystem\FileSystem', 'getUniversalDownload',
            array(__FILE__)
        );
        $this->assertInstanceOf('MOC\V\Core\FileSystem\Component\IBridgeInterface', $Loader);

        $this->assertEquals(__FILE__, $Loader->getLocation());
        $this->assertEquals(__FILE__, $Loader->getRealPath());
        if (( $MimeType = $Loader->getMimeType() )) {
            $this->assertEquals('text/x-php', $MimeType);
        } else {
            $this->assertEquals(false, $MimeType);
        }
        $this->assertInternalType('string', (string)$Loader);
        $this->assertStringEqualsFile(__FILE__, (string)$Loader);

        $Loader = $this->invokeClassMethod('MOC\V\Core\FileSystem\FileSystem', 'getUniversalDownload',
            array(basename(__FILE__))
        );
        $this->assertInstanceOf('MOC\V\Core\FileSystem\Component\IBridgeInterface', $Loader);

        $this->assertEquals(basename(__FILE__), $Loader->getLocation());
        $this->assertEquals('', $Loader->getRealPath());
        if (( $MimeType = $Loader->getMimeType() )) {
            $this->assertEquals('text/x-php', $MimeType);
        } else {
            $this->assertEquals(false, $MimeType);
        }
        $this->assertInternalType('string', (string)$Loader);
        $this->assertEquals('', (string)$Loader);
    }

    public function testStaticUniversalFileLoader()
    {

        try {
            $this->invokeClassMethod('MOC\V\Core\FileSystem\FileSystem', 'getUniversalFileLoader', array(__DIR__));
        } catch (\Exception $E) {
            $this->assertInstanceOf('MOC\V\Core\FileSystem\Component\Exception\Repository\TypeFileException', $E);
        }

        $Loader = $this->invokeClassMethod('MOC\V\Core\FileSystem\FileSystem', 'getUniversalFileLoader',
            array(__FILE__)
        );
        $this->assertInstanceOf('MOC\V\Core\FileSystem\Component\IBridgeInterface', $Loader);

        $this->assertEquals(__FILE__, $Loader->getLocation());
        $this->assertEquals(__FILE__, $Loader->getRealPath());
        if (( $MimeType = $Loader->getMimeType() )) {
            $this->assertEquals('text/x-php', $MimeType);
        } else {
            $this->assertEquals(false, $MimeType);
        }
        $this->assertInternalType('string', (string)$Loader);
        $this->assertStringEqualsFile(__FILE__, (string)$Loader);

        $Loader = $this->invokeClassMethod('MOC\V\Core\FileSystem\FileSystem', 'getUniversalFileLoader',
            array(basename(__FILE__))
        );
        $this->assertInstanceOf('MOC\V\Core\FileSystem\Component\IBridgeInterface', $Loader);

        $this->assertEquals(basename(__FILE__), $Loader->getLocation());
        $this->assertEquals('', $Loader->getRealPath());
        if (( $MimeType = $Loader->getMimeType() )) {
            $this->assertEquals('text/x-php', $MimeType);
        } else {
            $this->assertEquals(false, $MimeType);
        }
        $this->assertInternalType('string', (string)$Loader);
        $this->assertEquals('', (string)$Loader);
    }

    public function testStaticSymfonyFinder()
    {

        if (isset( $_ENV['CI'] )) {
            $this->markTestSkipped(
                'Finder is not available on CircleCI'
            );
        }
        
        try {
            $this->invokeClassMethod('MOC\V\Core\FileSystem\FileSystem', 'getSymfonyFinder', array(__DIR__));
        } catch (\Exception $E) {
{'fraction_non_alphanumeric': 0.1586077532305127, 'fraction_numerical': 0.0, 'mean_word_length': 2.920343137254902, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 118, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2358787', 'n_tokens_mistral': 2811, 'n_tokens_neox': 2737, 'n_words': 331}