<commit_before><?php

namespace Benoth\StaticReflection\tests;

use Benoth\StaticReflection\Parser\ParsingContext;
use Benoth\StaticReflection\Parser\ReflectorNodeVisitor;
use Benoth\StaticReflection\ReflectionsIndex;
use PhpParser\NodeTraverser;
use PhpParser\NodeVisitor\NameResolver;
use PhpParser\ParserFactory;

abstract class AbstractTestCase extends \PHPUnit_Framework_TestCase
{
    public $index;
    public $context;
    public $fixturesPath;

    public function setUp()
    {
        $this->fixturesPath = __DIR__.'/fixtures';

        $phpParserFactory = new ParserFactory();
        $phpParser        = $phpParserFactory->create(ParserFactory::PREFER_PHP7);

        $traverser = new NodeTraverser();

        $this->index   = new ReflectionsIndex();
        $this->context = new ParsingContext($phpParser, $traverser, $this->index);

        $traverser->addVisitor(new NameResolver());
        $traverser->addVisitor(new ReflectorNodeVisitor($this->context));
    }
}<commit_msg>Fix fixtures path<commit_after><?php

namespace Benoth\StaticReflection\tests;

use Benoth\StaticReflection\Parser\ParsingContext;
use Benoth\StaticReflection\Parser\ReflectorNodeVisitor;
use Benoth\StaticReflection\ReflectionsIndex;
use PhpParser\NodeTraverser;
use PhpParser\NodeVisitor\NameResolver;
use PhpParser\ParserFactory;

abstract class AbstractTestCase extends \PHPUnit_Framework_TestCase
{
    public $index;
    public $context;
    public $fixturesPath;

    public function setUp()
    {
        $this->fixturesPath = __DIR__.'/Fixtures';

        $phpParserFactory = new ParserFactory();
        $phpParser        = $phpParserFactory->create(ParserFactory::PREFER_PHP7);

        $traverser = new NodeTraverser();

        $this->index   = new ReflectionsIndex();
        $this->context = new ParsingContext($phpParser, $traverser, $this->index);

        $traverser->addVisitor(new NameResolver());
        $traverser->addVisitor(new ReflectorNodeVisitor($this->context));
    }
}
{'fraction_non_alphanumeric': 0.10843373493975904, 'fraction_numerical': 0.001004016064257028, 'mean_word_length': 4.203655352480418, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 19, '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': '5419238', 'n_tokens_mistral': 578, 'n_tokens_neox': 571, 'n_words': 104}