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


PHP AcceptanceTester::seeFileContentsEqual方法代码示例

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


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

示例1: AcceptanceTester

$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"];');
$I->wantTo('generate a model with dates fields');
$I->runShellCommand('php artisan wn:model TestingModel --dates=started_at --path=tests/tmp');
开发者ID:nasrulhazim,项目名称:lumen-generators,代码行数:31,代码来源:ModelCommandCept.php

示例2: use

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

EOT;
    $I->seeFileContentsEqual($contents);
})();
// list3
(function () use($I) {
    $I->openFile('list003.txt');
    $contents = <<<EOT
开发者ID:shin1x1,项目名称:MarkdownCodeExtractor,代码行数:31,代码来源:ExtractMarkdownCodesCommandCept.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

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

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

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

示例6: up

$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\');
    }
}
');
$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');
开发者ID:nhahv,项目名称:lumen-generators,代码行数:32,代码来源:MigrationCommandCept.php

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

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


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