本文整理汇总了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");
}
示例2: setUp
public function setUp()
{
parent::setUp();
// Don't forget this!
$this->faker = Faker\Factory::create();
//$this->prepareForTests();
}
示例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]);
}
示例4: setUp
public function setUp()
{
parent::setUp();
Artisan::call('migrate');
Artisan::call('db:seed');
Session::start();
}
示例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';
}
示例6: setUp
function setUp()
{
parent::setUp();
$this->messenger = new Messenger('random_access_token');
$this->message = new Message('Some title');
$this->recipient = 123456789;
}
示例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();
}
示例8: setUp
public function setUp()
{
$this->createApplication();
parent::setUp();
$this->mockHtmldom = $this->mock('App\\Libros\\Htmldom');
$this->reviews = App::make('App\\Libros\\Reviews');
}
示例9: setUp
public function setUp()
{
parent::setUp();
Artisan::call('migrate');
Artisan::call('db:seed', array('--class' => 'Day007_TodosTableSeeder'));
$this->test = new Todo();
}
示例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();
}
示例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);
}
示例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';
}
示例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');
}
示例15: setUp
public function setUp()
{
parent::setUp();
$this->withoutMiddleware();
$this->withoutEvents();
factory(\Yab\Quarx\Models\Page::class)->create();
}