本文整理汇总了PHP中UnitTester::seeInCollection方法的典型用法代码示例。如果您正苦于以下问题:PHP UnitTester::seeInCollection方法的具体用法?PHP UnitTester::seeInCollection怎么用?PHP UnitTester::seeInCollection使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UnitTester
的用法示例。
在下文中一共展示了UnitTester::seeInCollection方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testBeforeSave
public function testBeforeSave()
{
$this->specify("ownerId must be set before save number", function ($ownerFixture) {
/** @var $owner Employee */
$owner = $this->employees($ownerFixture);
$model = new Number(['scenario' => 'create']);
$model->number = '1234567890';
$model->ownerName = $owner->fullName;
$model->ownerPost = $owner->post;
$model->operatorId = $this->operators('operator1')->getPrimaryKey();
$model->save();
$this->tester->seeInCollection($model::collectionName(), ['number' => '1234567890', 'ownerId' => $owner->getPrimaryKey()]);
Number::deleteAll(['number' => '1234567890']);
}, ['examples' => [['employee1'], ['employee4']]]);
$this->specify("ownerId must be null if ownerName is empty string", function () {
$model = $this->numbers('number1');
/** @var $model Number */
$model->setScenario('update');
$model->ownerName = "";
$model->save();
$this->tester->seeInCollection($model::collectionName(), ['number' => $model['number'], 'ownerId' => null]);
});
}