当前位置: 首页>>代码示例>>PHP>>正文


PHP UnitTester::grabRecord方法代码示例

本文整理汇总了PHP中UnitTester::grabRecord方法的典型用法代码示例。如果您正苦于以下问题:PHP UnitTester::grabRecord方法的具体用法?PHP UnitTester::grabRecord怎么用?PHP UnitTester::grabRecord使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UnitTester的用法示例。


在下文中一共展示了UnitTester::grabRecord方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testForumDelete

 public function testForumDelete()
 {
     $this->create();
     $before = $this->tester->grabRecord('forums', ['name' => 'B']);
     Forum::where('name', 'A')->delete();
     $after = $this->tester->grabRecord('forums', ['name' => 'B']);
     $this->assertEquals($before->order - 1, $after->order);
 }
开发者ID:furious-programming,项目名称:coyote,代码行数:8,代码来源:ForumTest.php

示例2: testAlertDelete

 public function testAlertDelete()
 {
     $alert = $this->create();
     $alert->delete();
     $user = $this->tester->grabRecord('users', ['id' => $this->user->id]);
     $this->assertEquals(0, $user->alerts);
     $this->assertEquals(0, $user->alerts_unread);
     $this->tester->dontSeeRecord('alerts', ['object_id' => $alert->object_id]);
 }
开发者ID:furious-programming,项目名称:coyote,代码行数:9,代码来源:AlertTest.php

示例3: testPrivateMessageDelete

 public function testPrivateMessageDelete()
 {
     $pm = $this->create();
     $pm->delete();
     $user = $this->tester->grabRecord('users', ['id' => $this->user->id]);
     $this->assertEquals(0, $user->pm);
     $this->assertEquals(0, $user->pm_unread);
     // jeden rekord powinien byc w bazie danych...
     $this->tester->seeRecord('pm', ['root_id' => $pm->root_id]);
 }
开发者ID:furious-programming,项目名称:coyote,代码行数:10,代码来源:PmTest.php

示例4: testAssignUserToNewGroup

 public function testAssignUserToNewGroup()
 {
     $this->testCreationNewGroup();
     $user = User::first();
     $group = $this->tester->grabRecord('groups', ['name' => 'Grupa AA']);
     DB::table('group_users')->insert(['user_id' => $user->id, 'group_id' => $group->id]);
     $this->testCreationNewPermission();
     $permission = $this->tester->grabRecord('permissions', ['name' => 'do-smth']);
     $this->tester->seeRecord('group_permissions', ['group_id' => $group->id, 'permission_id' => $permission->id, 'value' => false]);
 }
开发者ID:furious-programming,项目名称:coyote,代码行数:10,代码来源:PermissionTest.php

示例5: testTopicMove

 public function testTopicMove()
 {
     $fake = Factory::create();
     $topic = $this->create();
     $this->assertEquals(1, $this->tester->grabRecord('forums', ['id' => $this->forum->id])->topics);
     $newForum = Forum::create(['name' => $fake->name, 'path' => $fake->name, 'description' => 'Lorem ipsum']);
     $topic->forum_id = $newForum->id;
     $topic->save();
     $this->assertEquals(1, $this->tester->grabRecord('forums', ['id' => $newForum->id])->topics);
     $this->tester->dontSeeRecord('posts', ['forum_id' => $this->forum->id]);
 }
开发者ID:furious-programming,项目名称:coyote,代码行数:11,代码来源:TopicTest.php

示例6: testGetDocuments

 public function testGetDocuments()
 {
     Document::deleteAll();
     $this->specify("Attachment must be exist", function () {
         $numberId = $this->tester->haveRecord(Number::className(), ['number' => '9999999999']);
         $model = $this->tester->grabRecord(Number::className(), ['_id' => $numberId]);
         $model->attachDocument(\Yii::getAlias('@data') . '/file1.jpg');
         $model->attachDocument(\Yii::getAlias('@data') . '/file2.pdf');
         expect(count($model->documents))->equals(2);
         foreach ($model->documents as $document) {
             expect($document instanceof Document)->true();
             expect($document->ownerId)->equals($model->getPrimaryKey());
         }
     });
 }
开发者ID:shubnikofff,项目名称:mobiles,代码行数:15,代码来源:NumberTest.php


注:本文中的UnitTester::grabRecord方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。