当前位置: 首页>>代码示例>>PHP>>正文


PHP AcceptanceTester::runShellCommand方法代码示例

本文整理汇总了PHP中AcceptanceTester::runShellCommand方法的典型用法代码示例。如果您正苦于以下问题:PHP AcceptanceTester::runShellCommand方法的具体用法?PHP AcceptanceTester::runShellCommand怎么用?PHP AcceptanceTester::runShellCommand使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AcceptanceTester的用法示例。


在下文中一共展示了AcceptanceTester::runShellCommand方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: AcceptanceTester

<?php

$I = new AcceptanceTester($scenario);
$I->wantTo('generate a model without fillable fields or dates');
$I->runShellCommand('php artisan wn:model TestingModel --path=tests/tmp');
$I->seeInShellOutput('TestingModel model generated');
$I->seeFileFound('./tests/tmp/TestingModel.php');
$I->openFile('./tests/tmp/TestingModel.php');
$I->seeFileContentsEqual('<?php namespace Tests\\Tmp;

use Illuminate\\Database\\Eloquent\\Model;

class TestingModel extends Model {

	protected $fillable = [];

	protected $dates = [];

	public static $rules = [
		// Validation rules
	];

	// Relationships

}
');
$I->wantTo('generate a model with fillable fields');
$I->runShellCommand('php artisan wn:model TestingModel --fillable=name,title --path=tests/tmp');
$I->seeFileFound('./tests/tmp/TestingModel.php');
$I->openFile('./tests/tmp/TestingModel.php');
$I->seeInThisFile('protected $fillable = ["name", "title"];');
开发者ID:nasrulhazim,项目名称:lumen-generators,代码行数:31,代码来源:ModelCommandCept.php

示例2: tags

<?php

$I = new AcceptanceTester($scenario);
$I->wantTo('generate a RESTful resource');
$I->runShellCommand('php artisan wn:resource task_category "name;string:unique;requied;fillable descr;text:nullable;;fillable project_id;integer;required;key,fillable due;timestamp;;fillable,date" --has-many="tags,tasks" --belongs-to="project,creator:User" --migration-file=create_task_categories');
// Checking the model
$I->seeInShellOutput('TaskCategory model generated');
$I->seeFileFound('./app/TaskCategory.php');
$I->openFile('./app/TaskCategory.php');
$I->seeInThisFile('namespace App;');
$I->seeInThisFile('class TaskCategory extends Model');
$I->seeInThisFile('protected $fillable = ["name", "descr", "project_id", "due"];');
$I->seeInThisFile('protected $dates = ["due"];');
$I->seeInThisFile('public static $rules = [
		"name" => "requied",
		"project_id" => "required",
	];');
$I->seeInThisFile('
	public function tags()
	{
		return $this->hasMany("App\\Tag");
	}

	public function tasks()
	{
		return $this->hasMany("App\\Task");
	}

	public function project()
	{
		return $this->belongsTo("App\\Project");
开发者ID:nhahv,项目名称:lumen-generators,代码行数:31,代码来源:ResourceCommandCept.php

示例3: AcceptanceTester

<?php

$I = new AcceptanceTester($scenario);
$I->wantTo('Generate the full structure of a new module for Backbone / RequireJS');
// Make sure that we're dealing with a clean directory
$I->cleanDir('tests/tmp');
$I->runShellCommand('php ../../../artisan modules:generate taco --path=tests/tmp/modules');
$I->seeInShellOutput('Successfully created 4 files');
$I->openFile('tests/tmp/modules/tacos/models/taco.js');
$I->seeFileContentsEqual(file_get_Contents('tests/acceptance/stubs/model.stub'));
$I->openFile('tests/tmp/modules/tacos/collections/tacos.js');
$I->seeFileContentsEqual(file_get_Contents('tests/acceptance/stubs/collection.stub'));
$I->openFile('tests/tmp/modules/tacos/views/taco_view.js');
$I->seeFileContentsEqual(file_get_Contents('tests/acceptance/stubs/view.stub'));
$I->openFile('tests/tmp/modules/tacos/index.js');
$I->seeFileContentsEqual(file_get_Contents('tests/acceptance/stubs/index.stub'));
$I->cleanDir('tests/tmp');
开发者ID:mindofmicah,项目名称:backbone-module-command,代码行数:17,代码来源:ModuleGeneratorCept.php

示例4: up

<?php

$I = new AcceptanceTester($scenario);
$I->wantTo('generate a pivot table');
$I->runShellCommand('php artisan wn:pivot-table Tag Project --file=pivot_table');
$I->seeInShellOutput('project_tag migration generated');
$I->seeFileFound('./database/migrations/pivot_table.php');
$I->openFile('./database/migrations/pivot_table.php');
$I->seeFileContentsEqual('<?php

use Illuminate\\Database\\Schema\\Blueprint;
use Illuminate\\Database\\Migrations\\Migration;

class CreateProjectTagTable extends Migration
{
    
    public function up()
    {
        Schema::create(\'project_tag\', function(Blueprint $table) {
            $table->increments(\'id\');
            $table->integer(\'project_id\')->unsigned()->index();
            $table->integer(\'tag_id\')->unsigned()->index();
            $table->foreign(\'project_id\')
                ->references(\'id\')
                ->on(\'projects\');
            $table->foreign(\'tag_id\')
                ->references(\'id\')
                ->on(\'tags\');
            $table->timestamps();
        });
    }
开发者ID:nasrulhazim,项目名称:lumen-generators,代码行数:31,代码来源:PivotTableCommandCept.php

示例5: AcceptanceTester

<?php

/** @var \Codeception\Scenario $scenario */
$I = new AcceptanceTester($scenario);
$inputPath = __DIR__ . '/inputs';
$outputPath = __DIR__ . '/outputs';
$I->runShellCommand('rm -rf ' . $outputPath);
$I->runShellCommand('mkdir ' . $outputPath);
$I->runShellCommand('php extract_markdown_codes.php ' . $inputPath . ' list ' . $outputPath);
// assertions
$I->amInPath($outputPath);
// list1
(function () use($I) {
    $I->openFile('list001.txt');
    $contents = <<<EOT
// list1
require_once __DIR__ . '/vendor/autoload.php';

\$foo = new Foo();
\$foo->execute();

EOT;
    $I->seeFileContentsEqual($contents);
})();
// list2
(function () use($I) {
    $I->openFile('list002.txt');
    $contents = <<<EOT
// list2
\$i = 2;
开发者ID:shin1x1,项目名称:MarkdownCodeExtractor,代码行数:30,代码来源:ExtractMarkdownCodesCommandCept.php

示例6: AcceptanceTester

<?php

$i = 1;
$artisan = 'artisan';
while ($i++ < 10 && !is_file($artisan)) {
    $artisan = "../{$artisan}";
}
$I = new AcceptanceTester($scenario);
$I->wantTo('Generate images out of a CSS file');
$I->runShellCommand("php {$artisan} asset:generate-css-images");
开发者ID:crobays,项目名称:asset,代码行数:10,代码来源:CssImageGeneratorCommandCept.php

示例7: withSuitedEnvironmentTwoCommandsTest

 public function withSuitedEnvironmentTwoCommandsTest(AcceptanceTester $I)
 {
     chdir('../sample/');
     $I->runShellCommand('./vendor/bin/codecept run acceptance --env phantom,firefox --no-colors');
     $I->dontSeeInShellOutput("Functional Tests");
     $I->seeInShellOutput("Acceptance (phantom, firefox) Tests");
     $I->seeInShellOutput($this->beforeAllSmall);
     $I->seeInShellOutput($this->beforeAll);
     $I->seeInShellOutput($this->beforeAnySuite);
     $I->seeInShellOutput($this->afterAnySuite);
     $I->seeInShellOutput($this->afterAll);
     $I->seeInShellOutput($this->beforeAcceptanceSuite);
     $I->seeInShellOutput($this->afterAcceptanceSuite);
     $I->seeInShellOutput($this->twoEnvironmentsOut);
     $I->seeInShellOutput($this->oneEnvironmentsOut);
     $I->seeInShellOutput(PHP_OS);
     $I->seeInShellOutput($this->beforeAllEnv);
     $I->seeInShellOutput($this->afterAllEnv);
     chdir('../test/');
 }
开发者ID:oprudkyi,项目名称:codeception-events-scripting,代码行数:20,代码来源:AcceptanceTestCest.php

示例8: AcceptanceTester

<?php

$I = new AcceptanceTester($scenario);
$I->wantTo('generate RESTful routes for a resource with default controller');
$I->runShellCommand('php artisan wn:route project-type');
$I->seeInShellOutput('project-type routes generated');
$I->openFile('./app/Http/routes.php');
$I->seeInThisFile("\n\$app->get('project-type', 'ProjectTypesController@all');\n\$app->get('project-type/{id}', 'ProjectTypesController@get');\n\$app->post('project-type', 'ProjectTypesController@add');\n\$app->put('project-type/{id}', 'ProjectTypesController@put');\n\$app->delete('project-type/{id}', 'ProjectTypesController@remove');\n");
$I->writeToFile('./app/Http/routes.php', '<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It is a breeze. Simply tell Lumen the URIs it should respond to
| and give it the Closure to call when that URI is requested.
|
*/

$app->get("/", function () use ($app) {
    return $app->welcome();
});
');
$I->wantTo('generate RESTful routes for a resource with custom controller');
$I->runShellCommand('php artisan wn:route foo --controller=customController');
$I->seeInShellOutput('foo routes generated');
$I->openFile('./app/Http/routes.php');
$I->seeInThisFile("\n\$app->get('foo', 'customController@all');\n\$app->get('foo/{id}', 'customController@get');\n\$app->post('foo', 'customController@add');\n\$app->put('foo/{id}', 'customController@put');\n\$app->delete('foo/{id}', 'customController@remove');\n");
$I->writeToFile('./app/Http/routes.php', '<?php
开发者ID:nasrulhazim,项目名称:lumen-generators,代码行数:31,代码来源:RouteCommandCept.php

示例9: AcceptanceTester

<?php

$saveDir = './tests/acceptance/tmp';
$stubDir = './tests/acceptance/stubs';
$queryToGenerate = 'FooQuery';
$I = new AcceptanceTester($scenario);
$I->wantTo('generate a query and handler class');
$I->runShellCommand("php ../../../artisan querier:generate {$queryToGenerate} --properties='bar, baz' --base='{$saveDir}'");
$I->seeInShellOutput('All done!');
// My Command stub should match the generated class.
$I->openFile("{$saveDir}/{$queryToGenerate}.php");
$I->seeFileContentsEqual(file_get_contents("{$stubDir}/{$queryToGenerate}.stub"));
// And my QueryHandler stub should match its generated counterpart, as well.
$I->openFile("{$saveDir}/{$queryToGenerate}Handler.php");
$I->seeFileContentsEqual(file_get_contents("{$stubDir}/{$queryToGenerate}Handler.stub"));
$I->cleanDir($saveDir);
开发者ID:smgladkovskiy,项目名称:querier,代码行数:16,代码来源:GeneratorQueryCept.php

示例10: up

<?php

$I = new AcceptanceTester($scenario);
$I->wantTo('generate a migration without schema');
$I->runShellCommand('php artisan wn:migration tasks --file=create_tasks');
$I->seeInShellOutput('tasks migration generated');
$I->seeFileFound('./database/migrations/create_tasks.php');
$I->openFile('./database/migrations/create_tasks.php');
$I->seeFileContentsEqual('<?php

use Illuminate\\Database\\Schema\\Blueprint;
use Illuminate\\Database\\Migrations\\Migration;

class CreateTasksMigration extends Migration
{
    
    public function up()
    {
        Schema::create(\'tasks\', function(Blueprint $table) {
            $table->increments(\'id\');
            // Schema declaration
            // Constraints declaration
            $table->timestamps();
        });
    }

    public function down()
    {
        Schema::drop(\'tasks\');
    }
}
开发者ID:nhahv,项目名称:lumen-generators,代码行数:31,代码来源:MigrationCommandCept.php

示例11: AcceptanceTester

<?php

$I = new AcceptanceTester($scenario);
$I->wantTo('generate the REST actions trait');
$I->runShellCommand('php artisan wn:controller:rest-actions');
$I->seeInShellOutput('REST actions trait generated');
$I->seeFileFound('./app/Http/Controllers/RESTActions.php');
$I->openFile('./app/Http/Controllers/RESTActions.php');
$I->seeInThisFile('trait RESTActions {');
$I->deleteFile('./app/Http/Controllers/RESTActions.php');
开发者ID:nasrulhazim,项目名称:lumen-generators,代码行数:10,代码来源:ControllerRestActionsCommandCept.php

示例12: AcceptanceTester

<?php

$I = new AcceptanceTester($scenario);
$I->wantTo('generate both a command and a hndler class');
$I->runShellCommand('php artisan commander:generate Acme/Bar/FooCommand --properties="bar, baz" --base="tests/tmp"');
$I->seeInShellOutput('All done!');
$I->openFile('tests/tmp/Acme/Bar/FooCommand.php');
$I->seeFileContentsEqual(file_get_contents('tests/acceptance/stub/FooCommand.stub'));
//$I->seeFileFound('tests/tmp/FooCommandHandler.php');
开发者ID:sabahtalateh,项目名称:laracast,代码行数:9,代码来源:CommandGeneratorCept.php

示例13: AcceptanceTester

<?php

$I = new AcceptanceTester($scenario);
$I->wantTo('generate a RESTful controller with short model name');
$I->runShellCommand('php artisan wn:controller Test --no-routes');
$I->seeInShellOutput('TestsController generated');
$I->seeFileFound('./app/Http/Controllers/TestsController.php');
$I->openFile('./app/Http/Controllers/TestsController.php');
$I->seeFileContentsEqual('<?php namespace App\\Http\\Controllers;


class TestsController extends Controller {

	const MODEL = "App\\Test";

	use RESTActions;

}
');
$I->deleteFile('./app/Http/Controllers/TestsController.php');
$I->wantTo('generate a RESTful controller with full model name and routes');
$I->runShellCommand('php artisan wn:controller "App\\Models\\Category"');
$I->seeInShellOutput('CategoriesController generated');
$I->seeFileFound('./app/Http/Controllers/CategoriesController.php');
$I->openFile('./app/Http/Controllers/CategoriesController.php');
$I->seeFileContentsEqual('<?php namespace App\\Http\\Controllers;


class CategoriesController extends Controller {

	const MODEL = "App\\Models\\Category";
开发者ID:nasrulhazim,项目名称:lumen-generators,代码行数:31,代码来源:ControllerCommandCept.php

示例14: unlink

 */
if (false !== file_exists('tests/codeception/actualTestResults/FooForm.php')) {
    unlink('tests/codeception/actualTestResults/FooForm.php');
}
if (false !== file_exists('app/Forms/FooForm.php')) {
    unlink('app/Forms/FooForm.php');
}
$I = new AcceptanceTester($scenario);
$I->wantTo('create a form taking into account all valid parameters');
$baseDir = '../../../';
$vendorDir = './vendor/bin/';
/*
 * Test all options
 */
$command = 'php ' . $baseDir . 'artisan generate:form Foo --dir="tests/codeception/actualTestResults" --namespace="Bar" --rules="baz|required|email & qux|between:3,6"';
$I->runShellCommand($command);
$I->seeInShellOutput('Form has been saved to');
$I->openFile('tests/codeception/actualTestResults/FooForm.php');
$I->canSeeFileContentsEqual(file_get_contents('tests/codeception/expectedTestResults/FooForm-with-all-options.php'));
unlink('tests/codeception/actualTestResults/FooForm.php');
/*
 * Test no namespace and no rules
 */
$command = 'php ' . $baseDir . 'artisan generate:form Foo --dir="tests/codeception/actualTestResults"';
$I->runShellCommand($command);
$I->seeInShellOutput('Form has been saved to');
$I->openFile('tests/codeception/actualTestResults/FooForm.php');
$I->canSeeFileContentsEqual(file_get_contents('tests/codeception/expectedTestResults/FooForm-with-no-namespace-and-no-rules.php'));
unlink('tests/codeception/actualTestResults/FooForm.php');
/*
 * Test no namespace and no rules or a directory
开发者ID:GrandadEvans,项目名称:laravel-form-validator,代码行数:31,代码来源:formGeneratorCept.php


注:本文中的AcceptanceTester::runShellCommand方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。