* * 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:----p44bPsT9wnDyhlI0JDNE42HId/eDsm5o9oiSpZ90KVJiQrGo+ZlhazaTEjgahPiF7AA0hsanT3Iy5q07kjIa4+Nc55gBWcP6e9KycutPXGkTLPdi6nFtuarQAG7ly5BQvonDrIYB6b2zrOq3izSskFz/hVjT6xk4zw8/VbsyZrOB5iCwkAx8De+y8wnSgj17MUh9up9qqQ6WFoOVLZ7XCis+KAlkpqsA+Tb5My0WorU/xhj4NgdZ83djcwlhXT9dbcDavYxXWe59z4L9KqRSlRGrRZpVWU9C7c5e3q3yEc8hhVwzbAVVwcx4u8wF8o5j/XhzUAUWuvhVG4rRN6xtd8NOb+HKXKSB37+S0slaEzUgB2QszC9geEJX7VXiG90xtTCKD+he8czfsFw3O7ObMFNM5myEd3Mwz5s+Jdv+JWOqfnvbmHRTaHaCWOl5URCXkV3ueld9nDnwP/kzlDJ5J1AKDRepC+xvjio0t6xSJ1zGnxb2gC/RgdTvpNgWXTmcmht9GX8ZxEJ7OpIJffOM2Vt/cb66cUTWwk23SVaLp8Wnr21Z3/xGoFhJ7/xC/qLKBgwZ9IM+GaJKHUuAeg4JAQGw4x6B0JOeFdav2/twNqOZSWF2E4cNorhPkcc9KoJzGsUOyW1EV0lJztkR4UWZZHkDhjyUKfaBwVyaU3iJ4c0=----ATTACHMENT:----NTQyNzM3NzQzNzUxNjQ2MiA4NjU2NDAzNjE3MTQxNDM1IDc0OTMyOTE1NDgwNjAyMg==