<commit_before><?php

namespace Grace\Test\ORM;

use Grace\ORM\ClassNameProvider;

class ClassNameProviderTest extends \PHPUnit_Framework_TestCase
{
    /** @var ClassNameProvider */
    protected $provider;

    public function testDefaultNames()
    {
        $provider = new ClassNameProvider();
        $this->assertEquals('Post', $provider->getBaseClass('\\Model\\Post'));
        $this->assertEquals('\\Model\\Post', $provider->getModelClass('Post'));
        $this->assertEquals('\\Finder\\PostFinder', $provider->getFinderClass('Post'));
        $this->assertEquals('\\Mapper\\PostMapper', $provider->getMapperClass('Post'));
        $this->assertEquals('\\Collection\\PostCollection', $provider->getCollectionClass('Post'));
    }
    public function testCommonNamespace()
    {
        $provider = new ClassNameProvider('Some\\AppBundle');
        $this->assertEquals('Post', $provider->getBaseClass('\\Some\\AppBundle\\Model\\Post'));
        $this->assertEquals('\\Some\\AppBundle\\Model\\Post', $provider->getModelClass('Post'));
        $this->assertEquals('\\Some\\AppBundle\\Finder\\PostFinder', $provider->getFinderClass('Post'));
        $this->assertEquals('\\Some\\AppBundle\\Mapper\\PostMapper', $provider->getMapperClass('Post'));
        $this->assertEquals('\\Some\\AppBundle\\Collection\\PostCollection', $provider->getCollectionClass('Post'));
    }
}<commit_msg>Test extra-finder class name provider<commit_after><?php

namespace Grace\Test\ORM;

use Grace\ORM\ClassNameProvider;

class ClassNameProviderTest extends \PHPUnit_Framework_TestCase
{
    /** @var ClassNameProvider */
    protected $provider;

    public function testDefaultNames()
    {
        $provider = new ClassNameProvider();
        $this->assertEquals('Post', $provider->getBaseClass('\\Model\\Post'));
        $this->assertEquals('\\Model\\Post', $provider->getModelClass('Post'));
        $this->assertEquals('\\Finder\\PostFinder', $provider->getFinderClass('Post'));
        $this->assertEquals('\\Mapper\\PostMapper', $provider->getMapperClass('Post'));
        $this->assertEquals('\\Collection\\PostCollection', $provider->getCollectionClass('Post'));
    }
    public function testCommonNamespace()
    {
        $provider = new ClassNameProvider('Some\\AppBundle');
        $this->assertEquals('Post', $provider->getBaseClass('\\Some\\AppBundle\\Model\\Post'));
        $this->assertEquals('\\Some\\AppBundle\\Model\\Post', $provider->getModelClass('Post'));
        $this->assertEquals('\\Some\\AppBundle\\Finder\\PostFinder', $provider->getFinderClass('Post'));
        $this->assertEquals('\\Some\\AppBundle\\Mapper\\PostMapper', $provider->getMapperClass('Post'));
        $this->assertEquals('\\Some\\AppBundle\\Collection\\PostCollection', $provider->getCollectionClass('Post'));

        $this->assertEquals('\\Some\\AppBundle\\Finder\\Post\\ExtraPostFinder', $provider->getFinderClass('Post\\ExtraPost'));
    }
}
{'fraction_non_alphanumeric': 0.1901023890784983, 'fraction_numerical': 0.0, 'mean_word_length': 4.044750430292599, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 45, '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': '1553671', 'n_tokens_mistral': 755, 'n_tokens_neox': 767, 'n_words': 96}