1 | <?php |
||
13 | class BasePhantomJSDriver extends CoreDriver { |
||
14 | |||
15 | /** @var Browser */ |
||
16 | protected $browser; |
||
17 | /** @var string */ |
||
18 | protected $phantomHost; |
||
19 | /** @var \Twig_Loader_Filesystem */ |
||
20 | protected $templateLoader; |
||
21 | /** @var \Twig_Environment */ |
||
22 | protected $templateEnv; |
||
23 | |||
24 | /** |
||
25 | * Instantiates the driver |
||
26 | * @param string $phantomHost browser "api" oriented host |
||
27 | * @param string $templateCache where we are going to store the templates cache |
||
28 | */ |
||
29 | public function __construct($phantomHost, $templateCache = null) { |
||
35 | |||
36 | /** |
||
37 | * Sets up the cache template location for the scripts we are going to create with the driver |
||
38 | * @param $templateCache |
||
39 | * @return string |
||
40 | * @throws DriverException |
||
41 | */ |
||
42 | protected function templateCacheSetup($templateCache) { |
||
56 | |||
57 | /** |
||
58 | * Helper to find a node element given an xpath |
||
59 | * @param string $xpath |
||
60 | * @param int $max |
||
61 | * @returns int |
||
62 | * @throws DriverException |
||
63 | */ |
||
64 | protected function findElement($xpath, $max = 1) { |
||
71 | |||
72 | /** |
||
73 | * @return Browser |
||
74 | */ |
||
75 | public function getBrowser() { |
||
78 | |||
79 | /** |
||
80 | * @return \Twig_Environment |
||
81 | */ |
||
82 | public function getTemplateEnv() { |
||
85 | |||
86 | /** |
||
87 | * Returns a javascript script via twig template engine |
||
88 | * @param $templateName |
||
89 | * @param $viewData |
||
90 | * @return string |
||
91 | */ |
||
92 | public function javascriptTemplateRender($templateName, $viewData) { |
||
97 | |||
98 | } |
||
99 |