-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
122 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/10.0/phpunit.xsd" | ||
colors="true" | ||
bootstrap="tests/bootstrap.php" | ||
failOnRisky="true" | ||
failOnWarning="true" | ||
stderr="true"> | ||
<php> | ||
<ini name="error_reporting" value="32767" /> | ||
<ini name="intl.default_locale" value="en" /> | ||
<ini name="intl.error_level" value="0" /> | ||
<ini name="memory_limit" value="-1" /> | ||
<ini name="apc.enable_cli" value="1" /> | ||
|
||
<env name="MEMCACHED_HOST" value="localhost" /> | ||
</php> | ||
|
||
<testsuites> | ||
<testsuite name="Symfony Test Suite"> | ||
<directory>./tests/</directory> | ||
</testsuite> | ||
</testsuites> | ||
|
||
|
||
<coverage> | ||
<include> | ||
<directory>./lib/</directory> | ||
</include> | ||
</coverage> | ||
</phpunit> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the symfony package. | ||
* (c) Fabien Potencier <fabien@symfony.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
use Symfony\Bridge\PhpUnit\DeprecationErrorHandler; | ||
|
||
// setup expected test environment (per check_configuration.php) | ||
ini_set('magic_quotes_runtime', 'off'); | ||
ini_set('session.auto_start', 'off'); | ||
ini_set('arg_separator.output', '&'); | ||
ini_set('allow_url_fopen', 'on'); | ||
|
||
require_once __DIR__.'/../vendor/autoload.php'; | ||
|
||
$libDir = realpath(__DIR__.'/../lib'); | ||
|
||
require_once __DIR__.'/../lib/config/sfConfig.class.php'; | ||
sfConfig::set('sf_symfony_lib_dir', $libDir); | ||
|
||
require_once $libDir.'/autoload/sfCoreAutoload.class.php'; | ||
sfCoreAutoload::register(); | ||
|
||
require_once $libDir.'/util/sfToolkit.class.php'; | ||
sfConfig::set('sf_test_cache_dir', sys_get_temp_dir().'/sf_test_project'); | ||
|
||
// TODO enable later require_once __DIR__.'/fixtures/symfony/config/ProjectConfiguration.class.php'; | ||
|
||
// remove all test cache | ||
sf_unit_test_shutdown(); | ||
|
||
// create test cache dir | ||
$sf_root_dir = sys_get_temp_dir().'/sf_test_project'; | ||
@mkdir($sf_root_dir, 0777, true); | ||
|
||
register_shutdown_function('sf_unit_test_shutdown'); | ||
|
||
function sf_unit_test_shutdown() | ||
{ | ||
$sf_root_dir = sys_get_temp_dir().'/sf_test_project'; | ||
if (is_dir($sf_root_dir)) { | ||
sfToolkit::clearDirectory($sf_root_dir); | ||
@rmdir($sf_root_dir); | ||
} | ||
|
||
$sessions = glob(sys_get_temp_dir().'/sessions*'); | ||
$tmp_files = glob(sys_get_temp_dir().'/sf*'); | ||
|
||
$files = array_merge(empty($sessions) ? array() : $sessions, empty($tmp_files) ? array() : $tmp_files); | ||
foreach ($files as $file) { | ||
if (is_dir($file)) { | ||
sfToolkit::clearDirectory($file); | ||
@rmdir($file); | ||
} else { | ||
@unlink($file); | ||
} | ||
} | ||
} | ||
|
||
// Helper for cross platform testcases that validate output | ||
function fix_linebreaks($content) | ||
{ | ||
return str_replace(array("\r\n", "\n", "\r"), "\n", $content); | ||
} | ||
|
||
if ('disabled' !== getenv('SYMFONY_DEPRECATIONS_HELPER')) { | ||
DeprecationErrorHandler::register(getenv('SYMFONY_DEPRECATIONS_HELPER')); | ||
} |