Skip to content

Commit

Permalink
added test extension
Browse files Browse the repository at this point in the history
  • Loading branch information
Velhron committed Jul 9, 2020
1 parent add8361 commit 3dfacd7
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions tests/DependencyInjection/VelhronDadataExtensionTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

declare(strict_types=1);

namespace Velhron\DadataBundle\Tests\DependencyInjection;

use PHPUnit\Framework\TestCase;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\Yaml\Yaml;
use Velhron\DadataBundle\DependencyInjection\VelhronDadataExtension;

class VelhronDadataExtensionTest extends TestCase
{
public function testRegister(): void
{
$config = Yaml::parse(file_get_contents(__DIR__.'/config.yaml'));

$containerBuilder = new ContainerBuilder();
$containerBuilder->setParameter('kernel.debug', true);

$extension = new VelhronDadataExtension();
$extension->load($config, $containerBuilder);

$this->assertSame('token', $containerBuilder->getParameter('velhron_dadata.token'));
$this->assertSame('secret', $containerBuilder->getParameter('velhron_dadata.secret'));
}
}

0 comments on commit 3dfacd7

Please sign in to comment.