<commit_before><?php

class TestCaseTest extends \PHPUnit_Framework_TestCase
{

    /**
     * @var \Codeception\TestCase
     */
    protected $testcase;

    /**
     * @var \Symfony\Component\EventDispatcher\EventDispatcher
     */
    protected $dispatcher;

    /**
     * @var \Codeception\Lib\ModuleContainer
     */
    protected $moduleContainer;

    public function setUp() {
        $this->dispatcher = new Symfony\Component\EventDispatcher\EventDispatcher;
        $di = new \Codeception\Lib\Di();
        $this->moduleContainer = new \Codeception\Lib\ModuleContainer($di, []);
        \Codeception\Module\EmulateModuleHelper::$onlyActions = [];
        \Codeception\Module\EmulateModuleHelper::$excludeActions = [];
        $module = $this->moduleContainer->create('EmulateModuleHelper');
        $module->_initialize();


        $this->testcase = new \Codeception\TestCase\Cept;
        $this->testcase->configDispatcher($this->dispatcher)
            ->configName('mocked test')
            ->configFile(codecept_data_dir().'SimpleCept.php')
            ->configDi($di)
            ->configModules($this->moduleContainer)
            ->initConfig();
    }

    /**
     * @group core
     */
    public function testRunStepEvents()
    {
        $events = array();
        codecept_debug($this->moduleContainer->getActions());
        $this->dispatcher->addListener('step.before', function () use (&$events) { $events[] = 'step.before'; });
        $this->dispatcher->addListener('step.after', function () use (&$events) { $events[] = 'step.after'; });
        $step = new \Codeception\Step\Action('seeEquals', array(5,5));
        $this->testcase->runStep($step);
        $this->assertEquals($events, array('step.before', 'step.after'));
    }

    /**
     * @group core
     */
    public function testRunStep() {
        $assertions = &$this->moduleContainer->getModule('EmulateModuleHelper')->assertions;
        $step = new \Codeception\Step\Action('seeEquals', array(5,5));
        $this->testcase->runStep($step);
        $this->assertEquals(1, $assertions);
        $step = new \Codeception\Step\Action('seeEquals', array(5,6));
        try {
            $this->testcase->runStep($step);
        } catch (Exception $e) {
            $this->assertInstanceOf('PHPUnit_Framework_ExpectationFailedException', $e);
        }
        $this->assertEquals(1, $assertions);
    }

    /**
     * @group core
     */
    public function testRunStepAddsTrace() {
        $step = new \Codeception\Step\Action('seeEquals', array(5,5));
        $this->testcase->runStep($step);
        $this->assertContains($step, $this->testcase->getTrace());
    }


}<commit_msg>removed TestCase->getTrace and corresponding test<commit_after><?php

class TestCaseTest extends \PHPUnit_Framework_TestCase
{

    /**
     * @var \Codeception\TestCase
     */
    protected $testcase;

    /**
     * @var \Symfony\Component\EventDispatcher\EventDispatcher
     */
    protected $dispatcher;

    /**
     * @var \Codeception\Lib\ModuleContainer
     */
    protected $moduleContainer;

    public function setUp() {
        $this->dispatcher = new Symfony\Component\EventDispatcher\EventDispatcher;
        $di = new \Codeception\Lib\Di();
        $this->moduleContainer = new \Codeception\Lib\ModuleContainer($di, []);
        \Codeception\Module\EmulateModuleHelper::$onlyActions = [];
        \Codeception\Module\EmulateModuleHelper::$excludeActions = [];
        $module = $this->moduleContainer->create('EmulateModuleHelper');
        $module->_initialize();


        $this->testcase = new \Codeception\TestCase\Cept;
        $this->testcase->configDispatcher($this->dispatcher)
            ->configName('mocked test')
            ->configFile(codecept_data_dir().'SimpleCept.php')
            ->configDi($di)
            ->configModules($this->moduleContainer)
            ->initConfig();
    }

    /**
     * @group core
     */
    public function testRunStepEvents()
    {
        $events = array();
        codecept_debug($this->moduleContainer->getActions());
        $this->dispatcher->addListener('step.before', function () use (&$events) { $events[] = 'step.before'; });
        $this->dispatcher->addListener('step.after', function () use (&$events) { $events[] = 'step.after'; });
        $step = new \Codeception\Step\Action('seeEquals', array(5,5));
        $this->testcase->runStep($step);
        $this->assertEquals($events, array('step.before', 'step.after'));
    }

    /**
     * @group core
     */
    public function testRunStep() {
        $assertions = &$this->moduleContainer->getModule('EmulateModuleHelper')->assertions;
        $step = new \Codeception\Step\Action('seeEquals', array(5,5));
        $this->testcase->runStep($step);
        $this->assertEquals(1, $assertions);
        $step = new \Codeception\Step\Action('seeEquals', array(5,6));
        try {
            $this->testcase->runStep($step);
        } catch (Exception $e) {
            $this->assertInstanceOf('PHPUnit_Framework_ExpectationFailedException', $e);
        }
        $this->assertEquals(1, $assertions);
    }

}
{'fraction_non_alphanumeric': 0.16370731707317074, 'fraction_numerical': 0.0035121951219512196, 'mean_word_length': 2.7580645161290325, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 77, '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': '5923244', 'n_tokens_mistral': 1479, 'n_tokens_neox': 1450, 'n_words': 214}