<commit_before><?php

namespace rsspipestests\sections;

use rsspipes\rss\Feed;
use rsspipes\rss\Item;
use rsspipes\sections\Pipe;

class PipeTest extends \PHPUnit_Framework_TestCase
{
    public function testWorks()
    {
        $feed = new Feed();
        $feed->items = [
            new Item(['title' => 'foo']),
            new Item(['title' => 'bar']),
        ];
        
        $feed2 = new Feed();
        $feed2->items = [
            new Item(['title' => 'spam']),
            new Item(['title' => 'ham']),
        ];
        
        $section = new Pipe();
        
        $stub = $this->getMockBuilder('rsspipes\Pipe')->getMock();
        $stub->method('run')->willReturn($feed2);
        $section->pipe = $stub;
        
        $section->processFeed($feed);
        
        $this->assertCount(4, $feed->items);
        $this->assertSame('foo', $feed->items[0]->title);
        $this->assertSame('bar', $feed->items[1]->title);
        $this->assertSame('spam', $feed->items[2]->title);
        $this->assertSame('ham', $feed->items[3]->title);
    }<commit_msg>pipe section<commit_after><?php

namespace rsspipestests\sections;

use rsspipes\rss\Feed;
use rsspipes\rss\Item;
use rsspipes\sections\Pipe;

class PipeTest extends \PHPUnit_Framework_TestCase
{
    public function testWorks()
    {
        $feed = new Feed();
        $feed->items = [
            new Item(['title' => 'foo']),
            new Item(['title' => 'bar']),
        ];
        
        $feed2 = new Feed();
        $feed2->items = [
            new Item(['title' => 'spam']),
            new Item(['title' => 'ham']),
        ];
        
        $section = new Pipe();
        
        $stub = $this->getMockBuilder('rsspipes\Pipe')->disableOriginalConstructor()->getMock();
        $stub->method('run')->willReturn($feed2);
        $section->pipe = $stub;
        
        $section->processFeed($feed);
        
        $this->assertCount(4, $feed->items);
        $this->assertSame('foo', $feed->items[0]->title);
        $this->assertSame('bar', $feed->items[1]->title);
        $this->assertSame('spam', $feed->items[2]->title);
        $this->assertSame('ham', $feed->items[3]->title);
    }
{'fraction_non_alphanumeric': 0.1936957514846962, 'fraction_numerical': 0.007309273640931932, 'mean_word_length': 2.2158590308370045, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 56, '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': '4794849', 'n_tokens_mistral': 696, 'n_tokens_neox': 694, 'n_words': 111}