Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #245 from getsentry/add-class_serializers-option
Add class_serializers option
- Loading branch information
Showing
8 changed files
with
112 additions
and
31 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 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,32 @@ | ||
<?php | ||
|
||
namespace Sentry\SentryBundle\Test; | ||
|
||
use PHPUnit\Framework\TestCase; | ||
use Sentry\Options; | ||
use Sentry\SentryBundle\Test\DependencyInjection\ConfigurationTest; | ||
|
||
abstract class BaseTestCase extends TestCase | ||
{ | ||
public const SUPPORTED_SENTRY_OPTIONS_COUNT = 23; | ||
|
||
protected function classSerializersAreSupported(): bool | ||
{ | ||
try { | ||
new Options(['class_serializers' => []]); | ||
|
||
return true; | ||
} catch (\Throwable $throwable) { | ||
return false; | ||
} | ||
} | ||
|
||
protected function getSupportedOptionsCount(): int | ||
{ | ||
if ($this->classSerializersAreSupported()) { | ||
return ConfigurationTest::SUPPORTED_SENTRY_OPTIONS_COUNT + 1; | ||
} | ||
|
||
return ConfigurationTest::SUPPORTED_SENTRY_OPTIONS_COUNT; | ||
} | ||
} |
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