<commit_before><?php

namespace Lopi\Bundle\PusherBundle\Tests\DependencyInjection;

use Symfony\Component\DependencyInjection\ContainerBuilder;

use Lopi\Bundle\PusherBundle\DependencyInjection\LopiPusherExtension;
use Lopi\Bundle\PusherBundle\Pusher\Pusher;

class PusherTest extends \PHPUnit_Framework_TestCase
{
    public function testLoad()
    {
		$container = new ContainerBuilder();
        $configs = array('lopi_pusher' => array(
			'app_id' => 'app_id',
			'key' => 'key',
			'secret' => 'secret',
            'auth_service_id' => 'acme_service_id'
			));
		$extension = new LopiPusherExtension();
		$extension->load($configs, $container);
		$expectedPusher = new Pusher('app_id', 'key', 'secret', $container);
		$this->assertEquals($expectedPusher, $container->get('lopi_pusher.pusher'));
		$this->assertEquals('http://api.pusherapp.com', $container->getParameter('lopi_pusher.host'));
		$this->assertEquals('app_id', $container->getParameter('lopi_pusher.app.id'));
		$this->assertEquals('key', $container->getParameter('lopi_pusher.key'));
		$this->assertEquals('secret', $container->getParameter('lopi_pusher.secret'));
		$this->assertTrue(is_string($container->getParameter('lopi_pusher.auth.version')));
		$this->assertTrue("1.0" === $container->getParameter('lopi_pusher.auth.version'));
		$this->assertFalse($container->getParameter('lopi_pusher.encrypted'));
        $this->assertEquals('acme_service_id', $container->getAlias('lopi_pusher.authenticator'));
    }
	
	public function testLoadWithConfig()
    {
		$container = new ContainerBuilder();
        $configs = array('lopi_pusher' => array(
			'app_id' => 'app_id',
			'key' => 'key',
			'secret' => 'secret',
			'encrypted' => true,
            'auth_service_id' => 'acme_service_id'
			));
		$extension = new LopiPusherExtension();
		$extension->load($configs, $container);
		$expectedPusher = new Pusher('app_id', 'key', 'secret', $container);
		$this->assertEquals($expectedPusher, $container->get('lopi_pusher.pusher'));
		$this->assertEquals('app_id', $container->getParameter('lopi_pusher.app.id'));
		$this->assertEquals('key', $container->getParameter('lopi_pusher.key'));
		$this->assertEquals('secret', $container->getParameter('lopi_pusher.secret'));
		$this->assertEquals('http://api.pusherapp.com', $container->getParameter('lopi_pusher.host'));
		$this->assertTrue(is_string($container->getParameter('lopi_pusher.auth.version')));
		$this->assertTrue("1.0" === $container->getParameter('lopi_pusher.auth.version'));
		$this->assertTrue($container->getParameter('lopi_pusher.encrypted'));
        $this->assertEquals('acme_service_id', $container->getAlias('lopi_pusher.authenticator'));
    }
}<commit_msg>Fixed error test on Debian6 of my vmware<commit_after><?php

namespace Lopi\Bundle\PusherBundle\Tests\DependencyInjection;

use Symfony\Component\DependencyInjection\ContainerBuilder;

use Lopi\Bundle\PusherBundle\DependencyInjection\LopiPusherExtension;
use Lopi\Bundle\PusherBundle\Pusher\Pusher;

class PusherTest extends \PHPUnit_Framework_TestCase
{
    public function testLoad()
    {
		$container = new ContainerBuilder();
        $configs = array('lopi_pusher' => array(
			'app_id' => 'app_id',
			'key' => 'key',
			'secret' => 'secret',
            'auth_service_id' => 'acme_service_id'
			));
		$extension = new LopiPusherExtension();
		$extension->load($configs, $container);
		$expectedPusher = new Pusher('app_id', 'key', 'secret', $container);
		$this->assertEquals($expectedPusher, $container->get('lopi_pusher.pusher'));
		$this->assertEquals('http://api.pusherapp.com', $container->getParameter('lopi_pusher.host'));
		$this->assertEquals('app_id', $container->getParameter('lopi_pusher.app.id'));
		$this->assertEquals('key', $container->getParameter('lopi_pusher.key'));
		$this->assertEquals('secret', $container->getParameter('lopi_pusher.secret'));
		$this->assertTrue(is_string($container->getParameter('lopi_pusher.auth.version')));
		$this->assertTrue("1.0" === $container->getParameter('lopi_pusher.auth.version'));
		$this->assertFalse($container->getParameter('lopi_pusher.encrypted'));
        $this->assertEquals('acme_service_id', (string) $container->getAlias('lopi_pusher.authenticator'));
    }
	
	public function testLoadWithConfig()
    {
		$container = new ContainerBuilder();
        $configs = array('lopi_pusher' => array(
			'app_id' => 'app_id',
			'key' => 'key',
			'secret' => 'secret',
			'encrypted' => true,
            'auth_service_id' => 'acme_service_id'
			));
		$extension = new LopiPusherExtension();
		$extension->load($configs, $container);
		$expectedPusher = new Pusher('app_id', 'key', 'secret', $container);
		$this->assertEquals($expectedPusher, $container->get('lopi_pusher.pusher'));
		$this->assertEquals('app_id', $container->getParameter('lopi_pusher.app.id'));
		$this->assertEquals('key', $container->getParameter('lopi_pusher.key'));
		$this->assertEquals('secret', $container->getParameter('lopi_pusher.secret'));
		$this->assertEquals('http://api.pusherapp.com', $container->getParameter('lopi_pusher.host'));
		$this->assertTrue(is_string($container->getParameter('lopi_pusher.auth.version')));
		$this->assertTrue("1.0" === $container->getParameter('lopi_pusher.auth.version'));
		$this->assertTrue($container->getParameter('lopi_pusher.encrypted'));
        $this->assertEquals('acme_service_id', (string) $container->getAlias('lopi_pusher.authenticator'));
    }
}
{'fraction_non_alphanumeric': 0.18519198971155612, 'fraction_numerical': 0.001653499908138894, 'mean_word_length': 6.12565445026178, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 101, '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': '3014049', 'n_tokens_mistral': 1879, 'n_tokens_neox': 1842, 'n_words': 215}