Aims. We study energetic particle transport in the solar corona in the presence of magnetic fluctuations by analyzing the motion of protons injected at the center of a model coronal loop. Methods. We set up a numerical realization of magnetic turbulence, in which the magnetic fluctuations are represented by a Fourier expansion with random phases. We perform test particle simulations by varying the turbulence correlation length., the turbulence level, and the proton energy. Coulomb collisions are neglected. Results. For large lambda, the ratio rho/lambda (with rho the Larmor radius) is small, and the magnetic moment is conserved. In this case, a fraction of the injected protons, which grow with the fluctuation level, are trapped at the top of the magnetic loop, near the injection region, by magnetic mirroring due to the magnetic fluctuations. The rest of the protons propagate freely along B, corresponding to nearly ballistic transport. Decreasing lambda, that is, increasing the ratio rho/lambda, the magnetic moment is no longer well conserved, and pitch angle diffusion progressively sets in. Pitch angle diffusion leads to a decrease in the trapped population and progressively changes proton transport from ballistic to superdiffusive, and finally, for small lambda, to diffusive. Conclusions. Particle mirroring by magnetic turbulence makes for compact trapping regions. The particle dynamics inside the magnetic loop is non-Gaussian and the statistical description of transport properties requires the use of such ideas as the Levy random walk.