Skip to content

Instantly share code, notes, and snippets.

@kix
Created January 26, 2016 14:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kix/855b09a63af23ed85813 to your computer and use it in GitHub Desktop.
Save kix/855b09a63af23ed85813 to your computer and use it in GitHub Desktop.
services:
my.something:
class: My\Something
# arguments:
# - @...
my.another_thing:
class: My\AnotherThing
<?php
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
class ServiceTest extends KernelTestCase
{
public function provideExpectedDefinitions()
{
return [
['My\Something', 'my.something'],
['My\AnotherThing', 'my.another_thing'],
];
}
/**
* @test
* @group functional
* @dataProvider provideExpectedDefinitions
*/
protected function it_registers_declared_services_correctly($class, $serviceId)
{
$kernel = static::createKernel();
static::assertInstanceOf($class, $kernel->getContainer()->get($serviceId));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment