<commit_before><?php
/**
 * This file is part of stubbles.
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 *
 * @package  stubbles
 */
namespace stubbles\ioc;
use stubbles\test\ioc\AppClassWithBindings;
use stubbles\test\ioc\AppClassWithoutBindings;
use stubbles\test\ioc\AppUsingBindingModule;
/**
 * Test for stubbles\ioc\App.
 *
 * @group  ioc
 */
class AppTest extends \PHPUnit_Framework_TestCase
{
    /**
     * @since  2.0.0
     * @test
     */
    public function createCreatesInstanceUsingBindings()
    {
        $appCommandWithBindings = AppClassWithBindings::create('projectPath');
        $this->assertInstanceOf(
                'stubbles\test\ioc\AppClassWithBindings',
                $appCommandWithBindings
        );
    }

    /**
     * @test
     */
    public function createInstanceCreatesInstanceUsingBindings()
    {
        $appCommandWithBindings = App::createInstance('stubbles\test\ioc\AppClassWithBindings',
                                                      'projectPath'
                                  );
        $this->assertInstanceOf(
                'stubbles\test\ioc\AppClassWithBindings',
                $appCommandWithBindings
        );
    }

    /**
     * @test
     */
    public function createInstanceCreatesInstanceWithoutBindings()
    {
        $this->assertInstanceOf(
                'stubbles\test\ioc\AppClassWithoutBindings',
                App::createInstance('stubbles\test\ioc\AppClassWithoutBindings',
                                    'projectPath'
                )
        );
    }

    /**
     * @test
     */
    public function projectPathIsBoundWithoutExplicitBindings()
    {
        $this->assertEquals(
                'projectPath',
                AppClassWithoutBindings::create('projectPath')->projectPath
        );
    }

    /**
     * @since  2.0.0
     * @test
     */
    public function canCreateModeBindingModule()
    {
        $this->assertInstanceOf(
                'stubbles\ioc\module\ModeBindingModule',
                AppUsingBindingModule::getModeBindingModule(__DIR__)
        );<commit_msg>add project path test for case when bindings exist<commit_after><?php
/**
 * This file is part of stubbles.
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 *
 * @package  stubbles
 */
namespace stubbles\ioc;
use stubbles\test\ioc\AppClassWithBindings;
use stubbles\test\ioc\AppClassWithoutBindings;
use stubbles\test\ioc\AppUsingBindingModule;
/**
 * Test for stubbles\ioc\App.
 *
 * @group  ioc
 */
class AppTest extends \PHPUnit_Framework_TestCase
{
    /**
     * @since  2.0.0
     * @test
     */
    public function createCreatesInstanceUsingBindings()
    {
        $appCommandWithBindings = AppClassWithBindings::create('projectPath');
        $this->assertInstanceOf(
                'stubbles\test\ioc\AppClassWithBindings',
                $appCommandWithBindings
        );
    }

    /**
     * @test
     */
    public function createInstanceCreatesInstanceUsingBindings()
    {
        $appCommandWithBindings = App::createInstance('stubbles\test\ioc\AppClassWithBindings',
                                                      'projectPath'
                                  );
        $this->assertInstanceOf(
                'stubbles\test\ioc\AppClassWithBindings',
                $appCommandWithBindings
        );
    }

    /**
     * @test
     */
    public function createInstanceCreatesInstanceWithoutBindings()
    {
        $this->assertInstanceOf(
                'stubbles\test\ioc\AppClassWithoutBindings',
                App::createInstance('stubbles\test\ioc\AppClassWithoutBindings',
                                    'projectPath'
                )
        );
    }

    /**
     * @test
     * @since  5.0.0
     */
    public function projectPathIsBoundWithExplicitBindings()
    {
        $this->assertEquals(
                'projectPath',
                AppClassWithBindings::create('projectPath')->projectPath
        );
    }

    /**
     * @test
     * @since  5.0.0
     */
    public function projectPathIsBoundWithoutExplicitBindings()
    {
        $this->assertEquals(
                'projectPath',
                AppClassWithoutBindings::create('projectPath')->projectPath
        );
    }

    /**
     * @since  2.0.0
     * @test
     */
    public function canCreateModeBindingModule()
    {
        $this->assertInstanceOf(
                'stubbles\ioc\module\ModeBindingModule',
                AppUsingBindingModule::getModeBindingModule(__DIR__)
        );
{'fraction_non_alphanumeric': 0.10034158838599487, 'fraction_numerical': 0.003842869342442357, 'mean_word_length': 1.8973407544836116, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, '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': '1050216', 'n_tokens_mistral': 1273, 'n_tokens_neox': 1264, 'n_words': 199}