setUp() public method

public 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");
 }
Exemplo n.º 2
0
 public function setUp()
 {
     parent::setUp();
     // Don't forget this!
     $this->faker = Faker\Factory::create();
     //$this->prepareForTests();
 }
Exemplo n.º 3
0
 /**
  * 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]);
 }
 public function setUp()
 {
     parent::setUp();
     Artisan::call('migrate');
     Artisan::call('db:seed');
     Session::start();
 }
	/**
	 * 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';
	}
Exemplo n.º 6
0
 function setUp()
 {
     parent::setUp();
     $this->messenger = new Messenger('random_access_token');
     $this->message = new Message('Some title');
     $this->recipient = 123456789;
 }
 /**
  * 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();
 }
Exemplo n.º 8
0
 public function setUp()
 {
     $this->createApplication();
     parent::setUp();
     $this->mockHtmldom = $this->mock('App\\Libros\\Htmldom');
     $this->reviews = App::make('App\\Libros\\Reviews');
 }
Exemplo n.º 9
0
 public function setUp()
 {
     parent::setUp();
     Artisan::call('migrate');
     Artisan::call('db:seed', array('--class' => 'Day007_TodosTableSeeder'));
     $this->test = new Todo();
 }
Exemplo n.º 10
0
 /**
  * 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();
 }
 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');
 }
Exemplo n.º 12
0
	public function setUp()
	{
		parent::setUp();
        $this->mock = m::mock('Eloquent', 'Island');

		$this->app->instance('Island', $this->mock);
	}
Exemplo n.º 13
0
 /**
  * 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';
 }
Exemplo n.º 14
0
 /**
  * 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');
 }
Exemplo n.º 15
0
 public function setUp()
 {
     parent::setUp();
     $this->withoutMiddleware();
     $this->withoutEvents();
     factory(\Yab\Quarx\Models\Page::class)->create();
 }
Exemplo n.º 16
0
 protected function setUp()
 {
     parent::setUp();
     // login user
     self::loginHelper(self::TEST_ENCRYPTION_UTIL_USER1);
     \OC_User::setUserId(self::TEST_ENCRYPTION_UTIL_USER1);
     $this->userId = self::TEST_ENCRYPTION_UTIL_USER1;
     $this->pass = self::TEST_ENCRYPTION_UTIL_USER1;
     // set content for encrypting / decrypting in tests
     $this->dataUrl = __DIR__ . '/../lib/crypt.php';
     $this->dataShort = 'hats';
     $this->dataLong = file_get_contents(__DIR__ . '/../lib/crypt.php');
     $this->legacyData = __DIR__ . '/legacy-text.txt';
     $this->legacyEncryptedData = __DIR__ . '/legacy-encrypted-text.txt';
     $this->legacyEncryptedDataKey = __DIR__ . '/encryption.key';
     $this->legacyKey = "30943623843030686906";
     $keypair = \OCA\Files_Encryption\Crypt::createKeypair();
     $this->genPublicKey = $keypair['publicKey'];
     $this->genPrivateKey = $keypair['privateKey'];
     $this->publicKeyDir = \OCA\Files_Encryption\Keymanager::getPublicKeyPath();
     $this->encryptionDir = '/' . $this->userId . '/' . 'files_encryption';
     $this->keysPath = $this->encryptionDir . '/' . 'keys';
     $this->publicKeyPath = $this->publicKeyDir . '/' . $this->userId . '.publicKey';
     // e.g. data/public-keys/admin.publicKey
     $this->privateKeyPath = $this->encryptionDir . '/' . $this->userId . '.privateKey';
     // e.g. data/admin/admin.privateKey
     $this->view = new \OC\Files\View('/');
     $this->util = new \OCA\Files_Encryption\Util($this->view, $this->userId);
     // remember files_trashbin state
     $this->stateFilesTrashbin = \OC_App::isEnabled('files_trashbin');
     // we don't want to tests with app files_trashbin enabled
     \OC_App::disable('files_trashbin');
 }
Exemplo n.º 17
0
 /**
  * Setup the test environment.
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     // Use an in-memory DB
     $this->app['config']->set('database.default', 'csvSeederTest');
     $this->app['config']->set('database.connections.csvSeederTest', ['driver' => 'sqlite', 'database' => ':memory:', 'prefix' => '']);
 }
Exemplo n.º 18
0
 public function setUp()
 {
     parent::setUp();
     Route::enableFilters();
     $user = User::find(1);
     $this->be($user);
 }
Exemplo n.º 19
0
 /**
  * Set up test env
  *
  * @return void
  * @author Dan Cox
  */
 public function setUp()
 {
     parent::setUp();
     $this->app->add(new ProjectCreate());
     $this->command = $this->app->find('project:create');
     $this->config = m::mock('config');
 }
 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  *
  * @return  void
  */
 protected function setUp()
 {
     $this->saveFactoryState();
     JFactory::$application = $this->getMockCmsApp();
     JFactory::$config = $this->getMockConfig();
     parent::setUp();
 }
 public function setUp()
 {
     parent::setUp();
     $this->originalFile = __DIR__ . '/files/testimage.gif';
     $this->compressedFile = $temp_file = sys_get_temp_dir() . '/php_image_optimizer.gif';
     copy($this->originalFile, $this->compressedFile);
 }
Exemplo n.º 22
0
 public function setUp()
 {
     parent::setUp();
     // Register a worker to test with
     $this->worker = new Worker('jobs');
     $this->worker->registerWorker();
 }
 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  *
  * @access protected
  * @return void
  */
 protected function setUp()
 {
     parent::setUp();
     $this->options = new JRegistry();
     $this->uri = new JUri();
     $this->object = new JGoogleEmbedAnalytics($this->options, $this->uri);
 }
 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  *
  * @return void
  */
 protected function setUp()
 {
     parent::setUp();
     $this->checkAvailability();
     $this->saveFactoryState();
     JFactory::$application = $this->getMockCmsApp();
 }
Exemplo n.º 25
0
 /**
  * Called first.
  */
 public function setUp()
 {
     parent::setUp();
     $this->admin = factory(App\User::class, 'admin')->create();
     $this->user = factory(App\User::class)->create();
     $this->client = factory(App\Client::class)->create(['user_id' => $this->user->id]);
 }
 /**
  * Sets up the fixture.
  *
  * This method is called before a test is executed.
  *
  * @return void
  */
 protected function setUp()
 {
     parent::setUp();
     $this->dbo = $this->getMockDatabase();
     // Mock the escape method to ensure the API is calling the DBO's escape method.
     $this->assignMockCallbacks($this->dbo, array('escape' => array($this, 'getMockEscape')));
 }
Exemplo n.º 27
0
 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  */
 protected function setUp()
 {
     parent::setUp();
     $this->saveFactoryState();
     JFactory::$application = $this->getMockWeb();
     $this->object = new JDocumentFeed();
 }
Exemplo n.º 28
0
 public function setUp()
 {
     parent::setUp();
     $this->published_motion = factory(App\Motion::class, 'published')->create();
     $this->signIn();
     $this->user->addUserRoleByName('councillor');
 }
Exemplo n.º 29
0
 /**
  * Initial setup function for tests
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     Artisan::call('migrate');
     Artisan::call('db:seed');
     $this->setVariables();
 }
Exemplo n.º 30
0
 /**
  * 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()
 {
     parent::setUp();
     // We need to mock the application
     $this->saveFactoryState();
     JFactory::$application = $this->getMockCmsApp();
 }