38c561ab6de44145adb8de54553097f10f4b9de4
[yaffs-website] / vendor / jcalderonzumba / mink-phantomjs-driver / tests / integration / PhantomJSConfig.php
1 <?php
2
3 namespace Behat\Mink\Tests\Driver;
4
5 use Zumba\Mink\Driver\PhantomJSDriver;
6
7 /**
8  * Class PhantomJSConfig
9  * @package Behat\Mink\Tests\Driver
10  */
11 class PhantomJSConfig extends AbstractConfig {
12
13   /**
14    * @return PhantomJSConfig
15    */
16   public static function getInstance() {
17     return new self();
18   }
19
20   /**
21    * @return bool
22    */
23   protected function supportsCss() {
24     return true;
25   }
26
27   /**
28    * @return bool
29    */
30   protected function supportsJs() {
31     return true;
32   }
33
34   /**
35    * {@inheritdoc}
36    */
37   public function createDriver() {
38     $phantomJSHost = $_SERVER["DRIVER_URL"];
39     return new PhantomJSDriver($phantomJSHost, $_SERVER["TEMPLATE_CACHE_DIR"]);
40   }
41
42   /**
43    * @param string $testCase
44    * @param string $test
45    * @return string
46    */
47   public function skipMessage($testCase, $test) {
48     if ($testCase == "Behat\\Mink\\Tests\\Driver\\Basic\\BasicAuthTest" && $test == "testSetBasicAuth") {
49       //TODO: Fix this error
50       return "TODO: figure out why when sending a bad user is still giving the good login";
51     }
52
53     if ($testCase == "Behat\\Mink\\Tests\\Driver\\Form\\Html5Test" && $test == "testHtml5Types") {
54       //TODO: Fix this.
55       return "TODO: phantomjs does not seem to deal with the color type properly";
56     }
57
58     return parent::skipMessage($testCase, $test);
59   }
60
61 }