本文整理汇总了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);
}
}