<?php

$I = new CliTester($scenario);
// prepare output folders
$I->runShellCommand('mkdir -p /app/src/controllers/crud');
$I->runShellCommand('mkdir -p /app/src/models/crud/search');
// model & crud command
$batch = <<<'CMD'
/app/yii giiant-batch \
    --interactive=0 \
    --overwrite=1 \
    --modelDb=db \
    --modelBaseClass=yii\\db\\ActiveRecord \
    --modelNamespace=app\\\models \
    --crudControllerNamespace=app\\controllers\\crud \
    --crudSearchModelNamespace=app\\models\\crud\\search \
    --crudViewPath=@app/views/crud \
    --crudPathPrefix=crud/ \
    --tables=actor,film,film_actor,language,film_category,category,inventory,store,rental,payment,customer,staff,address,city,country
CMD;
$I->runShellCommand($batch);
// assertions
$I->dontSeeInShellOutput('Please fix the following errors');
$I->dontSeeInShellOutput('ErrorException');
$I->seeInShellOutput('The following files will be generated');
$I->seeFileFound('/app/src/controllers/crud/ActorController.php');
Ejemplo n.º 2
0
<?php

// @group mandatory
$I = new CliTester($scenario);
$I->runShellCommand('yii');
$I->seeInShellOutput('This is Yii version 2.0.');
Ejemplo n.º 3
0
<?php

$I = new CliTester($scenario);
$I->wantTo('check asset bundling');
$I->runShellCommand('mkdir -p web/assets-prod/js');
$I->runShellCommand('mkdir -p web/assets-prod/css');
$I->runShellCommand('yii asset src/config/assets-prod.php src/config/bundle-prod.php');
$I->seeInShellOutput('Output bundle configuration created at');
Ejemplo n.º 4
0
<?php

// @group mandatory
$I = new CliTester($scenario);
$I->runShellCommand("yii help gii");
$I->seeInShellOutput('DESCRIPTION');
$I->seeInShellOutput('SUB-COMMANDS');
$I->seeInShellOutput('gii/');
$I->runShellCommand("yii help gii/giiant-crud");
$I->seeInShellOutput('DESCRIPTION');
$I->seeInShellOutput('yii gii/giiant-crud');