Skip to content

Commit 0f1a6e3

Browse files
committedFeb 5, 2025·
fix: renaming file
1 parent 08d749d commit 0f1a6e3

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed
 

‎library/Helper/Post.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
use Municipio\PostObject\Date\CachedArchiveDateSettingResolver;
2727
use Municipio\PostObject\Date\CachedTimestampResolver;
2828
use Municipio\PostObject\Date\TimestampResolver;
29+
use Municipio\PostObject\Decorators\PostObjectArchiveDateTimestamp;
2930

3031
/**
3132
* Class Post
@@ -169,7 +170,7 @@ private static function convertWpPostToPostObject(WP_Post $post, string $cacheGr
169170
$archiveDateSettingResolver = new CachedArchiveDateSettingResolver($postObject, $wpService, $archiveDateSettingResolver);
170171
$timestampResolver = new TimestampResolver($postObject, $wpService, $archiveDateSettingResolver);
171172
$timestampResolver = new CachedTimestampResolver($postObject, $wpService, $timestampResolver);
172-
$postObject = new PostObjectDateTimestamp($postObject, $wpService, $timestampResolver);
173+
$postObject = new PostObjectArchiveDateTimestamp($postObject, $wpService, $timestampResolver);
173174

174175
$iconResolver = new TermIconResolver($postObject, $wpService, new Term($wpService, AcfService::get()), new NullIconResolver());
175176
$iconResolver = new PostIconResolver($postObject, $acfService, $iconResolver);

‎library/PostObject/Decorators/PostObjectDateTimestamp.php ‎library/PostObject/Decorators/PostObjectArchiveDateTimestamp.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*
1313
* Applies the SEO redirect to the post object permalink if a redirect is set.
1414
*/
15-
class PostObjectDateTimestamp implements PostObjectInterface
15+
class PostObjectArchiveDateTimestamp implements PostObjectInterface
1616
{
1717
private static $archiveDateSettings = [];
1818

@@ -107,7 +107,7 @@ public function getModifiedTime(bool $gmt = false): int
107107
/**
108108
* @inheritDoc
109109
*/
110-
public function getDateTimestamp(): int
110+
public function getArchiveDateTimestamp(): int
111111
{
112112
return $this->timestampResolver->resolve();
113113
}

‎library/PostObject/Decorators/PostObjectDateTimestamp.test.php ‎library/PostObject/Decorators/PostObjectArchiveDateTimestamp.test.php

+5-8
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,20 @@
33
namespace Municipio\PostObject\Decorators;
44

55
use Municipio\PostObject\Date\TimestampResolverInterface;
6-
use Municipio\PostObject\Icon\IconInterface;
7-
use Municipio\PostObject\Icon\Resolvers\IconResolverInterface;
8-
use Municipio\PostObject\Icon\Resolvers\NullIconResolver;
96
use Municipio\PostObject\PostObject;
107
use PHPUnit\Framework\TestCase;
118
use WpService\Implementations\FakeWpService;
129

13-
class PostObjectDateTimestampTest extends TestCase
10+
class PostObjectArchiveDateTimestampTest extends TestCase
1411
{
1512
/**
1613
* @testdox class can be instantiated
1714
*/
1815
public function testClassCanBeInstantiated()
1916
{
2017
$resolver = $this->createMock(TimestampResolverInterface::class);
21-
$decorator = new PostObjectDateTimestamp(new PostObject(new FakeWpService()), new FakeWpService(), $resolver);
22-
$this->assertInstanceOf(PostObjectDateTimestamp::class, $decorator);
18+
$decorator = new PostObjectArchiveDateTimestamp(new PostObject(new FakeWpService()), new FakeWpService(), $resolver);
19+
$this->assertInstanceOf(PostObjectArchiveDateTimestamp::class, $decorator);
2320
}
2421

2522
/**
@@ -30,8 +27,8 @@ public function testReturnUnixTimestamp()
3027
$resolver = $this->createMock(TimestampResolverInterface::class);
3128
$resolver->method('resolve')->willReturn(123);
3229

33-
$decorator = new PostObjectDateTimestamp(new PostObject(new FakeWpService()), new FakeWpService(), $resolver);
30+
$decorator = new PostObjectArchiveDateTimestamp(new PostObject(new FakeWpService()), new FakeWpService(), $resolver);
3431

35-
$this->assertEquals(123, $decorator->getDateTimestamp());
32+
$this->assertEquals(123, $decorator->getArchiveDateTimestamp());
3633
}
3734
}

0 commit comments

Comments
 (0)