mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-04 10:24:26 +02:00
Update for PHPunit >= 5
This commit is contained in:
@@ -16,6 +16,7 @@ if (!class_exists('Smarty_Autoloader')) {
|
||||
throw new Exception('can not locate Smarty distribution');
|
||||
}
|
||||
}
|
||||
|
||||
if (!defined('SMARTY_COMPOSER_INSTALL')) {
|
||||
foreach (array(dirname(__FILE__) . '/../../autoload.php', dirname(__FILE__) . '/../vendor/autoload.php',
|
||||
dirname(__FILE__) . '/vendor/autoload.php') as $file) {
|
||||
@@ -29,12 +30,16 @@ if (!defined('SMARTY_COMPOSER_INSTALL')) {
|
||||
if (!class_exists('PHPUnit_Framework_TestCase') && !class_exists('\PHPUnit\Framework\TestCase')){
|
||||
require_once SMARTY_COMPOSER_INSTALL;
|
||||
}
|
||||
|
||||
if (!class_exists('\PHPUnit_Framework_TestCase') && class_exists('\PHPUnit\Framework\TestCase')) {
|
||||
class_alias('\PHPUnit\Framework\TestCase', '\PHPUnit_Framework_TestCase');
|
||||
class_alias('\PHPUnit\Framework\Error\Notice', '\PHPUnit_Framework_Error_Notice');
|
||||
class_alias('\PHPUnit\Framework\Error\Error', '\PHPUnit_Framework_Error_Error');
|
||||
class_alias('\PHPUnit\Framework\Error\Warning', '\PHPUnit_Framework_Error_Warning');
|
||||
class_alias('\PHPUnit\Framework\Error\Warning', '\PHPUnit_Framework_Error_Deprecated');
|
||||
class_alias('\PHPUnit\Util\Configuration', '\PHPUnit_Util_Configuration');
|
||||
}
|
||||
if (!class_exists('\PHPUnit_Framework_Error') && class_exists('\PHPUnit\Framework\Error')) {
|
||||
class_alias('\PHPUnit\Framework\Error', '\PHPUnit_Framework_Error');
|
||||
}
|
||||
|
||||
require_once 'PHPUnit_Smarty.php';
|
||||
if (!ini_get('date.timezone')) {
|
||||
ini_set('date.timezone', 'Europe/Berlin');
|
||||
|
@@ -249,6 +249,7 @@ KEY `expire` (`expire`)
|
||||
if (is_dir(self::$cwd . '/templates_tmp')) {
|
||||
$this->cleanDir(self::$cwd . '/templates_tmp');
|
||||
}
|
||||
$this->assertTrue(true);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -61,7 +61,7 @@ class UndefinedTemplateVarTest extends PHPUnit_Smarty
|
||||
/**
|
||||
* Throw E_NOTICE message
|
||||
*
|
||||
* @expectedException PHPUnit_Framework_Error
|
||||
* @expectedException PHPUnit_Framework_Error_Notice
|
||||
* @expectedExceptionMessage Undefined index: foo
|
||||
*/
|
||||
public function testE_Notice()
|
||||
|
@@ -1,14 +1,22 @@
|
||||
<phpunit
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.5/phpunit.xsd"
|
||||
bootstrap="Bootstrap.php"
|
||||
colors="true"
|
||||
backupGlobals="false"
|
||||
backupStaticAttributes="true"
|
||||
forceCoversAnnotation="false"
|
||||
mapTestClassNameToCoveredClassName="false"
|
||||
processIsolation="false"
|
||||
convertErrorsToExceptions="true"
|
||||
convertNoticesToExceptions="true"
|
||||
convertWarningsToExceptions="true"
|
||||
beStrictAboutOutputDuringTests="true"
|
||||
stopOnFailure="false">
|
||||
stopOnError="false"
|
||||
stopOnFailure="false"
|
||||
stopOnIncomplete="false"
|
||||
stopOnSkipped="false"
|
||||
stopOnRisky="false"
|
||||
timeoutForSmallTests="1"
|
||||
timeoutForMediumTests="10"
|
||||
timeoutForLargeTests="60"
|
||||
verbose="false">
|
||||
|
||||
<filter>
|
||||
<testsuites>
|
||||
@@ -29,7 +37,8 @@
|
||||
</whitelist>
|
||||
</filter>
|
||||
<logging>
|
||||
highlight="false" lowUpperBound="35" highLowerBound="70"/>
|
||||
<log type="coverage-html" target="./coverage/report" lowUpperBound="35"
|
||||
highLowerBound="70"/>
|
||||
<log type="tap" target="TestResults.tap"/>
|
||||
</logging>
|
||||
|
||||
|
Reference in New Issue
Block a user