forked from getsentry/sentry-symfony
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable error handlers back (getsentry#322)
* Reinforce E2E tests with log of sent events * Add failing test for notices * Fix wrong setup in test * Improve E2E tests; add case for fatals * Try to revert the integration disabling to have the full error reporting back * Fix test after last modification * Require --dev symfony/process for client isolation * Do not capture deprecations in E2E tests * Fix CS * Fix PHPStan * Fix last PHPStan error * Remove unneeded alias * Remove unused class * Try to avoid double reporting of fatal errors * Add changelog entry * Fix after-merge issues
- Loading branch information
Showing
8 changed files
with
80 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
|
||
namespace Sentry\SentryBundle\Test\End2End; | ||
|
||
use Sentry\Event; | ||
use Sentry\Options; | ||
use Sentry\Transport\TransportFactoryInterface; | ||
use Sentry\Transport\TransportInterface; | ||
|
||
class StubTransportFactory implements TransportFactoryInterface | ||
{ | ||
public const SEPARATOR = '###'; | ||
|
||
public function create(Options $options): TransportInterface | ||
{ | ||
return new class() implements TransportInterface { | ||
public function send(Event $event): ?string | ||
{ | ||
touch(End2EndTest::SENT_EVENTS_LOG); | ||
|
||
if ($event->getMessage()) { | ||
$message = $event->getMessage(); | ||
} elseif ($event->getExceptions()) { | ||
$message = $event->getExceptions()[0]['value']; | ||
} else { | ||
$message = 'NO MESSAGE NOR EXCEPTIONS'; | ||
} | ||
|
||
file_put_contents( | ||
End2EndTest::SENT_EVENTS_LOG, | ||
$event->getId() . ': ' . $message . PHP_EOL . StubTransportFactory::SEPARATOR . PHP_EOL, | ||
FILE_APPEND | ||
); | ||
|
||
return $event->getId(); | ||
} | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters