Ejemplo n.º 1
0
 public function __construct()
 {
     $kernel = new \AppKernel('test', true);
     $kernel->boot();
     $this->_container = $kernel->getContainer();
     parent::__construct();
 }
Ejemplo n.º 2
0
 public function __construct()
 {
     $this->auth_agency = '200100';
     $this->auth_secret = sha1('agency_200100_secret');
     $this->auth_pk = md5('agency_200100_public');
     parent::__construct();
 }
Ejemplo n.º 3
0
 /**
  * __construct function.
  * 
  * @access public
  * @param mixed $name (default: null)
  * @return void
  */
 public function __construct($name = null)
 {
     parent::__construct($name);
     static::$kernel = static::createKernel();
     static::$kernel->boot();
     static::$container = static::$kernel->getContainer();
 }
Ejemplo n.º 4
0
 public function __construct($name = NULL, array $data = [], $dataName = "")
 {
     parent::__construct($name, $data, $dataName);
     if (!static::$kernel) {
         static::$kernel = self::createKernel(['environment' => $this->enviroment, 'debug' => TRUE]);
         static::$kernel->boot();
     }
     $this->container = self::$kernel->getContainer();
 }
Ejemplo n.º 5
0
 /**
  * Constructor
  *
  * @param string|null $name     Test name
  * @param array       $data     Test data
  * @param string      $dataName Data name
  */
 public function __construct($name = null, array $data = array(), $dataName = '')
 {
     parent::__construct($name, $data, $dataName);
     if (!static::$kernel) {
         static::$kernel = self::createKernel(array('environment' => $this->environment, 'debug' => $this->debug));
         static::$kernel->boot();
     }
     $this->container = static::$kernel->getContainer();
     $this->em = $this->getEntityManager();
 }
Ejemplo n.º 6
0
 /**
  * Inject Guzzle in this test class
  * And set up the given client for use on
  * Damn Vulnerable Web Application... A vulnerable application
  * without API...
  * Difficulty resided in finding the way of using
  * cookies and correct documentation for all methods.
  */
 public function __construct()
 {
     parent::__construct();
     //prepare a cookie jar
     $jar = new ArrayCookieJar();
     $cookiePlugin = new CookiePlugin($jar);
     //get a guzzle instance
     $this->_dvwa_guzzle = new Client();
     $this->_dvwa_guzzle->setBaseUrl($this->DVWA_URL);
     $this->_dvwa_guzzle->setUserAgent("Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.109 Safari/537.36");
     $this->_dvwa_guzzle->addSubscriber($cookiePlugin);
     //first request/response exchange to get CSRF token
     $request = $this->_dvwa_guzzle->get('login.php', null, ["allow_redirects" => false]);
     $response = $request->send();
     $str = $response->getBody();
     preg_match($this->USER_TOKEN_REGEX, $str, $matches);
     $user_token = $matches[1];
     //second exchange to login
     $request = $this->_dvwa_guzzle->createRequest('POST', 'login.php', null, ['username' => 'admin', 'password' => 'password', 'Login' => 'Login', 'user_token' => $user_token], ["allow_redirects" => true]);
     $request->send();
 }
Ejemplo n.º 7
0
 public function __construct()
 {
     parent::__construct();
 }
Ejemplo n.º 8
0
 /**
  * Constructor
  *
  * @param string|null $name     Test name
  * @param array       $data     Test data
  * @param string      $dataName Data name
  */
 public function __construct($name = null, array $data = array(), $dataName = '')
 {
     parent::__construct($name, $data, $dataName);
 }
Ejemplo n.º 9
0
 public function __construct($name = null, array $data = array(), $dataName = '')
 {
     parent::__construct($name, $data, $dataName);
     // seems like this can not be used outside of the constructor...
     $this->dslDir = __DIR__ . '/../dsl';
 }