X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fsymfony%2Fhttp-kernel%2FTests%2FDependencyInjection%2FServicesResetterTest.php;fp=vendor%2Fsymfony%2Fhttp-kernel%2FTests%2FDependencyInjection%2FServicesResetterTest.php;h=47c62abd0d99894522f1391cc768f283232c608b;hp=0000000000000000000000000000000000000000;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0 diff --git a/vendor/symfony/http-kernel/Tests/DependencyInjection/ServicesResetterTest.php b/vendor/symfony/http-kernel/Tests/DependencyInjection/ServicesResetterTest.php new file mode 100644 index 000000000..47c62abd0 --- /dev/null +++ b/vendor/symfony/http-kernel/Tests/DependencyInjection/ServicesResetterTest.php @@ -0,0 +1,42 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\Tests\DependencyInjection; + +use PHPUnit\Framework\TestCase; +use Symfony\Component\HttpKernel\DependencyInjection\ServicesResetter; +use Symfony\Component\HttpKernel\Tests\Fixtures\ClearableService; +use Symfony\Component\HttpKernel\Tests\Fixtures\ResettableService; + +class ServicesResetterTest extends TestCase +{ + protected function setUp() + { + ResettableService::$counter = 0; + ClearableService::$counter = 0; + } + + public function testResetServices() + { + $resetter = new ServicesResetter(new \ArrayIterator(array( + 'id1' => new ResettableService(), + 'id2' => new ClearableService(), + )), array( + 'id1' => 'reset', + 'id2' => 'clear', + )); + + $resetter->reset(); + + $this->assertEquals(1, ResettableService::$counter); + $this->assertEquals(1, ClearableService::$counter); + } +}