Skip to content

Commit

Permalink
Add additional test
Browse files Browse the repository at this point in the history
  • Loading branch information
HypeMC committed Dec 15, 2022
1 parent b7f5b19 commit 1d4ddf1
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
10 changes: 10 additions & 0 deletions phpunit-deprecation-baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,16 @@
"message": "Exception::__construct(): Passing null to parameter #2 ($code) of type int is deprecated",
"count": 1
},
{
"location": "Bizkit\\VersioningBundle\\Tests\\DependencyInjection\\BizkitVersioningExtensionTest::testServiceCanBeInstantiated",
"message": "Function libxml_disable_entity_loader() is deprecated",
"count": 8
},
{
"location": "Bizkit\\VersioningBundle\\Tests\\DependencyInjection\\BizkitVersioningExtensionTest::testServiceCanBeInstantiated",
"message": "Exception::__construct(): Passing null to parameter #2 ($code) of type int is deprecated",
"count": 2
},
{
"location": "Bizkit\\VersioningBundle\\Tests\\Reader\\XmlFileReaderTest::testValidData",
"message": "Function libxml_disable_entity_loader() is deprecated",
Expand Down
23 changes: 23 additions & 0 deletions tests/DependencyInjection/BizkitVersioningExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -438,4 +438,27 @@ public function testExceptionIsThrownOnInvalidVCSHandler(): void

$extension->process($container);
}

/**
* @dataProvider serviceIds
*/
public function testServiceCanBeInstantiated(string $serviceId): void
{
$container = new ContainerBuilder();
$container->setParameter('kernel.project_dir', sys_get_temp_dir());
$container->registerExtension($versioningExtension = new BizkitversioningExtension());

$versioningExtension->load([], $container);

$container->getDefinition($serviceId)->setPublic(true);
$container->compile();

$this->assertInstanceOf($serviceId, $container->get($serviceId));
}

public function serviceIds(): iterable
{
yield [GitHandler::class];
yield [IncrementCommand::class];
}
}

0 comments on commit 1d4ddf1

Please sign in to comment.