diff --git a/composer.json b/composer.json index 8a56c11..0522ce6 100644 --- a/composer.json +++ b/composer.json @@ -19,7 +19,7 @@ "illuminate/view": "^5.5.0|^6.0", "ramsey/uuid": "^3.0", "psr/log": "^1.0", - "scoutapp/scout-apm-php": "^3.1" + "scoutapp/scout-apm-php": "^4.0" }, "require-dev": { "doctrine/coding-standard": "^6.0", diff --git a/composer.lock b/composer.lock index 36f063e..12e37c9 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "31be0053cb5e4391315aa84556e14e5a", + "content-hash": "df21e595d87606a84bd89faea33992e9", "packages": [ { "name": "doctrine/inflector", @@ -191,16 +191,16 @@ }, { "name": "egulias/email-validator", - "version": "2.1.13", + "version": "2.1.14", "source": { "type": "git", "url": "https://github.com/egulias/EmailValidator.git", - "reference": "834593d5900615639208417760ba6a17299e2497" + "reference": "c4b8d12921999d8a561004371701dbc2e05b5ece" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/834593d5900615639208417760ba6a17299e2497", - "reference": "834593d5900615639208417760ba6a17299e2497", + "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/c4b8d12921999d8a561004371701dbc2e05b5ece", + "reference": "c4b8d12921999d8a561004371701dbc2e05b5ece", "shasum": "" }, "require": { @@ -244,76 +244,31 @@ "validation", "validator" ], - "time": "2019-12-30T08:14:25+00:00" - }, - { - "name": "erusev/parsedown", - "version": "1.7.4", - "source": { - "type": "git", - "url": "https://github.com/erusev/parsedown.git", - "reference": "cb17b6477dfff935958ba01325f2e8a2bfa6dab3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/erusev/parsedown/zipball/cb17b6477dfff935958ba01325f2e8a2bfa6dab3", - "reference": "cb17b6477dfff935958ba01325f2e8a2bfa6dab3", - "shasum": "" - }, - "require": { - "ext-mbstring": "*", - "php": ">=5.3.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.35" - }, - "type": "library", - "autoload": { - "psr-0": { - "Parsedown": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Emanuil Rusev", - "email": "hello@erusev.com", - "homepage": "http://erusev.com" - } - ], - "description": "Parser for Markdown.", - "homepage": "http://parsedown.org", - "keywords": [ - "markdown", - "parser" - ], - "time": "2019-12-30T22:54:17+00:00" + "time": "2020-01-05T14:11:20+00:00" }, { "name": "laravel/framework", - "version": "v6.9.0", + "version": "v6.10.0", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "60610be97ca389fa4b959d4d13fb3690970d9fb7" + "reference": "ba2de9c702d7c90a39b70c9f7e6db8e9d4a1ea3b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/60610be97ca389fa4b959d4d13fb3690970d9fb7", - "reference": "60610be97ca389fa4b959d4d13fb3690970d9fb7", + "url": "https://api.github.com/repos/laravel/framework/zipball/ba2de9c702d7c90a39b70c9f7e6db8e9d4a1ea3b", + "reference": "ba2de9c702d7c90a39b70c9f7e6db8e9d4a1ea3b", "shasum": "" }, "require": { "doctrine/inflector": "^1.1", "dragonmantank/cron-expression": "^2.0", "egulias/email-validator": "^2.1.10", - "erusev/parsedown": "^1.7", "ext-json": "*", "ext-mbstring": "*", "ext-openssl": "*", + "league/commonmark": "^1.1", + "league/commonmark-ext-table": "^2.1", "league/flysystem": "^1.0.8", "monolog/monolog": "^1.12|^2.0", "nesbot/carbon": "^2.0", @@ -373,14 +328,13 @@ "filp/whoops": "^2.4", "guzzlehttp/guzzle": "^6.3", "league/flysystem-cached-adapter": "^1.0", - "mockery/mockery": "^1.2.3", + "mockery/mockery": "^1.3.1", "moontoast/math": "^1.1", "orchestra/testbench-core": "^4.0", "pda/pheanstalk": "^4.0", - "phpunit/phpunit": "^8.3", + "phpunit/phpunit": "^8.4|^9.0", "predis/predis": "^1.1.1", - "symfony/cache": "^4.3", - "true/punycode": "^2.1" + "symfony/cache": "^4.3.4" }, "suggest": { "aws/aws-sdk-php": "Required to use the SQS queue driver, DynamoDb failed job storage and SES mail driver (^3.0).", @@ -398,6 +352,7 @@ "league/flysystem-cached-adapter": "Required to use the Flysystem cache (^1.0).", "league/flysystem-sftp": "Required to use the Flysystem SFTP driver (^1.0).", "moontoast/math": "Required to use ordered UUIDs (^1.1).", + "nyholm/psr7": "Required to use PSR-7 bridging features (^1.2).", "pda/pheanstalk": "Required to use the beanstalk queue driver (^4.0).", "psr/http-message": "Required to allow Storage::put to accept a StreamInterface (^1.0).", "pusher/pusher-php-server": "Required to use the Pusher broadcast driver (^4.0).", @@ -436,20 +391,156 @@ "framework", "laravel" ], - "time": "2019-12-19T18:16:22+00:00" + "time": "2020-01-07T14:39:33+00:00" + }, + { + "name": "league/commonmark", + "version": "1.1.2", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/commonmark.git", + "reference": "772e03fa9c6477ef5ef2d154fefd8a2a8d8ed03c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/772e03fa9c6477ef5ef2d154fefd8a2a8d8ed03c", + "reference": "772e03fa9c6477ef5ef2d154fefd8a2a8d8ed03c", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "php": "^7.1" + }, + "replace": { + "colinodell/commonmark-php": "*" + }, + "require-dev": { + "cebe/markdown": "~1.0", + "commonmark/commonmark.js": "0.29.0", + "erusev/parsedown": "~1.0", + "ext-json": "*", + "michelf/php-markdown": "~1.4", + "mikehaertl/php-shellcommand": "^1.4", + "phpstan/phpstan-shim": "^0.11.5", + "phpunit/phpunit": "^7.5", + "scrutinizer/ocular": "^1.5", + "symfony/finder": "^4.2" + }, + "suggest": { + "league/commonmark-extras": "Library of useful extensions including smart punctuation" + }, + "bin": [ + "bin/commonmark" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2-dev" + } + }, + "autoload": { + "psr-4": { + "League\\CommonMark\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Colin O'Dell", + "email": "colinodell@gmail.com", + "homepage": "https://www.colinodell.com", + "role": "Lead Developer" + } + ], + "description": "PHP Markdown parser based on the CommonMark spec", + "homepage": "https://commonmark.thephpleague.com", + "keywords": [ + "commonmark", + "markdown", + "parser" + ], + "time": "2019-12-10T02:55:03+00:00" + }, + { + "name": "league/commonmark-ext-table", + "version": "v2.1.0", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/commonmark-ext-table.git", + "reference": "3228888ea69636e855efcf6636ff8e6316933fe7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/commonmark-ext-table/zipball/3228888ea69636e855efcf6636ff8e6316933fe7", + "reference": "3228888ea69636e855efcf6636ff8e6316933fe7", + "shasum": "" + }, + "require": { + "league/commonmark": "~0.19.3|^1.0", + "php": "^7.1" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^2.14", + "phpstan/phpstan": "~0.11", + "phpunit/phpunit": "^7.0|^8.0", + "symfony/var-dumper": "^4.0", + "vimeo/psalm": "^3.0" + }, + "type": "commonmark-extension", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev" + } + }, + "autoload": { + "psr-4": { + "League\\CommonMark\\Ext\\Table\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Martin HasoĊˆ", + "email": "martin.hason@gmail.com" + }, + { + "name": "Webuni s.r.o.", + "homepage": "https://www.webuni.cz" + }, + { + "name": "Colin O'Dell", + "email": "colinodell@gmail.com", + "homepage": "https://www.colinodell.com" + } + ], + "description": "Table extension for league/commonmark", + "homepage": "https://github.com/thephpleague/commonmark-ext-table", + "keywords": [ + "commonmark", + "extension", + "markdown", + "table" + ], + "time": "2019-09-26T13:28:33+00:00" }, { "name": "league/flysystem", - "version": "1.0.62", + "version": "1.0.63", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem.git", - "reference": "14dd5d7dff5fbc29ca9a2a53ff109760e40d91a0" + "reference": "8132daec326565036bc8e8d1876f77ec183a7bd6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/14dd5d7dff5fbc29ca9a2a53ff109760e40d91a0", - "reference": "14dd5d7dff5fbc29ca9a2a53ff109760e40d91a0", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/8132daec326565036bc8e8d1876f77ec183a7bd6", + "reference": "8132daec326565036bc8e8d1876f77ec183a7bd6", "shasum": "" }, "require": { @@ -520,7 +611,7 @@ "sftp", "storage" ], - "time": "2019-12-29T14:46:55+00:00" + "time": "2020-01-04T16:30:31+00:00" }, { "name": "monolog/monolog", @@ -1158,16 +1249,16 @@ }, { "name": "scoutapp/scout-apm-php", - "version": "v3.1.0", + "version": "v4.0.0", "source": { "type": "git", "url": "https://github.com/scoutapp/scout-apm-php.git", - "reference": "0b9e816f2c333a22587732b55ce18cea61296bdc" + "reference": "0596a518606201edbb57d74f03998a7eeaa1a0bf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/scoutapp/scout-apm-php/zipball/0b9e816f2c333a22587732b55ce18cea61296bdc", - "reference": "0b9e816f2c333a22587732b55ce18cea61296bdc", + "url": "https://api.github.com/repos/scoutapp/scout-apm-php/zipball/0596a518606201edbb57d74f03998a7eeaa1a0bf", + "reference": "0596a518606201edbb57d74f03998a7eeaa1a0bf", "shasum": "" }, "require": { @@ -1213,7 +1304,7 @@ "monitoring", "performance" ], - "time": "2019-12-31T10:18:27+00:00" + "time": "2020-01-08T12:54:26+00:00" }, { "name": "swiftmailer/swiftmailer", @@ -4446,16 +4537,16 @@ }, { "name": "phpunit/phpunit", - "version": "8.5.1", + "version": "8.5.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "7870c78da3c5e4883eaef36ae47853ebb3cb86f2" + "reference": "018b6ac3c8ab20916db85fa91bf6465acb64d1e0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/7870c78da3c5e4883eaef36ae47853ebb3cb86f2", - "reference": "7870c78da3c5e4883eaef36ae47853ebb3cb86f2", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/018b6ac3c8ab20916db85fa91bf6465acb64d1e0", + "reference": "018b6ac3c8ab20916db85fa91bf6465acb64d1e0", "shasum": "" }, "require": { @@ -4525,20 +4616,20 @@ "testing", "xunit" ], - "time": "2019-12-25T14:49:39+00:00" + "time": "2020-01-08T08:49:49+00:00" }, { "name": "react/event-loop", - "version": "v1.1.0", + "version": "v1.1.1", "source": { "type": "git", "url": "https://github.com/reactphp/event-loop.git", - "reference": "a0ecac955c67b57c40fe4a1b88a7cca1b58c982d" + "reference": "6d24de090cd59cfc830263cfba965be77b563c13" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/reactphp/event-loop/zipball/a0ecac955c67b57c40fe4a1b88a7cca1b58c982d", - "reference": "a0ecac955c67b57c40fe4a1b88a7cca1b58c982d", + "url": "https://api.github.com/repos/reactphp/event-loop/zipball/6d24de090cd59cfc830263cfba965be77b563c13", + "reference": "6d24de090cd59cfc830263cfba965be77b563c13", "shasum": "" }, "require": { @@ -4567,7 +4658,7 @@ "asynchronous", "event-loop" ], - "time": "2019-02-07T16:19:49+00:00" + "time": "2020-01-01T18:39:52+00:00" }, { "name": "react/stream", @@ -4621,12 +4712,12 @@ "source": { "type": "git", "url": "https://github.com/Roave/SecurityAdvisories.git", - "reference": "44a677c8e06241a66409ae6e4820dc166fc09ab2" + "reference": "67ac6ea8f4a078c3c9b7aec5d7ae70f098c37389" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/44a677c8e06241a66409ae6e4820dc166fc09ab2", - "reference": "44a677c8e06241a66409ae6e4820dc166fc09ab2", + "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/67ac6ea8f4a078c3c9b7aec5d7ae70f098c37389", + "reference": "67ac6ea8f4a078c3c9b7aec5d7ae70f098c37389", "shasum": "" }, "conflict": { @@ -4661,8 +4752,9 @@ "doctrine/mongodb-odm-bundle": ">=2,<3.0.1", "doctrine/orm": ">=2,<2.4.8|>=2.5,<2.5.1", "dompdf/dompdf": ">=0.6,<0.6.2", - "drupal/core": ">=7,<8.7.11|>=8.8,<8.8.1", - "drupal/drupal": ">=7,<8.7.11|>=8.8,<8.8.1", + "drupal/core": ">=7,<7.69|>=8,<8.7.11|>=8.8,<8.8.1", + "drupal/drupal": ">=7,<7.69|>=8,<8.7.11|>=8.8,<8.8.1", + "endroid/qr-code-bundle": "<3.4.2", "erusev/parsedown": "<1.7.2", "ezsystems/ezplatform-admin-ui": ">=1.3,<1.3.5|>=1.4,<1.4.4", "ezsystems/ezpublish-kernel": ">=5.3,<5.3.12.1|>=5.4,<5.4.13.1|>=6,<6.7.9.1|>=6.8,<6.13.5.1|>=7,<7.2.4.1|>=7.3,<7.3.2.1", @@ -4832,7 +4924,7 @@ } ], "description": "Prevents installation of composer packages with known security vulnerabilities: no API, simply require it", - "time": "2019-12-26T14:16:40+00:00" + "time": "2020-01-06T19:16:46+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", @@ -5491,16 +5583,16 @@ }, { "name": "spatie/phpunit-watcher", - "version": "1.21.4", + "version": "1.22.0", "source": { "type": "git", "url": "https://github.com/spatie/phpunit-watcher.git", - "reference": "39f35dd7f629c52058d14b554adabf159d40c6de" + "reference": "dee58ae54d3bc4eccc2b3d7006444f535a693f18" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/phpunit-watcher/zipball/39f35dd7f629c52058d14b554adabf159d40c6de", - "reference": "39f35dd7f629c52058d14b554adabf159d40c6de", + "url": "https://api.github.com/repos/spatie/phpunit-watcher/zipball/dee58ae54d3bc4eccc2b3d7006444f535a693f18", + "reference": "dee58ae54d3bc4eccc2b3d7006444f535a693f18", "shasum": "" }, "require": { @@ -5545,7 +5637,7 @@ "phpunit-watcher", "spatie" ], - "time": "2019-12-04T08:14:29+00:00" + "time": "2020-01-04T22:46:42+00:00" }, { "name": "squizlabs/php_codesniffer", @@ -5699,16 +5791,16 @@ }, { "name": "vimeo/psalm", - "version": "3.8.1", + "version": "3.8.2", "source": { "type": "git", "url": "https://github.com/vimeo/psalm.git", - "reference": "8e54e3aa060fc490d86d0e2abbf62750516d40fd" + "reference": "90d6b73fd8062432030ef39b7b6694b3902daa31" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vimeo/psalm/zipball/8e54e3aa060fc490d86d0e2abbf62750516d40fd", - "reference": "8e54e3aa060fc490d86d0e2abbf62750516d40fd", + "url": "https://api.github.com/repos/vimeo/psalm/zipball/90d6b73fd8062432030ef39b7b6694b3902daa31", + "reference": "90d6b73fd8062432030ef39b7b6694b3902daa31", "shasum": "" }, "require": { @@ -5716,6 +5808,10 @@ "amphp/byte-stream": "^1.5", "composer/xdebug-handler": "^1.1", "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-simplexml": "*", + "ext-tokenizer": "*", "felixfbecker/advanced-json-rpc": "^3.0.3", "felixfbecker/language-server-protocol": "^1.4", "netresearch/jsonmapper": "^1.0", @@ -5786,7 +5882,7 @@ "inspection", "php" ], - "time": "2019-12-29T16:11:07+00:00" + "time": "2020-01-07T13:50:31+00:00" }, { "name": "webmozart/glob", @@ -5883,25 +5979,25 @@ }, { "name": "yosymfony/resource-watcher", - "version": "v2.0.0", + "version": "v2.0.1", "source": { "type": "git", "url": "https://github.com/yosymfony/resource-watcher.git", - "reference": "937ec60269f9d6e092357a9e1948f97a738dc0dc" + "reference": "a8c34f704e6bd4f786c97f3c0ba65bd86cb2bd73" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/yosymfony/resource-watcher/zipball/937ec60269f9d6e092357a9e1948f97a738dc0dc", - "reference": "937ec60269f9d6e092357a9e1948f97a738dc0dc", + "url": "https://api.github.com/repos/yosymfony/resource-watcher/zipball/a8c34f704e6bd4f786c97f3c0ba65bd86cb2bd73", + "reference": "a8c34f704e6bd4f786c97f3c0ba65bd86cb2bd73", "shasum": "" }, "require": { "php": ">=5.6", - "symfony/finder": "^2.7|^3.0|^4.0" + "symfony/finder": "^2.7|^3.0|^4.0|^5.0" }, "require-dev": { "phpunit/phpunit": "^5.7", - "symfony/filesystem": "^2.7|^3.0|^4.0" + "symfony/filesystem": "^2.7|^3.0|^4.0|^5.0" }, "type": "library", "extra": { @@ -5932,7 +6028,7 @@ "symfony", "watcher" ], - "time": "2018-05-12T22:34:25+00:00" + "time": "2020-01-04T15:36:55+00:00" } ], "aliases": [], diff --git a/src/Providers/ScoutApmServiceProvider.php b/src/Providers/ScoutApmServiceProvider.php index 67bd26b..65e0806 100644 --- a/src/Providers/ScoutApmServiceProvider.php +++ b/src/Providers/ScoutApmServiceProvider.php @@ -46,6 +46,8 @@ final class ScoutApmServiceProvider extends ServiceProvider private const VIEW_ENGINES_TO_WRAP = ['file', 'php', 'blade']; + public const INSTRUMENT_LARAVEL_QUEUES = 'laravel_queues'; + /** @throws BindingResolutionException */ public function register() : void { @@ -138,7 +140,10 @@ public function boot( $runningInConsole = $application->runningInConsole(); $this->instrumentDatabaseQueries($agent, $connection); - $this->instrumentQueues($agent, $application->make('events'), $runningInConsole); + + if ($agent->shouldInstrument(self::INSTRUMENT_LARAVEL_QUEUES)) { + $this->instrumentQueues($agent, $application->make('events'), $runningInConsole); + } if ($runningInConsole) { return; diff --git a/tests/Unit/Providers/ScoutApmServiceProviderTest.php b/tests/Unit/Providers/ScoutApmServiceProviderTest.php index 239f724..6ac8f95 100644 --- a/tests/Unit/Providers/ScoutApmServiceProviderTest.php +++ b/tests/Unit/Providers/ScoutApmServiceProviderTest.php @@ -294,12 +294,13 @@ function () : ScoutApmAgent { } ); - $this->bootServiceProvider(); - /** @var Agent&MockObject $agent */ $agent = $this->application->make(ScoutApmAgent::class); - /** @var Dispatcher $events */ - $events = $this->application->make('events'); + + $agent->expects(self::once()) + ->method('shouldInstrument') + ->with(ScoutApmServiceProvider::INSTRUMENT_LARAVEL_QUEUES) + ->willReturn(true); $agent->expects(self::once()) ->method('startNewRequest'); @@ -316,6 +317,11 @@ function () : ScoutApmAgent { $agent->expects(self::once()) ->method('send'); + $this->bootServiceProvider(); + + /** @var Dispatcher $events */ + $events = $this->application->make('events'); + $events->dispatch(new JobProcessing('foo', $this->createMock(Job::class))); $events->dispatch(new JobProcessed('foo', $this->createMock(Job::class))); } @@ -332,12 +338,13 @@ function () : ScoutApmAgent { } ); - $this->bootServiceProvider(); - /** @var Agent&MockObject $agent */ $agent = $this->application->make(ScoutApmAgent::class); - /** @var Dispatcher $events */ - $events = $this->application->make('events'); + + $agent->expects(self::once()) + ->method('shouldInstrument') + ->with(ScoutApmServiceProvider::INSTRUMENT_LARAVEL_QUEUES) + ->willReturn(true); $agent->expects(self::never()) ->method('startNewRequest'); @@ -354,6 +361,66 @@ function () : ScoutApmAgent { $agent->expects(self::never()) ->method('send'); + $this->bootServiceProvider(); + + /** @var Dispatcher $events */ + $events = $this->application->make('events'); + + $events->dispatch(new JobProcessing('foo', $this->createMock(Job::class))); + $events->dispatch(new JobProcessed('foo', $this->createMock(Job::class))); + } + + /** @throws Throwable */ + public function testJobQueuesAreNotInstrumentedWhenNotConfigured() : void + { + $this->application = $this->createLaravelApplicationFulfillingBasicRequirementsForScout(true); + $this->serviceProvider = new ScoutApmServiceProvider($this->application); + + $this->application->singleton('config', static function () { + return new ConfigRepository([ + 'scout_apm' => [ + Config\ConfigKey::DISABLED_INSTRUMENTS => [ScoutApmServiceProvider::INSTRUMENT_LARAVEL_QUEUES], + ], + ]); + }); + + $this->serviceProvider->register(); + + $this->application->singleton( + ScoutApmAgent::class, + function () : ScoutApmAgent { + return $this->createMock(ScoutApmAgent::class); + } + ); + + /** @var Agent&MockObject $agent */ + $agent = $this->application->make(ScoutApmAgent::class); + + $agent->expects(self::once()) + ->method('shouldInstrument') + ->with(ScoutApmServiceProvider::INSTRUMENT_LARAVEL_QUEUES) + ->willReturn(false); + + $agent->expects(self::never()) + ->method('startNewRequest'); + + $agent->expects(self::never()) + ->method('startSpan'); + + $agent->expects(self::never()) + ->method('stopSpan'); + + $agent->expects(self::never()) + ->method('connect'); + + $agent->expects(self::never()) + ->method('send'); + + $this->bootServiceProvider(); + + /** @var Dispatcher $events */ + $events = $this->application->make('events'); + $events->dispatch(new JobProcessing('foo', $this->createMock(Job::class))); $events->dispatch(new JobProcessed('foo', $this->createMock(Job::class))); }