本文整理汇总了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');
示例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();
示例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');
示例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()
{
示例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');
示例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;
}