Browse Source

improved dockerized tests (#15516)

- added ENV variable for using custom runtime folder
- create assets directory before using asset-manager
tags/2.0.14
Tobias Munk 7 years ago committed by Alexander Makarov
parent
commit
1bc17a3d22
  1. 5
      tests/bootstrap.php
  2. 2
      tests/docker-compose.yml
  3. 2
      tests/framework/grid/CheckboxColumnTest.php

5
tests/bootstrap.php

@ -23,5 +23,10 @@ require_once __DIR__ . '/../framework/Yii.php';
Yii::setAlias('@yiiunit', __DIR__);
if (getenv('TEST_RUNTIME_PATH')) {
Yii::setAlias('@yiiunit/runtime', getenv('TEST_RUNTIME_PATH'));
Yii::setAlias('@runtime', getenv('TEST_RUNTIME_PATH'));
}
require_once __DIR__ . '/compatibility.php';
require_once __DIR__ . '/TestCase.php';

2
tests/docker-compose.yml

@ -12,6 +12,8 @@ services:
# Tmpfs volume (experimental, asset tests may fail)
#tmpfs:
# - /project/tests/runtime
environment:
- TEST_RUNTIME_PATH=/tmp/runtime
networks:
default:

2
tests/framework/grid/CheckboxColumnTest.php

@ -27,8 +27,8 @@ class CheckboxColumnTest extends TestCase
$this->mockApplication();
Yii::setAlias('@webroot', '@yiiunit/runtime');
Yii::setAlias('@web', 'http://localhost/');
Yii::$app->assetManager->bundles['yii\web\JqueryAsset'] = false;
FileHelper::createDirectory(Yii::getAlias('@webroot/assets'));
Yii::$app->assetManager->bundles['yii\web\JqueryAsset'] = false;
}
public function testInputName()

Loading…
Cancel
Save