From bc201fe3e4a4a204c3772415451af673d0958336 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20Sz=C3=A9pe?= Date: Wed, 16 Oct 2019 02:10:30 +0200 Subject: [PATCH] Add uuid PECL stubs --- tests/bootstrap.php | 23 ++--------------------- tests/phpstan-bootstrap.php | 29 +++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 21 deletions(-) create mode 100644 tests/phpstan-bootstrap.php diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 400a67a..13d5c4b 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -3,27 +3,8 @@ use AspectMock\Kernel; -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($type) {} -} - -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($uuid) {} -} - -if (!defined('UUID_TYPE_TIME')) { - define('UUID_TYPE_TIME', 1); -} - -if (!defined('UUID_TYPE_RANDOM')) { - define('UUID_TYPE_RANDOM', 4); -} +require_once __DIR__ . '/../vendor/autoload.php'; // composer autoload +require_once __DIR__ . '/phpstan-bootstrap.php'; $kernel = Kernel::getInstance(); $kernel->init([ diff --git a/tests/phpstan-bootstrap.php b/tests/phpstan-bootstrap.php new file mode 100644 index 0000000..c7f0535 --- /dev/null +++ b/tests/phpstan-bootstrap.php @@ -0,0 +1,29 @@ +