<commit_before><?php
namespace Aura\Framework;

/**
 * Test class for Inflect.
 */
class InflectTest extends \PHPUnit_Framework_TestCase
{
    /**
     * @var Inflect
     */
    protected $inflect;

    /**
     * Sets up the fixture, for example, opens a network connection.
     * This method is called before a test is executed.
     */
    public function setUp()
    {
        parent::setUp();
        $this->inflect = new Inflect;
    }

    /**
     * Tears down the fixture, for example, closes a network connection.
     * This method is called after a test is executed.
     */
    public function tearDown()
    {
        parent::tearDown();
    }

    public function testCamelToDashes()
    {
        $expect = 'foo-bar-baz';
        $actual = $this->inflect->camelToDashes('FooBarBaz');
        $this->assertSame($expect, $actual);
    }

    public function testCamelToUnder()
    {
        $expect = 'Foo_Bar_Baz';
        $actual = $this->inflect->camelToUnder('FooBarBaz');
        $this->assertSame($expect, $actual);
    }

    public function testClassToFile()
    {
        // used PSR-0 spec as a base
        $list = [
            'Doctrine\Common\IsolatedClassLoader'   => 'Doctrine' . DIRECTORY_SEPARATOR . 'Common' . DIRECTORY_SEPARATOR . 'IsolatedClassLoader.php',
            'Symfony\Core\Request'                  => 'Symfony' . DIRECTORY_SEPARATOR . 'Core' . DIRECTORY_SEPARATOR . 'Request.php',
            'Zend'                                  => 'Zend.php',
            'Zend\Acl'                              => 'Zend' . DIRECTORY_SEPARATOR . 'Acl.php',
            'Zend\Mail\Message'                     => 'Zend' . DIRECTORY_SEPARATOR . 'Mail' . DIRECTORY_SEPARATOR . 'Message.php',
            'aura\package\ClassName'               => 'aura' . DIRECTORY_SEPARATOR . 'package' . DIRECTORY_SEPARATOR . 'ClassName.php',
            'aura\pkg_name\Class_Name'             => 'aura' . DIRECTORY_SEPARATOR . 'pkg_name' . DIRECTORY_SEPARATOR . 'Class' . DIRECTORY_SEPARATOR . 'Name.php',
        ];
        
        foreach ($list as $class => $expect) {
            $actual = $this->inflect->classToFile($class);
            $this->assertSame($expect, $actual);
        }
    }

    public function testDashesToCamel()
    {
        $expect = 'fooBarBaz';
        $actual = $this->inflect->dashesToCamel('foo-bar-baz');
        $this->assertSame($expect, $actual);
    }

    public function testDashesToStudly()
    {
        $expect = 'FooBarBaz';
        $actual = $this->inflect->dashesToStudly('foo-bar-baz');
        $this->assertSame($expect, $actual);
    }<commit_msg>Replaced static Unix-Style Directory Separators with dynamic, environment-based ones from PHPs DIRECTORY_SEPARATOR Constant using str_replace<commit_after><?php
namespace Aura\Framework;

/**
 * Test class for Inflect.
 */
class InflectTest extends \PHPUnit_Framework_TestCase
{
    /**
     * @var Inflect
     */
    protected $inflect;

    /**
     * Sets up the fixture, for example, opens a network connection.
     * This method is called before a test is executed.
     */
    public function setUp()
    {
        parent::setUp();
        $this->inflect = new Inflect;
    }

    /**
     * Tears down the fixture, for example, closes a network connection.
     * This method is called after a test is executed.
     */
    public function tearDown()
    {
        parent::tearDown();
    }

    public function testCamelToDashes()
    {
        $expect = 'foo-bar-baz';
        $actual = $this->inflect->camelToDashes('FooBarBaz');
        $this->assertSame($expect, $actual);
    }

    public function testCamelToUnder()
    {
        $expect = 'Foo_Bar_Baz';
        $actual = $this->inflect->camelToUnder('FooBarBaz');
        $this->assertSame($expect, $actual);
    }

    public function testClassToFile()
    {
        // used PSR-0 spec as a base
        $list = [
            'Doctrine\Common\IsolatedClassLoader'   => 'Doctrine/Common/IsolatedClassLoader.php',
            'Symfony\Core\Request'                  => 'Symfony/Core/Request.php',
            'Zend'                                  => 'Zend.php',
            'Zend\Acl'                              => 'Zend/Acl.php',
            'Zend\Mail\Message'                     => 'Zend/Mail/Message.php',
            'aura\package\ClassName'                => 'aura/package/ClassName.php',
            'aura\pkg_name\Class_Name'              => 'aura/pkg_name/Class/Name.php',
        ];
        
        $list = str_replace('/', DIRECTORY_SEPARATOR, $list);
        
        foreach ($list as $class => $expect) {
            $actual = $this->inflect->classToFile($class);
            $this->assertSame($expect, $actual);
        }
    }

    public function testDashesToCamel()
    {
        $expect = 'fooBarBaz';
        $actual = $this->inflect->dashesToCamel('foo-bar-baz');
        $this->assertSame($expect, $actual);
    }

    public function testDashesToStudly()
    {
        $expect = 'FooBarBaz';
        $actual = $this->inflect->dashesToStudly('foo-bar-baz');
        $this->assertSame($expect, $actual);
    }
{'fraction_non_alphanumeric': 0.13322914631764016, 'fraction_numerical': 0.0003907013088493846, 'mean_word_length': 1.9767441860465116, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 51, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '958031', 'n_tokens_mistral': 1593, 'n_tokens_neox': 1527, 'n_words': 308}