Skip to content

Commit

Permalink
Rename time tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Kolb committed Sep 20, 2023
1 parent 3f38274 commit df6da6d
Show file tree
Hide file tree
Showing 15 changed files with 40 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use PHPUnit\Framework\TestCase;

/** @coversDefaultClass \DigitalCraftsman\DateTimeParts\Time */
final class TimeCompareToTest extends TestCase
final class CompareToTest extends TestCase
{
/**
* @test
Expand Down
16 changes: 1 addition & 15 deletions tests/Time/TimeTest.php → tests/Time/ConstructionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use PHPUnit\Framework\TestCase;

/** @coversDefaultClass \DigitalCraftsman\DateTimeParts\Time */
final class TimeTest extends TestCase
final class ConstructionTest extends TestCase
{
/**
* @test
Expand Down Expand Up @@ -222,18 +222,4 @@ public function from_string_fails(): void
// -- Arrange & Act
Time::fromString('22:77:00');
}

/**
* @test
*
* @covers ::__toString
*/
public function to_string_works(): void
{
// -- Arrange & Act
$time = Time::fromString('15:00:00');

// -- Assert
self::assertEquals('15:00:00.000000', (string) $time);
}
}
2 changes: 1 addition & 1 deletion tests/Time/TimeDiffTest.php → tests/Time/DiffTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use PHPUnit\Framework\TestCase;

/** @coversDefaultClass \DigitalCraftsman\DateTimeParts\Time */
final class TimeDiffTest extends TestCase
final class DiffTest extends TestCase
{
/**
* @test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use PHPUnit\Framework\TestCase;

/** @coversDefaultClass \DigitalCraftsman\DateTimeParts\Time */
final class TimeDistanceInMinutesTest extends TestCase
final class DistanceInMinutesTest extends TestCase
{
/**
* @test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use PHPUnit\Framework\TestCase;

/** @coversDefaultClass \DigitalCraftsman\DateTimeParts\Time */
final class TimeFormatTest extends TestCase
final class FormatTest extends TestCase
{
/**
* @test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use PHPUnit\Framework\TestCase;

/** @coversDefaultClass \DigitalCraftsman\DateTimeParts\Time */
final class TimeIsAfterOrEqualToTest extends TestCase
final class IsAfterOrEqualToTest extends TestCase
{
/**
* @test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use PHPUnit\Framework\TestCase;

/** @coversDefaultClass \DigitalCraftsman\DateTimeParts\Time */
final class TimeIsAfterTest extends TestCase
final class IsAfterTest extends TestCase
{
/**
* @test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use PHPUnit\Framework\TestCase;

/** @coversDefaultClass \DigitalCraftsman\DateTimeParts\Time */
final class TimeIsBeforeOrEqualToTest extends TestCase
final class IsBeforeOrEqualToTest extends TestCase
{
/**
* @test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use PHPUnit\Framework\TestCase;

/** @coversDefaultClass \DigitalCraftsman\DateTimeParts\Time */
final class TimeIsBeforeTest extends TestCase
final class IsBeforeTest extends TestCase
{
/**
* @test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use PHPUnit\Framework\TestCase;

/** @coversDefaultClass \DigitalCraftsman\DateTimeParts\Time */
final class TimeIsEqualToTest extends TestCase
final class IsEqualToTest extends TestCase
{
/**
* @test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use PHPUnit\Framework\TestCase;

/** @coversDefaultClass \DigitalCraftsman\DateTimeParts\Time */
final class TimeIsMidnightTest extends TestCase
final class IsMidnightTest extends TestCase
{
/**
* @test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use PHPUnit\Framework\TestCase;

/** @coversDefaultClass \DigitalCraftsman\DateTimeParts\Time */
final class TimeIsNotEqualToTest extends TestCase
final class IsNotEqualToTest extends TestCase
{
/**
* @test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use PHPUnit\Framework\TestCase;

/** @coversDefaultClass \DigitalCraftsman\DateTimeParts\Time */
final class TimeIsNotMidnightTest extends TestCase
final class IsNotMidnightTest extends TestCase
{
/**
* @test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use PHPUnit\Framework\TestCase;

/** @coversDefaultClass \DigitalCraftsman\DateTimeParts\Time */
final class TimeModifyTest extends TestCase
final class ModifyTest extends TestCase
{
/**
* @test
Expand Down
26 changes: 26 additions & 0 deletions tests/Time/ToStringTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

declare(strict_types=1);

namespace DigitalCraftsman\DateTimeParts\Time;

use DigitalCraftsman\DateTimeParts\Time;
use PHPUnit\Framework\TestCase;

/** @coversDefaultClass \DigitalCraftsman\DateTimeParts\Time */
final class ToStringTest extends TestCase
{
/**
* @test
*
* @covers ::__toString
*/
public function to_string_works(): void
{
// -- Arrange & Act
$time = Time::fromString('15:00:00');

// -- Assert
self::assertEquals('15:00:00.000000', (string) $time);
}
}

0 comments on commit df6da6d

Please sign in to comment.