<commit_before><?php
/**
 * Author: <NAME> <<EMAIL>>
 * Date: 7/04/16
 * Time: 22:33.
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace NilPortugues\Tests\MessageBus\EventBusQueue\Adapters;

use NilPortugues\MessageBus\EventBusQueue\Adapters\AmqpQueue;
use NilPortugues\MessageBus\Serializer\NativeSerializer;
use NilPortugues\Tests\MessageBus\EventBusQueue\DummyEvent;
use PhpAmqpLib\Connection\AMQPStreamConnection;

class AmqpQueueTest extends \PHPUnit_Framework_TestCase
{
    /** @var AMQPStreamConnection */
    protected $producerConnection;

    /** @var AMQPStreamConnection */
    protected $consumerConnection;

    /** @var NativeSerializer */
    protected $serializer;

    /** @var AmqpQueue */
    protected $consumer;

    /** @var AmqpQueue */
    protected $producer;

    public function setUp()
    {
        $this->consumerConnection = new AMQPStreamConnection('127.0.0.1', 5672, 'guest', 'guest');
        $this->producerConnection = new AMQPStreamConnection('127.0.0.1', 5672, 'guest', 'guest');
        $this->serializer = new NativeSerializer();

        $this->producer = new AmqpQueue($this->serializer, $this->producerConnection, 'testAdapterQueue');
        $this->consumer = new AmqpQueue($this->serializer, $this->consumerConnection, 'testAdapterQueue');
    }

    public function testAdapterQueue()
    {
        $event = new DummyEvent();
        $this->producer->push($event);

        $this->assertTrue($this->producer->hasElements());
        $this->assertEquals($event, $this->consumer->pop());
    }

    public function testName()
    {
        $this->assertEquals('testAdapterQueue', $this->consumer->name());
    }
}<commit_msg>Fixed failing test?<commit_after><?php
/**
 * Author: <NAME> <<EMAIL>>
 * Date: 7/04/16
 * Time: 22:33.
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace NilPortugues\Tests\MessageBus\EventBusQueue\Adapters;

use NilPortugues\MessageBus\EventBusQueue\Adapters\AmqpQueue;
use NilPortugues\MessageBus\Serializer\NativeSerializer;
use NilPortugues\Tests\MessageBus\EventBusQueue\DummyEvent;
use PhpAmqpLib\Connection\AMQPStreamConnection;

class AmqpQueueTest extends \PHPUnit_Framework_TestCase
{
    /** @var AMQPStreamConnection */
    protected $producerConnection;

    /** @var AMQPStreamConnection */
    protected $consumerConnection;

    /** @var NativeSerializer */
    protected $serializer;

    /** @var AmqpQueue */
    protected $consumer;

    /** @var AmqpQueue */
    protected $producer;

    public function setUp()
    {
        $this->consumerConnection = new AMQPStreamConnection('127.0.0.1', 5672, 'guest', 'guest');
        $this->producerConnection = new AMQPStreamConnection('127.0.0.1', 5672, 'guest', 'guest');
        $this->serializer = new NativeSerializer();

        $this->producer = new AmqpQueue($this->serializer, $this->producerConnection, 'testAdapterQueue');
        $this->consumer = new AmqpQueue($this->serializer, $this->consumerConnection, 'testAdapterQueue');
    }

    public function testAdapterQueue()
    {
        $event = new DummyEvent();
        $this->producer->push($event);

        $this->assertEquals($event, $this->consumer->pop());
    }

    public function testName()
    {
        $this->assertEquals('testAdapterQueue', $this->consumer->name());
    }
}
{'fraction_non_alphanumeric': 0.13739580339177926, 'fraction_numerical': 0.016671457315320496, 'mean_word_length': 3.7606019151846786, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 46, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, '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': '1058215', 'n_tokens_mistral': 1091, 'n_tokens_neox': 998, 'n_words': 209}