Пример #1
0
 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);
 }
 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());
 }
Пример #3
0
 protected function setUp()
 {
     parent::setUp();
     /** @var Mailer $mailer */
     $mailer = Yii::$app->mailer;
     $mailer->fileTransportCallback = function () {
         return 'testing_message.eml';
     };
 }
 protected function tearDown()
 {
     parent::tearDown();
 }
Пример #5
0
 protected function setUp()
 {
     parent::setUp();
     Yii::$app->cache->flush();
 }
Пример #6
0
 public function tearDown()
 {
     Yii::$app->getDb()->close();
     parent::tearDown();
 }
 protected function tearDown()
 {
     StandAloneModel::deleteAll();
     parent::tearDown();
 }
 protected function tearDown()
 {
     $this->model->delete();
     parent::tearDown();
 }
Пример #9
0
 protected function tearDown()
 {
     Yii::$app->user->logout();
     parent::tearDown();
 }
 public function setUp()
 {
     parent::setUp();
     $this->event = DomainEvent::wrap('Cat', 'Tiger', new ModelEvent());
 }
Пример #11
0
 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']]);
 }
 protected function tearDown()
 {
     @unlink($this->getMessageFile());
     parent::tearDown();
 }
Пример #13
0
 protected function setup()
 {
     $this->_fixturesDef = ['items' => ItemFixture04::className()];
     parent::setUp();
     Yii::$app->set('workflowFactory', ['class' => 'fproject\\workflow\\core\\ArrayWorkflowItemFactory', 'workflowSourceNamespace' => 'tests\\codeception\\unit\\models']);
 }
Пример #14
0
 protected function setup()
 {
     parent::setUp();
     Yii::$app->set('workflowFactory', ['class' => 'fproject\\workflow\\core\\ArrayWorkflowItemFactory', 'workflowSourceNamespace' => 'tests\\codeception\\unit\\models']);
 }
 protected function tearDown()
 {
     EventRecord::deleteAll();
     Yii::$app->user->logout();
     parent::tearDown();
 }