public function testReturnEmptyParamValue() { $request = m::mock(Request::class); $request->shouldReceive('route')->once()->with()->andReturn([0 => 1, 1 => [], 2 => []]); $this->app->instance('request', $request); $this->assertNull(RouteHelper::parameter('foo')); }
/** * Get the account from routing * * @return Account|null */ private function getAccountFromRouting() { //Get account uuid from route $accountUuid = RouteHelper::parameter('account'); //If we have account id, return the account from uuid if (!empty($accountUuid)) { return $this->accountRepository->findByUuid($accountUuid); } //Get account slug from route $accountSlug = RouteHelper::parameter('accountSlug'); //If we have account slug, return the account from the slug if (!empty($accountSlug)) { return $this->accountRepository->findBySlug($accountSlug); } return null; }