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


PHP UnitTester::haveRecord方法代码示例

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


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

示例1: testRoleCanBeDeleted

 public function testRoleCanBeDeleted()
 {
     $id = $this->tester->haveRecord('roles', ['role_name' => 'user']);
     $role = \ChopBox\Role::find($id);
     $role->delete();
     $this->tester->dontSeeRecord('roles', ['role_name' => 'user']);
 }
开发者ID:andela,项目名称:chopbox,代码行数:7,代码来源:RoleTest.php

示例2: createPlantWithColorForTest

 /**
  * @return mixed
  */
 public function createPlantWithColorForTest()
 {
     $plantID = $this->tester->haveRecord('plants', ['name' => 'test plant']);
     $colorArray = array("red" => "red", "yellow" => "yellow", "blue" => NULL, "green" => NULL, "brown" => NULL, "black" => NULL, "white" => NULL, "purple" => NULL, "orange" => NULL);
     $this->UUT->set($plantID, $colorArray);
     return $plantID;
 }
开发者ID:Opstrup,项目名称:naturens_spisekammer,代码行数:10,代码来源:colorHandlerTest.php

示例3: 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

示例4: createUser

 private function createUser()
 {
     $user_id = $this->tester->haveRecord('users', ['username' => 'johndoe', 'password' => 'password', 'email' => 'johndoe@johndoe.com', 'profile_state' => 0]);
     return $user_id;
 }
开发者ID:andela,项目名称:chopbox,代码行数:5,代码来源:UploadTest.php

示例5: createRole

 private function createRole()
 {
     $id = $this->tester->haveRecord('roles', ['role_name' => 'user']);
     return $id;
 }
开发者ID:andela,项目名称:chopbox,代码行数:5,代码来源:UserRoleTest.php

示例6: testCreationNewPermission

 public function testCreationNewPermission()
 {
     $this->tester->haveRecord('permissions', ['name' => 'do-smth', 'default' => false]);
 }
开发者ID:furious-programming,项目名称:coyote,代码行数:4,代码来源:PermissionTest.php


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