本文整理汇总了PHP中Symfony\Bundle\FrameworkBundle\Client::getHistory方法的典型用法代码示例。如果您正苦于以下问题:PHP Client::getHistory方法的具体用法?PHP Client::getHistory怎么用?PHP Client::getHistory使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Symfony\Bundle\FrameworkBundle\Client
的用法示例。
在下文中一共展示了Client::getHistory方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testUploadThemeNoParentFolder
/**
* Test if we can upload a theme with a zip that contains only the files (not wrapped in a parent folder).
*
* @return void
*/
public function testUploadThemeNoParentFolder()
{
// Generate zip with no info.xml
$this->fileName = tempnam(sys_get_temp_dir(), 'Theme');
$filePath = $this->fileName . '.zip';
$baseName = self::THEME_NAME;
$archive = new ZipArchive();
$archive->open($filePath, ZipArchive::CREATE);
$archive->addFromString('info.xml', $this->getSampleInfoXmlContents($baseName));
$archive->close();
if (file_exists($archive->filename)) {
throw new FileNotFoundException('Could not create zip file with theme');
}
$this->submitThemeUploadForm();
// We should get a 200 and be redirected to the themes index page.
self::assertEquals(200, $this->client->getResponse()->getStatusCode());
self::assertContains(self::URL_THEMES_INDEX, $this->client->getHistory()->current()->getUri());
self::assertContains(self::THEME_NAME, $this->client->getResponse()->getContent());
}
示例2: runTroughStep5
/**
* @param \Symfony\Component\DomCrawler\Crawler $crawler
* @param \Symfony\Bundle\FrameworkBundle\Client $client
*
* @return mixed
*/
private function runTroughStep5($crawler, $client)
{
$form = $crawler->selectButton('Finish installation')->form();
$client->submit($form, array('install_login[email]' => 'test@test.com', 'install_login[password][first]' => 'password', 'install_login[password][second]' => 'password'));
$crawler = $client->followRedirect();
// we should be redirected to step 6
self::assertEquals(200, $client->getResponse()->getStatusCode());
self::assertStringEndsWith('/install/6', $client->getHistory()->current()->getUri());
self::assertGreaterThan(0, $crawler->filter('h2:contains("Installation complete")')->count());
return $crawler;
}
示例3: assertIs404
/**
* @param Client $client
*/
protected function assertIs404($client)
{
$client->followRedirect();
$this->assertEquals(404, $client->getResponse()->getStatusCode());
$this->assertStringEndsWith('404', $client->getHistory()->current()->getUri());
}
示例4: assertCurrentRoute
protected function assertCurrentRoute($route, $param = [])
{
$this->assertEquals($this->generateUrl($route, $param), $this->client->getHistory()->current()->getUri());
}
示例5: getHistory
/**
* Returns the History instance.
*
* @return History A History instance
*
* @api
*/
public function getHistory()
{
return $this->subject->getHistory();
}