4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\HttpKernel\Tests\DependencyInjection;
14 use PHPUnit\Framework\TestCase;
15 use Symfony\Component\HttpKernel\DependencyInjection\ServicesResetter;
16 use Symfony\Component\HttpKernel\Tests\Fixtures\ClearableService;
17 use Symfony\Component\HttpKernel\Tests\Fixtures\ResettableService;
19 class ServicesResetterTest extends TestCase
21 protected function setUp()
23 ResettableService::$counter = 0;
24 ClearableService::$counter = 0;
27 public function testResetServices()
29 $resetter = new ServicesResetter(new \ArrayIterator(array(
30 'id1' => new ResettableService(),
31 'id2' => new ClearableService(),
39 $this->assertEquals(1, ResettableService::$counter);
40 $this->assertEquals(1, ClearableService::$counter);