Skip to content

Commit

Permalink
Create stubs for testing uuid_* methods for environments without pecl…
Browse files Browse the repository at this point in the history
…/uuid
  • Loading branch information
ramsey committed Nov 30, 2019
1 parent 4a3ad2d commit 3f43661
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,28 @@
<?php
// @codingStandardsIgnoreFile

include __DIR__ . '/../vendor/autoload.php'; // composer autoload

if (!function_exists('uuid_create')) {
// Create stub of method so AspectMock can mock this function
// if it doesn't exist in PHP.
function uuid_create() {}
}

if (!function_exists('uuid_parse')) {
// Create stub of method so AspectMock can mock this function
// if it doesn't exist in PHP.
function uuid_parse() {}
}

if (!defined('UUID_TYPE_TIME')) {
define('UUID_TYPE_TIME', 1);
}

if (!defined('UUID_TYPE_RANDOM')) {
define('UUID_TYPE_RANDOM', 4);
}

$kernel = \AspectMock\Kernel::getInstance();
$kernel->init([
'debug' => true,
Expand Down

0 comments on commit 3f43661

Please sign in to comment.