public function setUp() { parent::setUp(); $this->call('POST', ApiResponse::$API_LIST['login'], array('data' => json_encode(array('fb_id' => '123456')))); $login = Login::all()->last(); $this->_params['session_id'] = $login->session_id; $this->client->restart(); }
public function testLoginByFacebookNewUserSuccess() { $_params = $this->_params; $_params['fb_id'] = '1234567'; $response = $this->_getResponse($_params); $login_infor = Login::all()->last(); $this->assertNotNull($login_infor); $this->assertEquals(json_encode(array("code" => ApiResponse::OK, "data" => array("session" => $login_infor->session_id, "user_id" => $login_infor->user_id, "new_user" => true))), $response->getContent()); }
/** * Display a listing of the resource. * * @return Response */ public function LogIn() { $un = Input::get('username'); $pw = Input::get('password'); $chk1 = Login::where('strUsername', '=', Input::get('username'))->first(); $chk2 = Login::where('strPassword', '=', Input::get('password'))->first(); if ($chk1 && $chk2) { Session::put('username', '$un'); $id = Login::all(); //dashboard(danger stocks) $index = DB::table('tblInventory')->join('tblProducts', function ($join) { $join->on('tblInventory.strProdID', '=', 'tblProducts.strProdID')->where('tblInventory.intAvailQty', '<=', '10'); })->get(); return View::make('index')->with('id', $id)->with('index', $index); } else { return Redirect::to('/')->with('message', 'Login Failed, USERNAME/PASSWORD Dont Exists'); } }
function push_test($f3, $params) { $message = array('message' => 'Test Custom Push', 'post_id' => 12345, 'post_from' => 54321); $logins = Login::all(); //$logins = Login::where('push_type', 1)->get(); //echo json_encode($logins); $rids = []; foreach ($logins as $login) { $rids[] = $login->push_token; } // sendGCMMessage($devices, $message); echo json_encode($rids); //sendAPNMessage($rids, $message); sendPush($logins, $message); }