* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\HttpKernel\Tests\DataCollector; use PHPUnit\Framework\TestCase; use Symfony\Component\HttpKernel\DataCollector\ConfigDataCollector; use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Config\Loader\LoaderInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; class ConfigDataCollectorTest extends TestCase { public function testCollect() { $kernel = new KernelForTest('test', true); $c = new ConfigDataCollector(); $c->setKernel($kernel); $c->collect(new Request(), new Response()); $this->assertSame('test', $c->getEnv()); $this->assertTrue($c->isDebug()); $this->assertSame('config', $c->getName()); $this->assertSame('testkernel', $c->getAppName()); $this->assertRegExp('~^'.preg_quote($c->getPhpVersion(), '~').'~', PHP_VERSION); $this->assertRegExp('~'.preg_quote((string) $c->getPhpVersionExtra(), '~').'$~', PHP_VERSION); $this->assertSame(PHP_INT_SIZE * 8, $c->getPhpArchitecture()); $this->assertSame(class_exists('Locale', false) && \Locale::getDefault() ? \Locale::getDefault() : 'n/a', $c->getPhpIntlLocale()); $this->assertSame(date_default_timezone_get(), $c->getPhpTimezone()); $this->assertSame(Kernel::VERSION, $c->getSymfonyVersion()); $this->assertNull($c->getToken()); $this->assertSame(extension_loaded('xdebug'), $c->hasXDebug()); $this->assertSame(extension_loaded('Zend OPcache') && ini_get('opcache.enable'), $c->hasZendOpcache()); $this->assertSame(extension_loaded('apcu') && ini_get('apc.enabled'), $c->hasApcu()); } } class KernelForTest extends Kernel { public function getName() { return 'testkernel'; } public function registerBundles() { } public function getBundles() { return array(); } public function registerContainerConfiguration(LoaderInterface $loader) { } } __halt_compiler();----SIGNATURE:----FGLpS4uw9JLgjuDlNXtceFP4z/0aNnhEfdflrRw8aN5B4P6MsZlBF2Y1kNgiCGgs2yOLHRaRCmTx049gvszvStuihCHQlAN/iUglhGkj2HCgJne+mzcKxLoYhECpTPYgLc+HzCQhqqV/Na/LzYmlhMEld8Ia93LKUR6qzuZbONMU3IoDBi4h08IqCZFXMrRjxZlQI1D4zaS5efVFU7Ell735TAw0xZQ25HKfPkw6YhDIHPsxhUJBfwhXgqanOY4Xbpz+drfgfrB50HKwspdO25BvXn7JpJXiaToP8wv6kVOldr4TQ+GsY02f9GLSdDyZ9Cp+GQsaQALN7joeyZyQf5X3GvWWDppWtpK2NGTgToMNUO7m8SSLLWP61c3kdculGzh46HiqZrn34gftTLFWqt4lBPXkhblUq7sX3f6Yonl+v+N8TynH0c7V1BOfLk8P9oxoIqcXrTEaPYsTFyM7Ql8xLt15olZ7atiED3hJdADiDIn7FUsM4N1MxDy7D56a3WFF7P3vJvk/8HQCFQmKCYEfxTUj6/cH32hgLHXFIoKPQa174v+fyMmNpZR3e06t4HBzzPj2KzoI90nYm8YTwi9y9jzpyBSYAo+hscsZ5BeeBN0sKKE4QzKcLgYo6Rx7lzxX3psXj0o448VDWBqScQtg72eSCq2zZT9UcOeGm4E=----ATTACHMENT:----MTQ0ODY1MDQwODI4NjI4IDM3MjAzNjcwODgwMDQ2MiAyOTcyMDIzODk5ODQ2ODM5