本文整理匯總了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]);
});
}