protected function setUp()
 {
     parent::setUp();
     Yii::$app->mailer->fileTransportCallback = function ($mailer, $message) {
         return 'testing_message.eml';
     };
 }
Beispiel #2
0
 public function setUp()
 {
     parent::setUp();
     /* @var $doctrine \common\components\doctrine\DoctrineComponent */
     $doctrine = \Yii::$app->get('doctrine');
     $this->em = $doctrine->getEntityManager();
 }
Beispiel #3
0
 protected function setUp()
 {
     parent::setUp();
     file_put_contents(__DIR__ . '/../fixtures/data/.env', "test=test\ntestTrue=true\ntestFalse=false\ntestNull=null\ntestEmpty");
     $dotenv = new Dotenv(__DIR__ . '/../fixtures/data/');
     $dotenv->load();
 }
 protected function setup()
 {
     parent::setUp();
     Yii::$app->set('workflowSource', ['class' => 'raoul2000\\workflow\\source\\file\\WorkflowFileSource', 'definitionLoader' => ['class' => 'raoul2000\\workflow\\source\\file\\PhpClassLoader', 'namespace' => 'tests\\codeception\\unit\\models']]);
     Yii::$app->set('status_accessor', ['class' => 'tests\\codeception\\unit\\models\\StatusAccessor07']);
     $this->statusAccessor = Yii::$app->get('status_accessor');
     $this->statusAccessor->resetCallCounters();
     StatusAccessor07::$instanceCount = 1;
 }
Beispiel #5
0
 protected function setUp()
 {
     parent::setUp();
     /** @var Mailer $mailer */
     $mailer = Yii::$app->mailer;
     $mailer->fileTransportCallback = function () {
         return 'testing_message.eml';
     };
 }
 protected function setup()
 {
     parent::setUp();
     Yii::$app->set('workflowFactory', ['class' => 'fproject\\workflow\\core\\ArrayWorkflowItemFactory', 'workflowSourceNamespace' => 'tests\\codeception\\unit\\models']);
     Yii::$app->set('status_accessor', ['class' => 'tests\\codeception\\unit\\models\\StatusAccessor07']);
     $this->statusAccessor = Yii::$app->get('status_accessor');
     $this->statusAccessor->resetCallCounters();
     StatusAccessor07::$instanceCount = 1;
 }
 /** @inheritdoc */
 protected function setUp()
 {
     parent::setUp();
     $model = $model = new FakeNewsModel();
     $model->name = 'News 1';
     $model->file = ['src' => '/images/file.pdf'];
     $model->images = [['src' => '/images/image1.png'], ['src' => '/images/image2.png']];
     $model->save();
     $this->model = $model;
 }
 protected function setup()
 {
     parent::setUp();
     $this->eventsBefore = [];
     $this->eventsAfter = [];
     Yii::$app->set('workflowFactory', ['class' => 'fproject\\workflow\\core\\ArrayWorkflowItemFactory', 'workflowSourceNamespace' => 'tests\\codeception\\unit\\models']);
     Yii::$app->set('eventSequence', ['class' => 'fproject\\workflow\\events\\ReducedEventSequence']);
     $this->model = new Item04();
     $this->model->attachBehavior('workflow', ['class' => ActiveWorkflowBehavior::className()]);
 }
 protected function setup()
 {
     parent::setUp();
     $this->eventsBefore = [];
     $this->eventsAfter = [];
     Yii::$app->set('workflowSource', ['class' => 'raoul2000\\workflow\\source\\file\\WorkflowFileSource', 'definitionLoader' => ['class' => 'raoul2000\\workflow\\source\\file\\PhpClassLoader', 'namespace' => 'tests\\codeception\\unit\\models']]);
     Yii::$app->set('eventSequence', ['class' => 'raoul2000\\workflow\\events\\ReducedEventSequence']);
     $this->model = new Item04();
     $this->model->attachBehavior('workflow', ['class' => SimpleWorkflowBehavior::className()]);
 }
Beispiel #10
0
 protected function setUp()
 {
     parent::setUp();
     $config = ArrayHelper::merge(require Yii::getAlias($this->appConfig), ['components' => ['db' => ['class' => '\\yii\\db\\Connection', 'dsn' => 'sqlite::memory:']], 'modules' => ['jumper423Store' => ['class' => 'jumper423\\yii2images\\Module']]]);
     $this->mockApplication($config);
     $columns = ['id' => 'pk', 'name' => 'string'];
     Yii::$app->getDb()->createCommand()->createTable('test_image_behavior', $columns)->execute();
     $columns = ['id' => 'pk', 'filePath' => 'VARCHAR(400) NOT NULL', 'itemId' => 'int(20) NOT NULL', 'isMain' => 'int(1)', 'modelName' => 'VARCHAR(150) NOT NULL', 'urlAlias' => 'VARCHAR(400) NOT NULL'];
     Yii::$app->getDb()->createCommand()->createTable('image', $columns)->execute();
     /*vfsStream::setup('root');
       vfsStream::setup('root/Cache');*/
     $module = Yii::$app->getModule('jumper423Store');
     //$module->imagesStorePath = vfsStream::url('root/Store');
     //$module->imagesCachePath = vfsStream::url('root/Cache');
     $module->imagesStorePath = Yii::getAlias('@app') . '/tests/unit/data/imgStore';
     $module->imagesCachePath = Yii::getAlias('@app') . '/tests/unit/data/imgCache';
     $this->model = new ActiveRecordImage();
     $this->model->name = 'testName';
     $this->model->save();
 }
Beispiel #11
0
 protected function setUp()
 {
     parent::setUp();
     $this->src = new WorkflowFileSource();
 }
Beispiel #12
0
 protected function setUp()
 {
     parent::setUp();
     $this->redis = \Yii::$app->bandit->getConnection();
 }
Beispiel #13
0
 protected function setUp()
 {
     parent::setUp();
     $this->src = new ArrayWorkflowItemFactory();
 }
 protected function setUp()
 {
     parent::setUp();
     Yii::$app->set('parser', ['class' => MinimalArrayParser::className()]);
     $this->src = new WorkflowFileSource();
 }
 protected function setUp()
 {
     Config::clearMap();
     parent::setUp();
 }
 protected function setUp()
 {
     parent::setUp();
     $this->model = new DynamicModel(['number']);
     $this->model->addRule('number', MobileNumberValidator::className());
 }
Beispiel #17
0
 protected function setup()
 {
     parent::setUp();
     Item01::deleteAll();
     Yii::$app->set('workflowFactory', ['class' => 'fproject\\workflow\\core\\ArrayWorkflowItemFactory', 'workflowSourceNamespace' => 'tests\\codeception\\unit\\models']);
 }
 public function setUp()
 {
     parent::setUp();
     $this->manager = new ModelManager();
 }
 protected function setUp()
 {
     parent::setUp();
     $user = User::findByUsername('admin');
     \Yii::$app->user->login($user);
 }
 protected function setUp()
 {
     parent::setUp();
     Yii::$app->set('deserializer', ['class' => SimpleArrayDeserializer::className()]);
     $this->factory = new ArrayWorkflowItemFactory(['deserializer' => 'deserializer']);
 }
 protected function setup()
 {
     parent::setUp();
     Yii::$app->set('wfIdAccessor', ['class' => 'tests\\codeception\\unit\\models\\IdAccessor09']);
 }
Beispiel #22
0
 public function setUp()
 {
     parent::setUp();
     $this->model = new LoginForm(['scenario' => LoginForm::SCENARIO_DEFAULT]);
 }
Beispiel #23
0
 public function setUp()
 {
     parent::setUp();
     $module = new Module(1);
 }
 protected function setUp()
 {
     $this->_fixturesDef = ['items' => DynamicItemFixture::className()];
     parent::setUp();
     $this->factory = new ArrayWorkflowItemFactory();
 }
 public function setUp()
 {
     parent::setUp();
     $this->mockApplication();
     $this->schema = 'file://' . __DIR__ . '/../../../data/json_schemas/car.json';
 }
Beispiel #26
0
 protected function setUp()
 {
     parent::setUp();
 }
Beispiel #27
0
 protected function setUp()
 {
     parent::setUp();
     // uncomment the following to load fixtures for user table
     //$this->loadFixtures(['user']);
 }
 protected function setup()
 {
     parent::setUp();
     Yii::$app->set('workflowSource', ['class' => 'raoul2000\\workflow\\source\\file\\WorkflowFileSource', 'definitionLoader' => ['class' => 'raoul2000\\workflow\\source\\file\\PhpClassLoader', 'namespace' => 'tests\\codeception\\unit\\models']]);
 }
 public function setUp()
 {
     parent::setUp();
     Yii::$app->cache->flush();
 }
 protected function setUp()
 {
     parent::setUp();
     $this->loadFixtures(['user']);
 }