1 | <?php |
||
24 | class BrowserStackBrowserConfiguration extends ApiBrowserConfiguration |
||
25 | { |
||
26 | const TYPE = 'browserstack'; |
||
27 | |||
28 | /** |
||
29 | * Returns API class for service interaction. |
||
30 | * |
||
31 | * @return IAPIClient |
||
32 | */ |
||
33 | 1 | public function getAPIClient() |
|
41 | |||
42 | /** |
||
43 | * Hook, called from "BrowserTestCase::setUp" method. |
||
44 | * |
||
45 | * @param TestEvent $event Test event. |
||
46 | * |
||
47 | * @return void |
||
48 | */ |
||
49 | 8 | public function onTestSetup(TestEvent $event) |
|
50 | { |
||
51 | 8 | if ( !$event->validateSubscriber($this->getTestCase()) ) { |
|
52 | return; |
||
53 | } |
||
54 | |||
55 | 8 | parent::onTestSetup($event); |
|
56 | |||
57 | 8 | $desired_capabilities = $this->getDesiredCapabilities(); |
|
58 | |||
59 | 8 | if ( getenv('PHPUNIT_MINK_TUNNEL_ID') ) { |
|
60 | 1 | $desired_capabilities['browserstack.local'] = 'true'; |
|
61 | 1 | $desired_capabilities['browserstack.localIdentifier'] = getenv('PHPUNIT_MINK_TUNNEL_ID'); |
|
62 | 1 | } |
|
63 | |||
64 | 8 | $this->setDesiredCapabilities($desired_capabilities); |
|
65 | 8 | } |
|
66 | |||
67 | /** |
||
68 | * Returns hostname from browser configuration. |
||
69 | * |
||
70 | * @return string |
||
71 | */ |
||
72 | 7 | public function getHost() |
|
76 | |||
77 | /** |
||
78 | * Returns desired capabilities from browser configuration. |
||
79 | * |
||
80 | * @return array |
||
81 | * @link http://www.browserstack.com/automate/capabilities |
||
82 | */ |
||
83 | 11 | public function getDesiredCapabilities() |
|
98 | |||
99 | } |
||
100 |