diff --git a/tests/DateTime/DateTimeCompareToTest.php b/tests/DateTime/CompareToTest.php similarity index 97% rename from tests/DateTime/DateTimeCompareToTest.php rename to tests/DateTime/CompareToTest.php index 4feb0b2..1ff0fe0 100644 --- a/tests/DateTime/DateTimeCompareToTest.php +++ b/tests/DateTime/CompareToTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; /** @coversDefaultClass \DigitalCraftsman\DateTimeParts\DateTime */ -final class DateTimeCompareToTest extends TestCase +final class CompareToTest extends TestCase { /** * @test diff --git a/tests/DateTime/DateTimeTest.php b/tests/DateTime/ConstructionTest.php similarity index 55% rename from tests/DateTime/DateTimeTest.php rename to tests/DateTime/ConstructionTest.php index f5d06e9..59fa5d4 100644 --- a/tests/DateTime/DateTimeTest.php +++ b/tests/DateTime/ConstructionTest.php @@ -5,14 +5,11 @@ namespace DigitalCraftsman\DateTimeParts\DateTime; use DigitalCraftsman\DateTimeParts\DateTime; -use DigitalCraftsman\DateTimeParts\Time; use PHPUnit\Framework\TestCase; /** @coversDefaultClass \DigitalCraftsman\DateTimeParts\DateTime */ -final class DateTimeTest extends TestCase +final class ConstructionTest extends TestCase { - // -- Construction - /** * @test * @@ -58,47 +55,4 @@ public function from_string_in_time_zone_works(): void // -- Assert self::assertEquals(new \DateTimeImmutable('2022-10-08 13:00:00'), $dateTime->dateTime); } - - /** - * @test - * - * @covers ::__toString - */ - public function to_string_works(): void - { - // -- Arrange & Act - $dateTime = DateTime::fromStringInTimeZone('2022-10-08 15:00:00', new \DateTimeZone('Europe/Berlin')); - - // -- Assert - self::assertEquals('2022-10-08T13:00:00+00:00', (string) $dateTime); - } - - // -- Mutations - - /** - * @test - * - * @covers ::toUTC - * @covers ::timezone - */ - public function to_utc_works(): void - { - // -- Arrange - $dateTime = new DateTime(new \DateTimeImmutable( - '2022-10-07 14:39:24', - new \DateTimeZone('Europe/Berlin'), - )); - - // -- Act - $dateTimeInUTC = $dateTime->toUTC(); - - // -- Assert - self::assertEquals( - $dateTimeInUTC->timezone(), - new \DateTimeZone('UTC'), - ); - self::assertTrue( - $dateTimeInUTC->time()->isEqualTo(Time::fromString('12:39:24')), - ); - } } diff --git a/tests/DateTime/DateTimeDateTest.php b/tests/DateTime/DateInTimeZoneTest.php similarity index 62% rename from tests/DateTime/DateTimeDateTest.php rename to tests/DateTime/DateInTimeZoneTest.php index 9fe4f30..721cea7 100644 --- a/tests/DateTime/DateTimeDateTest.php +++ b/tests/DateTime/DateInTimeZoneTest.php @@ -9,44 +9,8 @@ use PHPUnit\Framework\TestCase; /** @coversDefaultClass \DigitalCraftsman\DateTimeParts\DateTime */ -final class DateTimeDateTest extends TestCase +final class DateInTimeZoneTest extends TestCase { - /** - * @test - * - * @dataProvider dataProviderForDate - * - * @covers ::date - */ - public function date_works( - Date $expectedResult, - DateTime $dateTime, - ): void { - // -- Act & Assert - self::assertEquals($expectedResult, $dateTime->date()); - } - - /** - * @return array - */ - public function dataProviderForDate(): array - { - return [ - 'same date in UTC' => [ - Date::fromString('2022-10-08'), - DateTime::fromString('2022-10-08 00:00:00'), - ], - 'date the same with same time zone' => [ - Date::fromString('2022-10-08'), - DateTime::fromStringInTimeZone('2022-10-08 01:00:00', new \DateTimeZone('Europe/Berlin')) - ->toTimeZone(new \DateTimeZone('Europe/Berlin')), - ], - ]; - } - /** * @test * diff --git a/tests/DateTime/DateTest.php b/tests/DateTime/DateTest.php new file mode 100644 index 0000000..3c71d53 --- /dev/null +++ b/tests/DateTime/DateTest.php @@ -0,0 +1,49 @@ +date()); + } + + /** + * @return array + */ + public function dataProviderForDate(): array + { + return [ + 'same date in UTC' => [ + Date::fromString('2022-10-08'), + DateTime::fromString('2022-10-08 00:00:00'), + ], + 'date the same with same time zone' => [ + Date::fromString('2022-10-08'), + DateTime::fromStringInTimeZone('2022-10-08 01:00:00', new \DateTimeZone('Europe/Berlin')) + ->toTimeZone(new \DateTimeZone('Europe/Berlin')), + ], + ]; + } +} diff --git a/tests/DateTime/DateTimeFormatInTimeZoneTest.php b/tests/DateTime/FormatInTimeZoneTest.php similarity index 97% rename from tests/DateTime/DateTimeFormatInTimeZoneTest.php rename to tests/DateTime/FormatInTimeZoneTest.php index bd4d733..46e83e9 100644 --- a/tests/DateTime/DateTimeFormatInTimeZoneTest.php +++ b/tests/DateTime/FormatInTimeZoneTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; /** @coversDefaultClass \DigitalCraftsman\DateTimeParts\DateTime */ -final class DateTimeFormatInTimeZoneTest extends TestCase +final class FormatInTimeZoneTest extends TestCase { /** * @test diff --git a/tests/DateTime/DateTimeFormatTest.php b/tests/DateTime/FormatTest.php similarity index 96% rename from tests/DateTime/DateTimeFormatTest.php rename to tests/DateTime/FormatTest.php index fc9c630..de57e6d 100644 --- a/tests/DateTime/DateTimeFormatTest.php +++ b/tests/DateTime/FormatTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; /** @coversDefaultClass \DigitalCraftsman\DateTimeParts\DateTime */ -final class DateTimeFormatTest extends TestCase +final class FormatTest extends TestCase { /** * @test diff --git a/tests/DateTime/DateTimeIsAfterOrEqualToTest.php b/tests/DateTime/IsAfterOrEqualToTest.php similarity index 97% rename from tests/DateTime/DateTimeIsAfterOrEqualToTest.php rename to tests/DateTime/IsAfterOrEqualToTest.php index d578ae5..4e4e6e2 100644 --- a/tests/DateTime/DateTimeIsAfterOrEqualToTest.php +++ b/tests/DateTime/IsAfterOrEqualToTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; /** @coversDefaultClass \DigitalCraftsman\DateTimeParts\DateTime */ -final class DateTimeIsAfterOrEqualToTest extends TestCase +final class IsAfterOrEqualToTest extends TestCase { /** * @test diff --git a/tests/DateTime/DateTimeIsAfterTest.php b/tests/DateTime/IsAfterTest.php similarity index 98% rename from tests/DateTime/DateTimeIsAfterTest.php rename to tests/DateTime/IsAfterTest.php index b908f99..a34f370 100644 --- a/tests/DateTime/DateTimeIsAfterTest.php +++ b/tests/DateTime/IsAfterTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; /** @coversDefaultClass \DigitalCraftsman\DateTimeParts\DateTime */ -final class DateTimeIsAfterTest extends TestCase +final class IsAfterTest extends TestCase { /** * @test diff --git a/tests/DateTime/DateTimeIsAtMidnightInTimeZoneTest.php b/tests/DateTime/IsAtMidnightInTimeZoneTest.php similarity index 96% rename from tests/DateTime/DateTimeIsAtMidnightInTimeZoneTest.php rename to tests/DateTime/IsAtMidnightInTimeZoneTest.php index 077aa90..081bdc9 100644 --- a/tests/DateTime/DateTimeIsAtMidnightInTimeZoneTest.php +++ b/tests/DateTime/IsAtMidnightInTimeZoneTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; /** @coversDefaultClass \DigitalCraftsman\DateTimeParts\DateTime */ -final class DateTimeIsAtMidnightInTimeZoneTest extends TestCase +final class IsAtMidnightInTimeZoneTest extends TestCase { /** * @test diff --git a/tests/DateTime/DateTimeIsAtMidnightTest.php b/tests/DateTime/IsAtMidnightTest.php similarity index 96% rename from tests/DateTime/DateTimeIsAtMidnightTest.php rename to tests/DateTime/IsAtMidnightTest.php index f6b607f..ec43252 100644 --- a/tests/DateTime/DateTimeIsAtMidnightTest.php +++ b/tests/DateTime/IsAtMidnightTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; /** @coversDefaultClass \DigitalCraftsman\DateTimeParts\DateTime */ -final class DateTimeIsAtMidnightTest extends TestCase +final class IsAtMidnightTest extends TestCase { /** * @test diff --git a/tests/DateTime/DateTimeIsBeforeOrEqualToTest.php b/tests/DateTime/IsBeforeOrEqualToTest.php similarity index 97% rename from tests/DateTime/DateTimeIsBeforeOrEqualToTest.php rename to tests/DateTime/IsBeforeOrEqualToTest.php index b18e099..cdb7cd7 100644 --- a/tests/DateTime/DateTimeIsBeforeOrEqualToTest.php +++ b/tests/DateTime/IsBeforeOrEqualToTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; /** @coversDefaultClass \DigitalCraftsman\DateTimeParts\DateTime */ -final class DateTimeIsBeforeOrEqualToTest extends TestCase +final class IsBeforeOrEqualToTest extends TestCase { /** * @test diff --git a/tests/DateTime/DateTimeIsBeforeTest.php b/tests/DateTime/IsBeforeTest.php similarity index 98% rename from tests/DateTime/DateTimeIsBeforeTest.php rename to tests/DateTime/IsBeforeTest.php index d4eeeae..5620dd5 100644 --- a/tests/DateTime/DateTimeIsBeforeTest.php +++ b/tests/DateTime/IsBeforeTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; /** @coversDefaultClass \DigitalCraftsman\DateTimeParts\DateTime */ -final class DateTimeIsBeforeTest extends TestCase +final class IsBeforeTest extends TestCase { /** * @test diff --git a/tests/DateTime/DateTimeIsDateAfterInTimeZoneTest.php b/tests/DateTime/IsDateAfterInTimeZoneTest.php similarity index 97% rename from tests/DateTime/DateTimeIsDateAfterInTimeZoneTest.php rename to tests/DateTime/IsDateAfterInTimeZoneTest.php index 336aa6a..25a398f 100644 --- a/tests/DateTime/DateTimeIsDateAfterInTimeZoneTest.php +++ b/tests/DateTime/IsDateAfterInTimeZoneTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; /** @coversDefaultClass \DigitalCraftsman\DateTimeParts\DateTime */ -final class DateTimeIsDateAfterInTimeZoneTest extends TestCase +final class IsDateAfterInTimeZoneTest extends TestCase { /** * @test diff --git a/tests/DateTime/DateTimeIsDateAfterOrEqualToInTimeZoneTest.php b/tests/DateTime/IsDateAfterOrEqualToInTimeZoneTest.php similarity index 97% rename from tests/DateTime/DateTimeIsDateAfterOrEqualToInTimeZoneTest.php rename to tests/DateTime/IsDateAfterOrEqualToInTimeZoneTest.php index b478202..e222901 100644 --- a/tests/DateTime/DateTimeIsDateAfterOrEqualToInTimeZoneTest.php +++ b/tests/DateTime/IsDateAfterOrEqualToInTimeZoneTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; /** @coversDefaultClass \DigitalCraftsman\DateTimeParts\DateTime */ -final class DateTimeIsDateAfterOrEqualToInTimeZoneTest extends TestCase +final class IsDateAfterOrEqualToInTimeZoneTest extends TestCase { /** * @test diff --git a/tests/DateTime/DateTimeIsDateBeforeInTimeZoneTest.php b/tests/DateTime/IsDateBeforeInTimeZoneTest.php similarity index 97% rename from tests/DateTime/DateTimeIsDateBeforeInTimeZoneTest.php rename to tests/DateTime/IsDateBeforeInTimeZoneTest.php index ad874ec..730c5f6 100644 --- a/tests/DateTime/DateTimeIsDateBeforeInTimeZoneTest.php +++ b/tests/DateTime/IsDateBeforeInTimeZoneTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; /** @coversDefaultClass \DigitalCraftsman\DateTimeParts\DateTime */ -final class DateTimeIsDateBeforeInTimeZoneTest extends TestCase +final class IsDateBeforeInTimeZoneTest extends TestCase { /** * @test diff --git a/tests/DateTime/DateTimeIsDateBeforeOrEqualToInTimeZoneTest.php b/tests/DateTime/IsDateBeforeOrEqualToInTimeZoneTest.php similarity index 97% rename from tests/DateTime/DateTimeIsDateBeforeOrEqualToInTimeZoneTest.php rename to tests/DateTime/IsDateBeforeOrEqualToInTimeZoneTest.php index 9592727..ed45eb7 100644 --- a/tests/DateTime/DateTimeIsDateBeforeOrEqualToInTimeZoneTest.php +++ b/tests/DateTime/IsDateBeforeOrEqualToInTimeZoneTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; /** @coversDefaultClass \DigitalCraftsman\DateTimeParts\DateTime */ -final class DateTimeIsDateBeforeOrEqualToInTimeZoneTest extends TestCase +final class IsDateBeforeOrEqualToInTimeZoneTest extends TestCase { /** * @test diff --git a/tests/DateTime/DateTimeIsDateEqualToInTimeZoneTest.php b/tests/DateTime/IsDateEqualToInTimeZoneTest.php similarity index 97% rename from tests/DateTime/DateTimeIsDateEqualToInTimeZoneTest.php rename to tests/DateTime/IsDateEqualToInTimeZoneTest.php index ec41347..7989491 100644 --- a/tests/DateTime/DateTimeIsDateEqualToInTimeZoneTest.php +++ b/tests/DateTime/IsDateEqualToInTimeZoneTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; /** @coversDefaultClass \DigitalCraftsman\DateTimeParts\DateTime */ -final class DateTimeIsDateEqualToInTimeZoneTest extends TestCase +final class IsDateEqualToInTimeZoneTest extends TestCase { /** * @test diff --git a/tests/DateTime/DateTimeIsDateNotEqualToInTimeZoneTest.php b/tests/DateTime/IsDateNotEqualToInTimeZoneTest.php similarity index 97% rename from tests/DateTime/DateTimeIsDateNotEqualToInTimeZoneTest.php rename to tests/DateTime/IsDateNotEqualToInTimeZoneTest.php index 6d9ca12..ea566c9 100644 --- a/tests/DateTime/DateTimeIsDateNotEqualToInTimeZoneTest.php +++ b/tests/DateTime/IsDateNotEqualToInTimeZoneTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; /** @coversDefaultClass \DigitalCraftsman\DateTimeParts\DateTime */ -final class DateTimeIsDateNotEqualToInTimeZoneTest extends TestCase +final class IsDateNotEqualToInTimeZoneTest extends TestCase { /** * @test diff --git a/tests/DateTime/DateTimeIsEqualToTest.php b/tests/DateTime/IsEqualToTest.php similarity index 97% rename from tests/DateTime/DateTimeIsEqualToTest.php rename to tests/DateTime/IsEqualToTest.php index 21de749..7363177 100644 --- a/tests/DateTime/DateTimeIsEqualToTest.php +++ b/tests/DateTime/IsEqualToTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; /** @coversDefaultClass \DigitalCraftsman\DateTimeParts\DateTime */ -final class DateTimeIsEqualToTest extends TestCase +final class IsEqualToTest extends TestCase { /** * @test diff --git a/tests/DateTime/DateTimeIsNotAtMidnightInTimeZoneTest.php b/tests/DateTime/IsNotAtMidnightInTimeZoneTest.php similarity index 96% rename from tests/DateTime/DateTimeIsNotAtMidnightInTimeZoneTest.php rename to tests/DateTime/IsNotAtMidnightInTimeZoneTest.php index 21965a7..0a53c66 100644 --- a/tests/DateTime/DateTimeIsNotAtMidnightInTimeZoneTest.php +++ b/tests/DateTime/IsNotAtMidnightInTimeZoneTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; /** @coversDefaultClass \DigitalCraftsman\DateTimeParts\DateTime */ -final class DateTimeIsNotAtMidnightInTimeZoneTest extends TestCase +final class IsNotAtMidnightInTimeZoneTest extends TestCase { /** * @test diff --git a/tests/DateTime/DateTimeIsNotAtMidnightTest.php b/tests/DateTime/IsNotAtMidnightTest.php similarity index 96% rename from tests/DateTime/DateTimeIsNotAtMidnightTest.php rename to tests/DateTime/IsNotAtMidnightTest.php index e35dcc7..bc564ae 100644 --- a/tests/DateTime/DateTimeIsNotAtMidnightTest.php +++ b/tests/DateTime/IsNotAtMidnightTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; /** @coversDefaultClass \DigitalCraftsman\DateTimeParts\DateTime */ -final class DateTimeIsNotAtMidnightTest extends TestCase +final class IsNotAtMidnightTest extends TestCase { /** * @test diff --git a/tests/DateTime/DateTimeIsNotEqualToTest.php b/tests/DateTime/IsNotEqualToTest.php similarity index 97% rename from tests/DateTime/DateTimeIsNotEqualToTest.php rename to tests/DateTime/IsNotEqualToTest.php index 7f1fefd..d0c758d 100644 --- a/tests/DateTime/DateTimeIsNotEqualToTest.php +++ b/tests/DateTime/IsNotEqualToTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; /** @coversDefaultClass \DigitalCraftsman\DateTimeParts\DateTime */ -final class DateTimeIsNotEqualToTest extends TestCase +final class IsNotEqualToTest extends TestCase { /** * @test diff --git a/tests/DateTime/DateTimeMidnightInTimeZoneTest.php b/tests/DateTime/MidnightInTimeZoneTest.php similarity index 95% rename from tests/DateTime/DateTimeMidnightInTimeZoneTest.php rename to tests/DateTime/MidnightInTimeZoneTest.php index 710ace4..1681490 100644 --- a/tests/DateTime/DateTimeMidnightInTimeZoneTest.php +++ b/tests/DateTime/MidnightInTimeZoneTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; /** @coversDefaultClass \DigitalCraftsman\DateTimeParts\DateTime */ -final class DateTimeMidnightInTimeZoneTest extends TestCase +final class MidnightInTimeZoneTest extends TestCase { /** * @test diff --git a/tests/DateTime/DateTimeMidnightTest.php b/tests/DateTime/MidnightTest.php similarity index 97% rename from tests/DateTime/DateTimeMidnightTest.php rename to tests/DateTime/MidnightTest.php index 07d3144..2f5bc81 100644 --- a/tests/DateTime/DateTimeMidnightTest.php +++ b/tests/DateTime/MidnightTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; /** @coversDefaultClass \DigitalCraftsman\DateTimeParts\DateTime */ -final class DateTimeMidnightTest extends TestCase +final class MidnightTest extends TestCase { /** * @test diff --git a/tests/DateTime/DateTimeModifyInTimeZoneTest.php b/tests/DateTime/ModifyInTimeZoneTest.php similarity index 97% rename from tests/DateTime/DateTimeModifyInTimeZoneTest.php rename to tests/DateTime/ModifyInTimeZoneTest.php index 8ac3b52..40d41c6 100644 --- a/tests/DateTime/DateTimeModifyInTimeZoneTest.php +++ b/tests/DateTime/ModifyInTimeZoneTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; /** @coversDefaultClass \DigitalCraftsman\DateTimeParts\DateTime */ -final class DateTimeModifyInTimeZoneTest extends TestCase +final class ModifyInTimeZoneTest extends TestCase { /** * @test diff --git a/tests/DateTime/DateTimeModifyTest.php b/tests/DateTime/ModifyTest.php similarity index 96% rename from tests/DateTime/DateTimeModifyTest.php rename to tests/DateTime/ModifyTest.php index 56c7cb6..3d704a5 100644 --- a/tests/DateTime/DateTimeModifyTest.php +++ b/tests/DateTime/ModifyTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; /** @coversDefaultClass \DigitalCraftsman\DateTimeParts\DateTime */ -final class DateTimeModifyTest extends TestCase +final class ModifyTest extends TestCase { /** * @test diff --git a/tests/DateTime/DateTimeMonthTest.php b/tests/DateTime/MonthTest.php similarity index 98% rename from tests/DateTime/DateTimeMonthTest.php rename to tests/DateTime/MonthTest.php index f6f80a0..f5f31a5 100644 --- a/tests/DateTime/DateTimeMonthTest.php +++ b/tests/DateTime/MonthTest.php @@ -9,7 +9,7 @@ use PHPUnit\Framework\TestCase; /** @coversDefaultClass \DigitalCraftsman\DateTimeParts\DateTime */ -final class DateTimeMonthTest extends TestCase +final class MonthTest extends TestCase { /** * @test diff --git a/tests/DateTime/DateTimeSetTimeInTimeZoneTest.php b/tests/DateTime/SetTimeInTimeZoneTest.php similarity index 96% rename from tests/DateTime/DateTimeSetTimeInTimeZoneTest.php rename to tests/DateTime/SetTimeInTimeZoneTest.php index 3e3d138..b1aa3df 100644 --- a/tests/DateTime/DateTimeSetTimeInTimeZoneTest.php +++ b/tests/DateTime/SetTimeInTimeZoneTest.php @@ -9,7 +9,7 @@ use PHPUnit\Framework\TestCase; /** @coversDefaultClass \DigitalCraftsman\DateTimeParts\DateTime */ -final class DateTimeSetTimeInTimeZoneTest extends TestCase +final class SetTimeInTimeZoneTest extends TestCase { /** * @test diff --git a/tests/DateTime/DateTimeSetTimeTest.php b/tests/DateTime/SetTimeTest.php similarity index 96% rename from tests/DateTime/DateTimeSetTimeTest.php rename to tests/DateTime/SetTimeTest.php index 547137a..a3cacff 100644 --- a/tests/DateTime/DateTimeSetTimeTest.php +++ b/tests/DateTime/SetTimeTest.php @@ -9,7 +9,7 @@ use PHPUnit\Framework\TestCase; /** @coversDefaultClass \DigitalCraftsman\DateTimeParts\DateTime */ -final class DateTimeSetTimeTest extends TestCase +final class SetTimeTest extends TestCase { /** * @test diff --git a/tests/DateTime/DateTimeTimeTest.php b/tests/DateTime/TimeTest.php similarity index 98% rename from tests/DateTime/DateTimeTimeTest.php rename to tests/DateTime/TimeTest.php index e00ce69..b02b458 100644 --- a/tests/DateTime/DateTimeTimeTest.php +++ b/tests/DateTime/TimeTest.php @@ -9,7 +9,7 @@ use PHPUnit\Framework\TestCase; /** @coversDefaultClass \DigitalCraftsman\DateTimeParts\DateTime */ -final class DateTimeTimeTest extends TestCase +final class TimeTest extends TestCase { /** * @test diff --git a/tests/DateTime/ToStringTest.php b/tests/DateTime/ToStringTest.php new file mode 100644 index 0000000..38d826d --- /dev/null +++ b/tests/DateTime/ToStringTest.php @@ -0,0 +1,26 @@ +toUTC(); + + // -- Assert + self::assertEquals( + $dateTimeInUTC->timezone(), + new \DateTimeZone('UTC'), + ); + self::assertTrue( + $dateTimeInUTC->time()->isEqualTo(Time::fromString('12:39:24')), + ); + } +} diff --git a/tests/DateTime/DateTimeYearTest.php b/tests/DateTime/YearTest.php similarity index 98% rename from tests/DateTime/DateTimeYearTest.php rename to tests/DateTime/YearTest.php index 0f81232..3fb396c 100644 --- a/tests/DateTime/DateTimeYearTest.php +++ b/tests/DateTime/YearTest.php @@ -9,7 +9,7 @@ use PHPUnit\Framework\TestCase; /** @coversDefaultClass \DigitalCraftsman\DateTimeParts\DateTime */ -final class DateTimeYearTest extends TestCase +final class YearTest extends TestCase { /** * @test