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


PHP AcceptanceTester::deleteFile方法代码示例

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


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

示例1: accounts

$I->seeInThisFile('
	public function accounts()
	{
		return $this->hasMany("Tests\\Tmp\\Account");
	}
');
$I->seeInThisFile('
	public function owner()
	{
		return $this->belongsTo("App\\User");
	}
');
$I->seeInThisFile('
	public function number()
	{
		return $this->hasOne("Tests\\Tmp\\Phone");
	}
');
$I->wantTo('generate a model with validation rules');
$I->runShellCommand('php artisan wn:model TestingModel --rules="name=required age=integer|min:13 email=email|unique:users,email_address" --path=tests/tmp');
$I->seeFileFound('./tests/tmp/TestingModel.php');
$I->openFile('./tests/tmp/TestingModel.php');
$I->seeInThisFile('
	public static $rules = [
		"name" => "required",
		"age" => "integer|min:13",
		"email" => "email|unique:users,email_address",
	];
');
$I->deleteFile('./tests/tmp/TestingModel.php');
开发者ID:nasrulhazim,项目名称:lumen-generators,代码行数:30,代码来源:ModelCommandCept.php

示例2: tasks

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

	public function project()
	{
		return $this->belongsTo("App\\Project");
	}

	public function creator()
	{
		return $this->belongsTo("App\\User");
	}');
$I->deleteFile('./app/TaskCategory.php');
// Checking the migration
$I->seeInShellOutput('task_categories migration generated');
$I->seeFileFound('./database/migrations/create_task_categories.php');
$I->openFile('./database/migrations/create_task_categories.php');
$I->seeInThisFile('class CreateTaskCategoriesMigration extends Migration');
$I->seeInThisFile('Schema::create(\'task_categories\', function(Blueprint $table) {
            $table->increments(\'id\');
            $table->string(\'name\')->unique();
            $table->text(\'descr\')->nullable();
            $table->integer(\'project_id\');
            $table->timestamp(\'due\');
            $table->foreign(\'project_id\')
                ->references(\'id\')
                ->on(\'projects\');
            $table->timestamps();
开发者ID:nhahv,项目名称:lumen-generators,代码行数:30,代码来源:ResourceCommandCept.php

示例3: up

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();
        });
    }

    public function down()
    {
        Schema::drop(\'project_tag\');
    }
}
');
$I->deleteFile('./database/migrations/pivot_table.php');
开发者ID:nasrulhazim,项目名称:lumen-generators,代码行数:29,代码来源:PivotTableCommandCept.php

示例4: down

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

    public function down()
    {
        Schema::drop(\'tasks\');
    }
}
');
$I->deleteFile('./database/migrations/create_tasks.php');
$I->wantTo('generate a migration with schema');
$I->runShellCommand('php artisan wn:migration tasks --file=create_tasks --schema="amount:decimal.5,2:after.\'size\':default.8 title:string:nullable"');
$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()
    {
开发者ID:nhahv,项目名称:lumen-generators,代码行数:31,代码来源:MigrationCommandCept.php

示例5: 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

示例6:

$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";

	use RESTActions;

}
开发者ID:nasrulhazim,项目名称:lumen-generators,代码行数:31,代码来源:ControllerCommandCept.php


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