Skip to content

Commit

Permalink
Use \SebastianBergmann\Environment\Runtime->isHHVM()
Browse files Browse the repository at this point in the history
  • Loading branch information
dshafik committed Feb 3, 2016
1 parent f0ea8a8 commit 743bc7f
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion tests/MySqlShimTest.php
Expand Up @@ -17,6 +17,13 @@ class MySqlShimTest extends \PHPUnit_Framework_TestCase
static $container;
static $bin = [];

protected $runtime;

public function __construct()
{
$this->runtime = new \SebastianBergmann\Environment\Runtime();
}

public function test_mysql_connect()
{
$mysql = mysql_connect(static::$host, 'root');
Expand Down Expand Up @@ -286,6 +293,9 @@ public function test_mysql_list_tables()
}
}

/**
* @requires PHP
*/
public function test_mysql_list_tables_fail()
{
$this->skipForHHVM();
Expand Down Expand Up @@ -1031,7 +1041,7 @@ protected function assertConnection($mysql)

protected function skipForHHVM($condition = true)
{
if (defined('HHVM_VERSION') && $condition) {
if ($this->runtime->isHHVM() && $condition) {
$this->markTestSkipped("HHVM Behavior differs from PHP");
}
}
Expand Down

0 comments on commit 743bc7f

Please sign in to comment.