[TASK] Remove ext:dbal from installation steps
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Build / Configuration / Acceptance / Support / AcceptanceTester.php
1 <?php
2
3
4 /**
5 * Inherited Methods
6 * @method void wantToTest($text)
7 * @method void wantTo($text)
8 * @method void execute($callable)
9 * @method void expectTo($prediction)
10 * @method void expect($prediction)
11 * @method void amGoingTo($argumentation)
12 * @method void am($role)
13 * @method void lookForwardTo($achieveValue)
14 * @method void comment($description)
15 * @method \Codeception\Lib\Friend haveFriend($name, $actorClass = null)
16 *
17 * @SuppressWarnings(PHPMD)
18 */
19 class AcceptanceTester extends \Codeception\Actor
20 {
21 use _generated\AcceptanceTesterActions;
22
23 /**
24 * The session cookie that is used if the session is injected.
25 * This session must exist in the database fixture to get a logged in state.
26 *
27 * @var string
28 */
29 protected $sessionCookie = '';
30
31 /**
32 * Use the existing database session from the fixture by setting the backend user cookie
33 */
34 public function useExistingSession()
35 {
36 $I = $this;
37 $I->amOnPage('/typo3/index.php');
38
39 // @todo: There is a bug in PhantomJS where adding a cookie fails.
40 // This bug will be fixed in the next PhantomJS version but i also found
41 // this workaround. First reset / delete the cookie and than set it and catch
42 // the webdriver exception as the cookie has been set successful.
43 try {
44 $I->resetCookie('be_typo_user');
45 $I->setCookie('be_typo_user', $this->sessionCookie);
46 } catch (\Facebook\WebDriver\Exception\UnableToSetCookieException $e) {
47 }
48 try {
49 $I->resetCookie('be_lastLoginProvider');
50 $I->setCookie('be_lastLoginProvider', '1433416747');
51 } catch (\Facebook\WebDriver\Exception\UnableToSetCookieException $e) {
52 }
53
54 // reload the page to have a logged in backend
55 $I->amOnPage('/typo3/index.php');
56 }
57 }