AbstractTestCaseWithOldNow.php 771 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * This file is part of the Carbon package.
  5. *
  6. * (c) Brian Nesbitt <brian@nesbot.com>
  7. *
  8. * For the full copyright and license information, please view the LICENSE
  9. * file that was distributed with this source code.
  10. */
  11. namespace Tests;
  12. use Carbon\Carbon;
  13. use Carbon\CarbonImmutable;
  14. abstract class AbstractTestCaseWithOldNow extends AbstractTestCase
  15. {
  16. /**
  17. * @var bool
  18. */
  19. protected $oldNow = true;
  20. /**
  21. * @var bool
  22. */
  23. protected $oldImmutableNow = true;
  24. protected function tearDown(): void
  25. {
  26. Carbon::resetMacros();
  27. Carbon::serializeUsing(null);
  28. CarbonImmutable::resetMacros();
  29. CarbonImmutable::serializeUsing(null);
  30. parent::tearDown();
  31. }
  32. }