Skip to content

Commit

Permalink
Merge pull request #195 from mhujer/mh-drop-hhvm
Browse files Browse the repository at this point in the history
Drop remnants of HHVM from tests
  • Loading branch information
ramsey committed Nov 10, 2017
2 parents 68193f3 + 5acd3aa commit eeecd0f
Show file tree
Hide file tree
Showing 10 changed files with 7 additions and 66 deletions.
5 changes: 1 addition & 4 deletions tests/Generator/DefaultTimeGeneratorTest.php
Expand Up @@ -45,9 +45,7 @@ protected function tearDown()
$this->nodeProvider = null;
$this->timeConverter = null;
Mockery::close();
if (!self::isHhvm()) {
AspectMock::clean();
}
AspectMock::clean();
}

public function testGenerateUsesNodeProviderWhenNodeIsNull()
Expand Down Expand Up @@ -170,7 +168,6 @@ public function testGenerateUsesRandomSequenceWhenClockSeqNull()
{
$expectedBytes = hex2bin('0000000000001000a596122f80ca9e06');

$this->skipIfHhvm();
$mt_rand = AspectMock::func('Ramsey\Uuid\Generator', 'mt_rand', 9622);
$defaultTimeGenerator = new DefaultTimeGenerator(
$this->nodeProvider,
Expand Down
6 changes: 0 additions & 6 deletions tests/Generator/OpenSslGeneratorTest.php
Expand Up @@ -13,12 +13,6 @@
*/
class OpenSslGeneratorTest extends TestCase
{
protected function setUp()
{
$this->skipIfHhvm();
parent::setUp();
}

public function lengthAndHexDataProvider()
{
return [
Expand Down
6 changes: 0 additions & 6 deletions tests/Generator/PeclUuidTestCase.php
Expand Up @@ -8,10 +8,4 @@ class PeclUuidTestCase extends TestCase
{
protected $uuidString = 'b08c6fff-7dc5-e111-9b21-0800200c9a66';
protected $uuidBinary = '62303863366666662d376463352d653131312d396232312d303830303230306339613636';

protected function setUp()
{
$this->skipIfHhvm();
parent::setUp();
}
}
6 changes: 0 additions & 6 deletions tests/Generator/RandomBytesGeneratorTest.php
Expand Up @@ -13,12 +13,6 @@
*/
class RandomBytesGeneratorTest extends TestCase
{
protected function setUp()
{
$this->skipIfHhvm();
parent::setUp();
}

public function lengthAndHexDataProvider()
{
return [
Expand Down
6 changes: 0 additions & 6 deletions tests/Provider/Node/RandomNodeProviderTest.php
Expand Up @@ -8,12 +8,6 @@

class RandomNodeProviderTest extends TestCase
{
protected function setUp()
{
$this->skipIfHhvm();
parent::setUp();
}

protected function tearDown()
{
parent::tearDown();
Expand Down
2 changes: 0 additions & 2 deletions tests/Provider/Node/SystemNodeProviderTest.php
Expand Up @@ -134,8 +134,6 @@ public function osCommandDataProvider()
*/
public function testGetNodeGetsNetworkInterfaceConfig($os, $command, $filename)
{
$this->skipIfHhvm();

$commandOutput = file_get_contents(dirname(__FILE__) . '/' . $filename);

AspectMock::func('Ramsey\Uuid\Provider\Node', 'php_uname', $os);
Expand Down
1 change: 0 additions & 1 deletion tests/Provider/Time/SystemTimeProviderTest.php
Expand Up @@ -23,7 +23,6 @@ public function testCurrentTimeReturnsTimestampArray()
*/
public function testCurrentTimeUsesGettimeofday()
{
$this->skipIfHhvm();
$timestamp = ['sec' => 1458844556, 'usec' => 200997];
$func = AspectMock::func('Ramsey\Uuid\Provider\Time', 'gettimeofday', $timestamp);
$provider = new SystemTimeProvider();
Expand Down
16 changes: 1 addition & 15 deletions tests/TestCase.php
Expand Up @@ -10,9 +10,7 @@ class TestCase extends PHPUnitTestCase
protected function tearDown()
{
parent::tearDown();
if (!self::isHhvm()) {
AspectMock::clean();
}
AspectMock::clean();
Mockery::close();
}

Expand Down Expand Up @@ -75,16 +73,4 @@ public static function isLittleEndianSystem()
{
return current(unpack('v', pack('S', 0x00FF))) === 0x00FF;
}

protected function skipIfHhvm()
{
if (self::isHhvm()) {
$this->markTestSkipped('Skipping test that cannot run on HHVM');
}
}

protected static function isHhvm()
{
return defined('HHVM_VERSION');
}
}
12 changes: 5 additions & 7 deletions tests/bootstrap.php
Expand Up @@ -27,10 +27,8 @@ function uuid_parse()
define('UUID_TYPE_RANDOM', 4);
}

if (!defined('HHVM_VERSION')) {
$kernel = \AspectMock\Kernel::getInstance();
$kernel->init([
'debug' => true,
'includePaths' => [__DIR__ . '/../src']
]);
}
$kernel = \AspectMock\Kernel::getInstance();
$kernel->init([
'debug' => true,
'includePaths' => [__DIR__ . '/../src']
]);
13 changes: 0 additions & 13 deletions tools/hhvm-docker/Dockerfile

This file was deleted.

0 comments on commit eeecd0f

Please sign in to comment.