本文整理汇总了PHP中Symfony\Bundle\FrameworkBundle\Test\WebTestCase::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP WebTestCase::__construct方法的具体用法?PHP WebTestCase::__construct怎么用?PHP WebTestCase::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Symfony\Bundle\FrameworkBundle\Test\WebTestCase
的用法示例。
在下文中一共展示了WebTestCase::__construct方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct()
{
$kernel = new \AppKernel('test', true);
$kernel->boot();
$this->_container = $kernel->getContainer();
parent::__construct();
}
示例2: __construct
public function __construct()
{
$this->auth_agency = '200100';
$this->auth_secret = sha1('agency_200100_secret');
$this->auth_pk = md5('agency_200100_public');
parent::__construct();
}
示例3: __construct
/**
* __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();
}
示例4: __construct
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();
}
示例5: __construct
/**
* 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();
}
示例6: __construct
/**
* 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();
}
示例7: __construct
public function __construct()
{
parent::__construct();
}
示例8: __construct
/**
* 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);
}
示例9: __construct
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';
}