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


PHP TestCase::setUp方法代码示例

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


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

示例1: setUp

 public function setUp()
 {
     parent::setUp();
     $artisan = $this->app->make('artisan');
     $artisan->call('migrate', ['--database' => 'testbench', '--path' => '../tests/migrations']);
     $this->countQueries();
 }
开发者ID:acasar,项目名称:laravel-translatable,代码行数:7,代码来源:TestsBase.php

示例2: setUp

 public function setUp()
 {
     parent::setUp();
     \Config::set('database.default', 'sqlite');
     \Config::set('database.connections', ['sqlite' => array('driver' => 'sqlite', 'database' => ':memory:', 'prefix' => '')]);
     $this->createDatabase();
 }
开发者ID:tacone,项目名称:bees,代码行数:7,代码来源:BaseTestCase.php

示例3: setUp

 /**
  * Setup the test environment.
  */
 public function setUp()
 {
     parent::setUp();
     // uncomment to enable route filters if your package defines routes with filters
     // $this->app['router']->enableFilters();
     // create an artisan object for calling migrations
     //$artisan = $this->app->make('artisan');
     // call migrations for packages upon which our package depends, e.g. Cartalyst/Sentry
     // not necessary if your package doesn't depend on another package that requires
     // running migrations for proper installation
     /* uncomment as necessary
     	$artisan->call('migrate', [
     	'--database' => 'testbench',
     	'--path' => '../vendor/cartalyst/sentry/src/migrations',
     	]);
     	*/
     // call migrations that will be part of your package, assumes your migrations are in src/migrations
     // not neccessary if your package doesn't require any migrations to be run for
     // proper installation
     /* uncomment as neccesary
     	$artisan->call('migrate', [
     	'--database' => 'testbench',
     	'--path' => 'migrations',
     	]);
     	*/
     // call migrations specific to our tests, e.g. to seed the db
     /*$artisan->call('migrate', array(
           '--database' => 'testbench',
           '--path' => '../tests/migrations',
       ));*/
 }
开发者ID:xnum,项目名称:lxmpd,代码行数:34,代码来源:MPDIsLocalTest.php

示例4: setUp

 public function setUp()
 {
     parent::setUp();
     $this->app->instance('path.public', __DIR__ . '/fixture');
     Image::deleteManipulated($this->imagePath);
     $this->imageSize = getimagesize(public_path() . $this->imagePath);
 }
开发者ID:sonjoysam,项目名称:laravel-image,代码行数:7,代码来源:ImageTestCase.php

示例5: setUp

 public function setUp()
 {
     parent::setUp();
     $this->artisan('migrate', ['--database' => 'testbench', '--realpath' => realpath(__DIR__ . '/database')]);
     // @TODO refactor fixtures, this schema sucks so much :(
     \DB::table('person')->delete();
     \DB::table('son')->delete();
     \DB::table('roles')->delete();
     \DB::table('person')->insert(['id' => 1, 'name' => 'Homer']);
     \DB::table('person')->insert(['id' => 2, 'name' => 'Marge']);
     \DB::table('person')->insert(['id' => 3, 'name' => 'Apu']);
     \DB::table('son')->insert(['pid' => 1, 'name' => 'Bart']);
     \DB::table('son')->insert(['pid' => 1, 'name' => 'Lisa']);
     \DB::table('son')->insert(['pid' => 1, 'name' => 'Maggie']);
     \DB::table('son')->insert(['pid' => 2, 'name' => 'Lisa']);
     \DB::table('roles')->insert(['id' => 1, 'name' => 'Father']);
     \DB::table('roles')->insert(['id' => 2, 'name' => 'Mother']);
     \DB::table('roles')->insert(['id' => 3, 'name' => 'Vendor']);
     \DB::table('roles')->insert(['id' => 4, 'name' => 'Children']);
     \DB::table('roles')->insert(['id' => 5, 'name' => 'Nuclear Safety Inspector']);
     \DB::table('roles')->insert(['id' => 6, 'name' => 'Ambulance Driver']);
     \DB::table('roles')->insert(['id' => 7, 'name' => 'Food Critic']);
     \DB::table('person_roles')->insert(['pid' => 1, 'rid' => 1]);
     \DB::table('person_roles')->insert(['pid' => 2, 'rid' => 2]);
     \DB::table('person_roles')->insert(['pid' => 3, 'rid' => 3]);
 }
开发者ID:foothing,项目名称:laravel-repository,代码行数:26,代码来源:BaseTestCase.php

示例6: setUp

 public function setUp()
 {
     parent::setUp();
     $this->queries = new Helpers\SqliteQueries();
     $this->migrateDatabase();
     $this->seedDatabase();
 }
开发者ID:czim,项目名称:laravel-pxlcms,代码行数:7,代码来源:TestCase.php

示例7: setUp

 public function setUp()
 {
     parent::setUp();
     if (File::isDirectory('packages')) {
         File::deleteDirectory('packages');
     }
 }
开发者ID:kun391,项目名称:laravel-generator,代码行数:7,代码来源:TestCase.php

示例8: setUp

 public function setUp()
 {
     parent::setUp();
     if (!file_exists($this->testImage)) {
         copy($this->sample, $this->testImage);
     }
 }
开发者ID:ankitpokhrel,项目名称:laravel-image,代码行数:7,代码来源:TestCase.php

示例9: setUp

 public function setUp()
 {
     parent::setUp();
     Route::any('{anything}', function () {
     })->where('anything', '.*');
     $this->app['router']->enableFilters();
 }
开发者ID:schickling,项目名称:laravel-cash,代码行数:7,代码来源:InvalidationTest.php

示例10: setUp

 public function setUp()
 {
     parent::setUp();
     $this->app->bindShared('path.base', function () {
         return BASE_PATH;
     });
 }
开发者ID:bloomon,项目名称:laravel-spreadsheet-lang,代码行数:7,代码来源:TestCase.php

示例11: setUp

 public function setUp()
 {
     parent::setUp();
     app('Illuminate\\Database\\DatabaseManager')->beginTransaction();
     $this->artisan = $this->app->make('Illuminate\\Contracts\\Console\\Kernel');
     $this->artisan->call('migrate', ['--realpath' => realpath(__DIR__ . '/../resources/migrations')]);
 }
开发者ID:phaza,项目名称:laravel-norwegian-zip-codes,代码行数:7,代码来源:ZipCodeTestCase.php

示例12: setUp

 public function setUp()
 {
     parent::setUp();
     $this->app['path.database'] = __DIR__;
     $migration = new CreateTokensTable();
     $migration->up();
     Schema::create('users', function (\Illuminate\Database\Schema\Blueprint $table) {
         $table->increments('id');
         $table->string('username', 128)->unique();
         $table->timestamps();
     });
     $user = new User();
     $user->username = 'jerry';
     $user->save();
     $user = new User();
     $user->username = 'khan';
     $user->save();
     $token = App::make('token');
     $token->create(1, 1, 7200);
     // 1 OK
     $token->create(2, 1, 7200);
     // 2 Not loggable by token
     $token->create(1, false, 7200);
     // 3 Expired
     $obj = $token->find(3);
     $obj->expire_at = time() - 3600;
     $token->persist($obj);
     $token->create();
     // 4 token without user
 }
开发者ID:lahaxearnaud,项目名称:laravel-token,代码行数:30,代码来源:TestCase.php

示例13: setUp

 /**
  * Setup test.
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     $this->dilemma = $this->app->make('TradeoffDilemma', $this->getResolution());
     $this->resolution = $this->dilemma->getResolution();
     $this->map = $this->resolution->getMap();
 }
开发者ID:findbrok,项目名称:laravel-tradeoff-analytics,代码行数:12,代码来源:TestMap.php

示例14: setUp

 public function setUp()
 {
     parent::setUp();
     $this->bookRepo = m::mock('Bakgat\\Notos\\Domain\\Model\\Resource\\BookRepository');
     $this->org = Organization::register(new Name('VBS De Klimtoren'), new DomainName('klimtoren.be'));
     $this->spec = new IsbnIsUnique($this->bookRepo);
 }
开发者ID:bakgat,项目名称:notos,代码行数:7,代码来源:IsbnIsUniqueTest.php

示例15: setUp

 /**
  * Setup the test environment.
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     $this->model = Mockery::mock(Model::class)->makePartial();
     $this->repository = Mockery::mock(Repository::class)->makePartial();
     $this->repository->setupRepository($this->model);
 }
开发者ID:nodes-php,项目名称:database,代码行数:12,代码来源:TestCase.php


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