1 | <?php |
||
14 | class BasePhantomJSDriver extends CoreDriver { |
||
15 | |||
16 | /** @var Session */ |
||
17 | protected $session; |
||
18 | /** @var Browser */ |
||
19 | protected $browser; |
||
20 | /** @var string */ |
||
21 | protected $phantomHost; |
||
22 | /** @var \Twig_Loader_Filesystem */ |
||
23 | protected $templateLoader; |
||
24 | /** @var \Twig_Environment */ |
||
25 | protected $templateEnv; |
||
26 | |||
27 | /** |
||
28 | * Instantiates the driver |
||
29 | * @param string $phantomHost browser "api" oriented host |
||
30 | * @param string $templateCache where we are going to store the templates cache |
||
31 | */ |
||
32 | public function __construct($phantomHost, $templateCache = null) { |
||
38 | |||
39 | /** |
||
40 | * Sets up the cache template location for the scripts we are going to create with the driver |
||
41 | * @param $templateCache |
||
42 | * @return string |
||
43 | * @throws DriverException |
||
44 | */ |
||
45 | protected function templateCacheSetup($templateCache) { |
||
59 | |||
60 | /** |
||
61 | * Helper to find a node element given an xpath |
||
62 | * @param string $xpath |
||
63 | * @param int $max |
||
64 | * @returns int |
||
65 | * @throws DriverException |
||
66 | */ |
||
67 | protected function findElement($xpath, $max = 1) { |
||
74 | |||
75 | /** |
||
76 | * @return Browser |
||
77 | */ |
||
78 | public function getBrowser() { |
||
81 | |||
82 | /** |
||
83 | * @return \Twig_Environment |
||
84 | */ |
||
85 | public function getTemplateEnv() { |
||
88 | |||
89 | /** |
||
90 | * Returns a javascript script via twig template engine |
||
91 | * @param $templateName |
||
92 | * @param $viewData |
||
93 | * @return string |
||
94 | */ |
||
95 | public function javascriptTemplateRender($templateName, $viewData) { |
||
100 | |||
101 | } |
||
102 |