Skip to content

Commit

Permalink
remove doubled implementations
Browse files Browse the repository at this point in the history
  • Loading branch information
hansmorb committed Jun 22, 2024
1 parent 1fc03dd commit 48710fe
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 25 deletions.
14 changes: 0 additions & 14 deletions src/Model/Day.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,20 +90,6 @@ public function getDate(): string {
return $this->date;
}

public function getStartTimestamp(): int {
$dt = new DateTime( $this->getDate() );
$dt->modify( 'midnight' );

return $dt->getTimestamp();
}

public function getEndTimestamp(): int {
$dt = new DateTime( $this->getDate() );
$dt->modify( '23:59:59' );

return $dt->getTimestamp();
}

/**
* Returns formatted date.
*
Expand Down
10 changes: 0 additions & 10 deletions tests/php/Model/DayTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,16 +156,6 @@ public function testGetDate() {
$this->assertEquals($this->dateFormatted ,$this->instance->getDate() );
}

public function testGetStartTimestamp() {
$start = strtotime( self::CURRENT_DATE . ' midnight' );
$this->assertEquals( $start, $this->instance->getStartTimestamp() );
}

public function testGetEndTimestamp() {
$end = strtotime( self::CURRENT_DATE . ' 23:59:59' );
$this->assertEquals( $end, $this->instance->getEndTimestamp() );
}

public function testIsInTimeframe() {
$timeframe = new Timeframe( $this->bookableTimeframeForCurrentDayId );
$this->assertTrue( $this->instance->isInTimeframe( $timeframe ) );
Expand Down
4 changes: 3 additions & 1 deletion tests/php/Repository/TimeframeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,9 @@ public function testGetInRangePaginated() {
$merged = array_merge($firstPageIDS, $secondPageIDS, $thirdPageIDS);
$this->assertEquals(21, count($merged));
$this->assertEqualsCanonicalizing($bookingIds, $merged);
}public function testGetPostIdsByType_oneLocationMultiItem() {
}

public function testGetPostIdsByType_oneLocationMultiItem() {
$otherItemId = $this->createItem( "Other Item" );
// Timeframe with enddate and two items
$multiItemTF = $this->createTimeframe(
Expand Down

0 comments on commit 48710fe

Please sign in to comment.