<commit_before><?php

namespace Lovec\DbChangelog\Tests\DI;

use Lovec\DbChangelog\Tests\ContainerFactory;
use Nette\DI\Container;
use PHPUnit_Framework_TestCase;


class ChangelogExtensionTest extends PHPUnit_Framework_TestCase
{

	/**
	 * @var Container
	 */
	private $container;


	public function __construct()
	{
		$containerFactory = new ContainerFactory;
		$this->container = $containerFactory->create();
	}


	public function testInstances()
	{
		$this->assertInstanceOf(
			'Lovec\DbChangelog\ChangelogManager',
			$this->container->getByType('Lovec\DbChangelog\ChangelogManager')
		);

		$this->assertInstanceOf(
			'Lovec\DbChangelog\Events\OnRequest',
			$this->container->getByType('Lovec\DbChangelog\Events\OnRequest')
		);

		$this->assertInstanceOf(
			'Lovec\DbChangelog\Model\Changelog',
			$this->container->getByType('Lovec\DbChangelog\Model\Changelog')
		);
	}

}<commit_msg>tests: fix extension to provider coverage<commit_after><?php

namespace Lovec\DbChangelog\Tests\DI;

use Lovec\DbChangelog\DI\ChangelogExtension;
use Lovec\DbChangelog\Tests\ContainerFactory;
use Nette\DI\Compiler;
use Nette\DI\Container;
use Nette\DI\ContainerBuilder;
use PHPUnit_Framework_TestCase;


class ChangelogExtensionTest extends PHPUnit_Framework_TestCase
{

	/**
	 * @var ChangelogExtension
	 */
	private $extension;


	protected function setUp()
	{
		$compiler = new Compiler(new ContainerBuilder);
		$compiler->compile(['parameters' => [
			'appDir' => TEMP_DIR
		]], NULL, NULL);
		$this->extension = new ChangelogExtension;
		$this->extension->setCompiler($compiler, 'compiler');
	}


	public function testLoadConfiguration()
	{
		$this->extension->loadConfiguration();
		$builder = $this->extension->getContainerBuilder();
		$builder->prepareClassList();

		$changelogManagerName = $builder->getByType('Lovec\DbChangelog\ChangelogManager');
		$changelogManagerDefinition = $builder->getDefinition($changelogManagerName);

		$this->assertSame('Lovec\DbChangelog\ChangelogManager', $changelogManagerDefinition->getClass());
	}

}
{'fraction_non_alphanumeric': 0.13179813816756492, 'fraction_numerical': 0.0, 'mean_word_length': 5.717105263157895, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 29, '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': '4608315', 'n_tokens_mistral': 705, 'n_tokens_neox': 653, 'n_words': 95}