protected function setUp() { parent::setUp(); $user1 = User::findOne(['id' => 1]); Yii::$app->user->setIdentity($user1); $post = new Post(); $post->message = "P1"; $post->content->container = Yii::$app->user->getIdentity(); $post->save(); $this->postWallEntryIds[] = $post->content->getFirstWallEntryId(); $post = new Post(); $post->message = "P2"; $post->content->container = Yii::$app->user->getIdentity(); $post->save(); $this->postWallEntryIds[] = $post->content->getFirstWallEntryId(); $post = new Post(); $post->message = "P3"; $post->content->container = Yii::$app->user->getIdentity(); $post->save(); $this->postWallEntryIds[] = $post->content->getFirstWallEntryId(); $post = new Post(); $post->message = "P4"; $post->content->container = Yii::$app->user->getIdentity(); $post->save(); $this->postWallEntryIds[] = $post->content->getFirstWallEntryId(); $this->postWallEntryIds = array_reverse($this->postWallEntryIds); }
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']]); }
public function setUp() { parent::setUp(); Yii::configure(Yii::$app, ['components' => ['eventStore' => ['class' => MySQLEventStore::class], 'user' => ['class' => User::class, 'identityClass' => MockUserIdentity::class]]]); $this->event = new DomainEvent(['modelId' => 'Pepper', 'modelType' => 'cat', 'payload' => new ModelEvent()]); Yii::$app->user->login(new MockUserIdentity()); }
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('workflowSource', ['class' => 'raoul2000\\workflow\\source\\file\\WorkflowFileSource', 'definitionLoader' => ['class' => 'raoul2000\\workflow\\source\\file\\PhpClassLoader', 'namespace' => 'tests\\codeception\\unit\\models']]); Item06Behavior::$maxPostCount = 2; Item06Behavior::$countPost = 0; Item06Behavior::$countPostToCorrect = 0; Item06Behavior::$countPostCorrected = 0; }
protected function setup() { parent::setUp(); Yii::$app->set('workflowFactory', ['class' => 'fproject\\workflow\\core\\ArrayWorkflowItemFactory', 'workflowSourceNamespace' => 'tests\\codeception\\unit\\models']); Item06Behavior::$maxPostCount = 2; Item06Behavior::$countPost = 0; Item06Behavior::$countPostToCorrect = 0; Item06Behavior::$countPostCorrected = 0; }
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()]); }
public function setUp() { parent::setUp(); EventRecord::deleteAll(); Yii::$container->setSingleton('meta', function ($container, $params, $config) { return ['k0' => 'v0', 'k1' => 'v1']; }); Yii::configure(Yii::$app, ['components' => ['user' => ['class' => User::class, 'identityClass' => MockUserIdentity::class]]]); Yii::$app->user->login(new MockUserIdentity()); }
public function setUp() { parent::setUp(); $config = ArrayHelper::merge(require Yii::getAlias($this->appConfig), ['components' => ['db' => ['class' => '\\yii\\db\\Connection', 'dsn' => 'sqlite::memory:']], 'modules' => ['yii2images' => ['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('yii2images'); $module->imagesStorePath = vfsStream::url('root/Store'); $module->imagesCachePath = vfsStream::url('root/Cache'); $this->model = new ActiveRecordImage(); $this->model->name = 'testName'; $this->model->save(); }
protected function setup() { parent::setUp(); Yii::$app->set('workflowFactory', ['class' => 'fproject\\workflow\\core\\ArrayWorkflowItemFactory', 'workflowSourceNamespace' => 'tests\\codeception\\unit\\models']); }
protected function setUp() { parent::setUp(); Yii::$app->cache->flush(); }
public function setUp() { parent::setUp(); Yii::configure(Yii::$app, ['components' => ['eventStore' => ['class' => MySQLEventStore::class], 'user' => ['class' => User::class, 'identityClass' => MockUserIdentity::class]]]); Yii::$app->user->login(new MockUserIdentity()); }
public function setUp() { parent::setUp(); $this->event = DomainEvent::wrap('Cat', 'Tiger', new ModelEvent()); }
protected function setup() { $this->_fixturesDef = ['items' => ItemFixture04::className()]; parent::setUp(); Yii::$app->set('workflowFactory', ['class' => 'fproject\\workflow\\core\\ArrayWorkflowItemFactory', 'workflowSourceNamespace' => 'tests\\codeception\\unit\\models']); }
protected function setUp() { parent::setUp(); }