mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-01 20:19:42 +08:00
Raise version min PHP 7.3.
This commit is contained in:
@ -18,7 +18,7 @@ use yii\web\View;
|
||||
*/
|
||||
class AssetBundleTest extends \yiiunit\TestCase
|
||||
{
|
||||
protected function setUp()
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$this->mockApplication();
|
||||
@ -124,7 +124,7 @@ class AssetBundleTest extends \yiiunit\TestCase
|
||||
$this->assertFalse(is_dir($bundle->basePath));
|
||||
foreach ($bundle->js as $filename) {
|
||||
$publishedFile = $bundle->basePath . DIRECTORY_SEPARATOR . $filename;
|
||||
$this->assertFileNotExists($publishedFile);
|
||||
$this->assertFileDoesNotExist($publishedFile);
|
||||
}
|
||||
}
|
||||
|
||||
@ -144,7 +144,7 @@ class AssetBundleTest extends \yiiunit\TestCase
|
||||
$this->assertFalse(is_dir($bundle->basePath));
|
||||
foreach ($bundle->js as $filename) {
|
||||
$publishedFile = $bundle->basePath . DIRECTORY_SEPARATOR . $filename;
|
||||
$this->assertFileNotExists($publishedFile);
|
||||
$this->assertFileDoesNotExist($publishedFile);
|
||||
}
|
||||
}
|
||||
|
||||
@ -163,7 +163,7 @@ class AssetBundleTest extends \yiiunit\TestCase
|
||||
$bundle->publish($am);
|
||||
|
||||
$notNeededFilesDir = dirname($bundle->basePath . DIRECTORY_SEPARATOR . $bundle->css[0]);
|
||||
$this->assertFileNotExists($notNeededFilesDir);
|
||||
$this->assertFileDoesNotExist($notNeededFilesDir);
|
||||
|
||||
foreach ($bundle->js as $filename) {
|
||||
$publishedFile = $bundle->basePath . DIRECTORY_SEPARATOR . $filename;
|
||||
@ -189,7 +189,9 @@ class AssetBundleTest extends \yiiunit\TestCase
|
||||
$view = $this->getView(['basePath' => '@testReadOnlyAssetPath']);
|
||||
$bundle = new TestSourceAsset();
|
||||
|
||||
$this->setExpectedException('yii\base\InvalidConfigException', 'The directory is not writable by the Web process');
|
||||
$this->expectException(\yii\base\InvalidConfigException::class);
|
||||
$this->expectExceptionMessage('The directory is not writable by the Web process');
|
||||
|
||||
$bundle->publish($view->getAssetManager());
|
||||
|
||||
FileHelper::removeDirectory($path);
|
||||
@ -543,7 +545,7 @@ EOF;
|
||||
$am = $view->assetManager;
|
||||
// publishing without timestamp
|
||||
$result = $am->publish($path . '/data.txt');
|
||||
$this->assertRegExp('/.*data.txt$/i', $result[1]);
|
||||
$this->assertMatchesRegularExpression('/.*data.txt$/i', $result[1]);
|
||||
unset($view, $am, $result);
|
||||
|
||||
$view = $this->getView();
|
||||
@ -551,7 +553,7 @@ EOF;
|
||||
// turn on timestamp appending
|
||||
$am->appendTimestamp = true;
|
||||
$result = $am->publish($path . '/data.txt');
|
||||
$this->assertRegExp('/.*data.txt\?v=\d+$/i', $result[1]);
|
||||
$this->assertMatchesRegularExpression('/.*data.txt\?v=\d+$/i', $result[1]);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -563,7 +565,7 @@ EOF;
|
||||
|
||||
$view = $this->getView(['appendTimestamp' => true]);
|
||||
TestNonRelativeAsset::register($view);
|
||||
$this->assertRegExp(
|
||||
$this->assertMatchesRegularExpression(
|
||||
'~123<script src="http:\/\/example\.com\/js\/jquery\.js\?v=\d+"><\/script>4~',
|
||||
$view->renderFile('@yiiunit/data/views/rawlayout.php')
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user