https://join.slack.com/t/yii/shared_invite/MjIxMjMxMTk5MTU1LTE1MDE3MDAwMzMtM2VkMTMyMjY1Ng
- Asserts
- Filesystem
- Yii2
- sima\tzarfixture\Module
- PhpBrowser
- REST
depends:
REST: PhpBrowser
config:
PhpBrowser:
url: http://backend-sl.local:80
Yii2:
#cleanup: true # DANGER!
configFile: '../config/backend/functional.php'
REST:
depends: PhpBrowser
url: 'https://backend-sl.local/index-test.php/'
class_name: FunctionalTester
modules:
enabled:
- Asserts
- Filesystem
- Yii2
- sima\tzarfixture\Module
- PhpBrowser
- tests\codeception\common\_support\modules\MaterializedView
- pastuhov\logstock\AcceptanceHelper
config:
PhpBrowser:
url: http://backend-sl.local:80
Yii2:
#cleanup: true # DANGER!
configFile: '../config/backend/functional.php'
sima\tzarfixture\Module:
fixtureFile: '/var/www/html/tests/codeception/common/fixtures/db.sql'
fixturePath: '/var/www/html/tests/codeception/common/fixtures/data/'
env:
# Среда для восстановления БД из бакапа, для первого старта, самое то.
restore:
modules:
config:
sima\tzarfixture\Module:
restore: true
# Среда для изменения БД
modify:
modules:
config:
sima\tzarfixture\Module:
modify: true
restore: true
$I->wantTo('download');
$I->haveJwtTokenAuthorization(123);
$I->sendGET('/v1/file/1/download');
$I->seeResponseCodeIs(200);
$I->seeHttpHeader('Content-Disposition');
хочу по клику на кнопку отдавать что в фильтрах в ексель
То что ты в фильтр забил или то что тебе фильттр отдал т.е. отфильтрованную таблицу же?
Ruslan Gilyazetdinov, [10.10.17 14:23]
подскажите как правильно чекать капчу в юнит тестах? получаю такую ошибку сейчас Invalid CAPTCHA action ID: /user/default/captcha
Ruslan Gilyazetdinov, [10.10.17 14:24]
в рулз ['verifyCode', 'captcha', 'captchaAction' => '/user/default/captcha'],
Ruslan Gilyazetdinov, [10.10.17 14:24]
в контроллере
public function actions()
{
return [
'captcha' => [
'class' => 'yii\captcha\CaptchaAction',
'fixedVerifyCode' => YII_ENV_TEST ? 'testme' : null,
],
];
}
<?php Pjax::begin(['enablePushState' => false]); ?>
<?php $form = ActiveForm::begin(); ?>
<?= Html::hiddenInput('SeoPageHistorySearch[seo_page_url]', $searchModel->seo_page_url) ?>
<?= Html::hiddenInput('SeoPageHistorySearch[seo_type_id]', $searchModel->seo_type_id) ?>
<?= Html::hiddenInput('SeoPageHistorySearch[updated_at]', $searchModel->updated_at) ?>
<?= Html::hiddenInput('submit', 1) ?>
<?= Html::submitButton('Выгрузить отчёт', ['class' => 'btn btn-primary']); ?>
<?php ActiveForm::end(); ?>
Привет всем, вопрос по ДИ.
'container' => [
'definitions' => [
'\GuzzleHttp\ClientInterface' => [
'class' => '\Guzzle\Http\Client',
],
]
],
Вот компонент, куда внедряется зависимость:
use GuzzleHttp\ClientInterface;
class MazafakaAdapter extends Component
{
/** @var ClientInterface */
private $httpClient;
public function __construct(ClientInterface $client, array $config = [])
{
parent::__construct($config);
$this->httpClient = $client;
}
}
$adapter = Yii::createObject(MazafakaAdapter::className());
Приводит к ошибке Exception 'yii\di\NotInstantiableException' with message 'Can not instantiate GuzzleHttp\ClientInterface.'Вопрос, что я делаю не так?