本文整理匯總了PHP中Model\User::where方法的典型用法代碼示例。如果您正苦於以下問題:PHP User::where方法的具體用法?PHP User::where怎麽用?PHP User::where使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Model\User
的用法示例。
在下文中一共展示了User::where方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: _previewAdminVideo
protected function _previewAdminVideo($params)
{
$user = User::where(['name' => 'admin'])->first();
$this->be($user);
Session::start();
$response = $this->call('POST', '/admin/video', $params + ['_token' => csrf_token()]);
$result = json_decode($response->getContent());
$this->assertEquals(200, $response->getStatusCode());
$this->assertEquals(true, $result->result);
$this->assertNotEmpty($result->model->preview);
$getHeaders = @get_headers($result->model->preview);
$this->assertEquals(true, is_numeric(stripos($getHeaders[0], '200 OK')));
$this->assertNotEmpty(exif_imagetype($result->model->preview));
$response = $this->call('DELETE', '/admin/video/' . $result->model->id, ['_token' => csrf_token()]);
$result = json_decode($response->getContent());
$this->assertEquals(true, $result->result);
}
示例2: testUser2AdminSite
public function testUser2AdminSite()
{
$user = User::where(['name' => 'user1'])->first();
$this->be($user);
$this->_testGetAdmin(['assertRedirectedTo' => '/', 'getStatusCode' => 302]);
}
示例3: _simpleAdminControllerSoftDeletes
protected function _simpleAdminControllerSoftDeletes($controller, $storeParams = [], $ex = [])
{
$user = User::where(['name' => 'admin'])->first();
$this->be($user);
Session::start();
$this->_indexAction($controller);
if ($storeParams) {
$id = $this->_storeAction($controller, $storeParams, $ex);
$this->_showAction($id, $controller, $storeParams, $ex);
$this->_deleteAction($id, $controller);
$this->_showActionDeleted($id, $controller, $ex);
$this->_restoreAction($id, $controller);
$this->_showAction($id, $controller, $storeParams, $ex);
$this->_destroyAction($id, $controller);
$this->_showActionDeleted($id, $controller, $ex);
$id = $this->_storeAction($controller, $storeParams, $ex);
$this->_deleteAction($id, $controller);
$this->_destroyAction($id, $controller);
}
}