public function __construct()
 {
     $application = new Application();
     $application->setConfigDir(dirname(__DIR__) . '/Config/');
     $this->mock = $this->getMockForTrait('Tiimber\\Traits\\RouteResolverTrait');
     $this->routes = Config::get('routes');
 }
Example #2
0
 public function render()
 {
     $routes = Config::get('routes');
     $route = $routes->get($this->key, (object) ['route' => ''])->route;
     $route = explode('::', $route);
     $route = end($route);
     return $this->hydrateRoute($route);
 }
Example #3
0
 /**
  * Slugify text by removing non ASCII carac
  *
  * @param $text String to slugify
  * @return Sting
  */
 public static function bcrypt(string $password) : string
 {
     return password_hash($password, PASSWORD_BCRYPT, ['salt' => Config::get('security', new ParameterBag())->get('salt', null)]);
 }
Example #4
0
 public function testNonExistentConfig()
 {
     $this->assertTrue(Config::get('undefined', true));
     $this->assertNull(Config::get('undefined'));
 }