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


PHP TestCase::setUp方法代码示例

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


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

示例1: setUp

 /**
  * Set up test environment.
  */
 public function setUp()
 {
     parent::setUp();
     $this->structure = new WritersStructure();
     if (!class_exists("{$this->namespace}Writer", false)) {
         $this->structure->build();
     }
     // Managers
     $this->base_writers_manager_reflection = new ReflectionClass("{$this->namespace}Manager\\Base\\Writers");
     $this->writers_manager_reflection = new ReflectionClass("{$this->namespace}Manager\\Writers");
     $this->base_books_manager_reflection = new ReflectionClass("{$this->namespace}Manager\\Base\\Books");
     $this->books_manager_reflection = new ReflectionClass("{$this->namespace}Manager\\Books");
     $this->base_chapters_manager_reflection = new ReflectionClass("{$this->namespace}Manager\\Base\\Chapters");
     $this->chapters_manager_reflection = new ReflectionClass("{$this->namespace}Manager\\Chapters");
     // Collections
     $this->base_writers_collection_reflection = new ReflectionClass("{$this->namespace}Collection\\Base\\Writers");
     $this->writers_collection_reflection = new ReflectionClass("{$this->namespace}Collection\\Writers");
     $this->base_books_collection_reflection = new ReflectionClass("{$this->namespace}Collection\\Base\\Books");
     $this->books_collection_reflection = new ReflectionClass("{$this->namespace}Collection\\Books");
     $this->base_chapters_collection_reflection = new ReflectionClass("{$this->namespace}Collection\\Base\\Chapters");
     $this->chapters_collection_reflection = new ReflectionClass("{$this->namespace}Collection\\Chapters");
     // Types
     $this->base_writer_reflection = new ReflectionClass("{$this->namespace}Base\\Writer");
     $this->writer_reflection = new ReflectionClass("{$this->namespace}Writer");
     $this->base_book_reflection = new ReflectionClass("{$this->namespace}Base\\Book");
     $this->book_reflection = new ReflectionClass("{$this->namespace}Book");
     $this->base_chapter_reflection = new ReflectionClass("{$this->namespace}Base\\Chapter");
     $this->chapter_reflection = new ReflectionClass("{$this->namespace}Chapter");
 }
开发者ID:activecollab,项目名称:databasestructure,代码行数:32,代码来源:CodeBuilderTest.php

示例2: setUp

 public function setUp()
 {
     parent::setUp();
     // Don't forget this!
     $this->faker = Faker\Factory::create();
     //$this->prepareForTests();
 }
开发者ID:roberto-butti,项目名称:ODOapp,代码行数:7,代码来源:UserTest.php

示例3: setUp

 /**
  * Called before each test.
  */
 public function setUp()
 {
     parent::setUp();
     $this->user = factory(\App\User::class)->create();
     $this->client = factory(\App\Client::class)->create(['user_id' => $this->user->id]);
     $this->bill = factory(\App\Bill::class)->create(['user_id' => $this->user->id, 'client_id' => $this->client->id, 'paid' => 1]);
 }
开发者ID:bitller,项目名称:nova,代码行数:10,代码来源:MarkBillAsUnpaidTest.php

示例4: setUp

 public function setUp()
 {
     parent::setUp();
     Artisan::call('migrate');
     Artisan::call('db:seed');
     Session::start();
 }
开发者ID:BaobabHealthTrust,项目名称:iBLIS,代码行数:7,代码来源:TestControllerTest.php

示例5: setUp

	/**
	 * Sets up dependencies for the test.
	 *
	 * @return  void
	 *
	 * @since   12.1
	 */
	protected function setUp()
	{
		parent::setUp();

		require_once JPATH_PLATFORM . '/joomla/form/fields/url.php';
		include_once dirname(__DIR__) . '/inspectors.php';
	}
开发者ID:realityking,项目名称:joomla-platform,代码行数:14,代码来源:JFormFieldUrlTest.php

示例6: setUp

 function setUp()
 {
     parent::setUp();
     $this->messenger = new Messenger('random_access_token');
     $this->message = new Message('Some title');
     $this->recipient = 123456789;
 }
开发者ID:bobbybouwmann,项目名称:messenger,代码行数:7,代码来源:MessengerTest.php

示例7: setUp

 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  *
  * @return  void
  *
  * @since   3.0
  */
 protected function setUp()
 {
     $this->object = new JToolbar('toolbar');
     parent::setUp();
     $this->saveFactoryState();
     JFactory::$application = $this->getMockApplication();
 }
开发者ID:shoffmann52,项目名称:install-from-web-server,代码行数:15,代码来源:JToolbarTest.php

示例8: setUp

 public function setUp()
 {
     $this->createApplication();
     parent::setUp();
     $this->mockHtmldom = $this->mock('App\\Libros\\Htmldom');
     $this->reviews = App::make('App\\Libros\\Reviews');
 }
开发者ID:mhosks,项目名称:libros,代码行数:7,代码来源:ReviewsTest.php

示例9: setUp

 public function setUp()
 {
     parent::setUp();
     Artisan::call('migrate');
     Artisan::call('db:seed', array('--class' => 'Day007_TodosTableSeeder'));
     $this->test = new Todo();
 }
开发者ID:viniciusferreira,项目名称:daily,代码行数:7,代码来源:TodoTest.php

示例10: setUp

 /**
  * Setup for testing.
  *
  * @return  void
  *
  * @since   11.3
  */
 public function setUp()
 {
     parent::setUp();
     // We are only coupled to Document and Language in JFactory.
     $this->saveFactoryState();
     JFactory::$language = $this->getMockLanguage();
 }
开发者ID:rvsjoen,项目名称:joomla-platform,代码行数:14,代码来源:JHtmlDateTest.php

示例11: setUp

 public function setUp()
 {
     parent::setUp();
     $this->config = ['setup' => ['index' => 'tests', 'type' => 'test', 'mapping' => ['properties' => ['soft_delete_status' => 'integer', 'datetime' => 'date', 'title' => 'string', 'descriptions' => 'string', 'features' => 'string', 'binding' => 'string', 'brand' => 'string', 'manufacturer' => 'string', 'model' => 'string', 'group' => 'string', 'size' => 'string', 'clothing_size' => 'string', 'occasions' => 'string', 'min_price' => 'integer', 'max_price' => 'integer'], 'parent' => null]]];
     $this->expected_index_params = ['index' => 'tests', 'type' => 'test', 'id' => 100, 'body' => ['datetime' => '2014-02-14', 'title' => 'test title', 'descriptions' => ['test desc1', 'test desc2'], 'features' => ['test feat1', 'test feat2'], 'binding' => 'test binding', 'brand' => 'test brand', 'manufacturer' => 'test manuf', 'model' => 'test model', 'group' => 'test group', 'size' => 'test size', 'clothing_size' => 'test clothing size', 'occasions' => ['test occ1', 'test occ2'], 'min_price' => 1, 'max_price' => 10, 'soft_delete_status' => 0]];
     $this->generator = $this->app->make('Ryanrobertsname\\LaravelElasticsearchRepository\\ParamsGenerator\\Index\\ESIndexParamsGenerator');
 }
开发者ID:ryanrobertsname,项目名称:laravel-elasticsearch-repository,代码行数:7,代码来源:ESIndexParamsGeneratorTest.php

示例12: setUp

	public function setUp()
	{
		parent::setUp();
        $this->mock = m::mock('Eloquent', 'Island');

		$this->app->instance('Island', $this->mock);
	}
开发者ID:hendryguna,项目名称:laravel-basic,代码行数:7,代码来源:IslandsTest.php

示例13: setUp

 /**
  * SetUp Method which is called before a test method is called
  *
  */
 public function setUp()
 {
     if (function_exists('app')) {
         $laravel = app();
         $version = substr($laravel::VERSION, 0, 1);
         if (is_int(intval($version))) {
             $this->laravelVersion = intval($version);
         } else {
             $this->laravelVersion = 4;
         }
     } else {
         $this->laravelVersion = 4;
     }
     parent::setUp();
     // Refresh the application and reset Cron
     $this->refreshApplication();
     Cron::reset();
     // Set the default configuration values to the Laravel \Config object
     $this->setDefaultConfigValues();
     // Migrate all database tables
     if ($this->laravelVersion >= 5) {
         \Artisan::call('migrate', array('--path' => 'vendor/liebig/cron/src/migrations'));
     } else {
         \Artisan::call('migrate', array('--package' => 'liebig/cron'));
     }
     // Set the path to logfile to the laravel storage / logs / directory as test.txt file
     // NOTE: THIS FILE HAS TO BE DELETED EACH TIME AFTER THE UNIT TEST WAS STARTED
     $this->pathToLogfile = storage_path() . '/logs/test.txt';
 }
开发者ID:hilltool,项目名称:cron,代码行数:33,代码来源:CronTest.php

示例14: setUp

 /**
  * Set up test env
  *
  * @return void
  * @author Dan Cox
  */
 public function setUp()
 {
     parent::setUp();
     $this->app->add(new SkeletonDeploy());
     $this->command = $this->app->find('skeleton:deploy');
     $this->fs = m::mock('filesystem');
 }
开发者ID:danzabar,项目名称:alice,代码行数:13,代码来源:SkeletonDeployTest.php

示例15: setUp

 public function setUp()
 {
     parent::setUp();
     $this->withoutMiddleware();
     $this->withoutEvents();
     factory(\Yab\Quarx\Models\Page::class)->create();
 }
开发者ID:YABhq,项目名称:Quarx,代码行数:7,代码来源:PagesTest.php


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