<commit_before><?php

namespace EJM\Flow\Tests\Collector;

use EJM\Flow\Collector\Collector;
use EJM\Flow\Collector\Parser\DataCollectorNodeVisitor;
use EJM\Flow\Collector\Reader\SourceCodeReader;
use PhpParser\NodeTraverser;
use PhpParser\Parser;
use PHPUnit_Framework_MockObject_MockObject;
use PHPUnit_Framework_TestCase;

class CollectorTest extends PHPUnit_Framework_TestCase
{
    /**
     * @var PHPUnit_Framework_MockObject_MockObject
     */
    private $parser;

    /**
     * @var PHPUnit_Framework_MockObject_MockObject
     */
    private $traverser;

    /**
     * @var PHPUnit_Framework_MockObject_MockObject
     */
    private $reader;

    /**
     * @var Collector
     */
    private $collector;

    protected function setUp()
    {
        $this->parser = $this->getMock(Parser::class);
        $this->traverser = $this->getMock(NodeTraverser::class);
        $this->reader = $this->getMockWithoutInvokingTheOriginalConstructor(SourceCodeReader::class);

        $this->collector = new Collector($this->parser, $this->traverser, $this->reader);
    }

    public function testSetVisitor()
    {
        $firstVisitor = $this->getMock(DataCollectorNodeVisitor::class);
        $secondVisitor = $this->getMock(DataCollectorNodeVisitor::class);

        $this->traverser->expects($this->at(0))
            ->method('addVisitor')<commit_msg>Adapt test to previous version of phpunit<commit_after><?php

namespace EJM\Flow\Tests\Collector;

use EJM\Flow\Collector\Collector;
use EJM\Flow\Collector\Parser\DataCollectorNodeVisitor;
use EJM\Flow\Collector\Reader\SourceCodeReader;
use PhpParser\NodeTraverser;
use PhpParser\Parser;
use PHPUnit_Framework_MockObject_MockObject;
use PHPUnit_Framework_TestCase;

class CollectorTest extends PHPUnit_Framework_TestCase
{
    /**
     * @var PHPUnit_Framework_MockObject_MockObject
     */
    private $parser;

    /**
     * @var PHPUnit_Framework_MockObject_MockObject
     */
    private $traverser;

    /**
     * @var PHPUnit_Framework_MockObject_MockObject
     */
    private $reader;

    /**
     * @var Collector
     */
    private $collector;

    protected function setUp()
    {
        $this->parser = $this->getMock(Parser::class);
        $this->traverser = $this->getMock(NodeTraverser::class);
        $this->reader = $this->getMockBuilder(SourceCodeReader::class)
            ->disableOriginalConstructor()
            ->getMock();

        $this->collector = new Collector($this->parser, $this->traverser, $this->reader);
    }

    public function testSetVisitor()
    {
        $firstVisitor = $this->getMock(DataCollectorNodeVisitor::class);
        $secondVisitor = $this->getMock(DataCollectorNodeVisitor::class);

        $this->traverser->expects($this->at(0))
            ->method('addVisitor')
{'fraction_non_alphanumeric': 0.12127735916756369, 'fraction_numerical': 0.0007176175098672408, 'mean_word_length': 3.5186385737439223, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 37, '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': '502853', 'n_tokens_mistral': 862, 'n_tokens_neox': 840, 'n_words': 127}