From 8538a0a4ac31ecc15a0ccf9cce6c8c48bfca7bdd Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Sun, 17 Dec 2023 19:38:42 -0500 Subject: [PATCH 1/5] change: Deeper page to L1 page --- tests/test-content/public/{deeper-page => l1-page}/meta.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename tests/test-content/public/{deeper-page => l1-page}/meta.json (64%) diff --git a/tests/test-content/public/deeper-page/meta.json b/tests/test-content/public/l1-page/meta.json similarity index 64% rename from tests/test-content/public/deeper-page/meta.json rename to tests/test-content/public/l1-page/meta.json index 82c1a0c..0dc1db6 100644 --- a/tests/test-content/public/deeper-page/meta.json +++ b/tests/test-content/public/l1-page/meta.json @@ -1,5 +1,5 @@ { - "title": "Deeper page", + "title": "L1 page", "created": "20230101", "priority": 1.0 } From 0aa5264f081f4e5f47bd66dac59dc3adb3546ac2 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Sun, 17 Dec 2023 19:39:24 -0500 Subject: [PATCH 2/5] change: Path references --- tests/FileSystem/Directories/PublicDirectoryTest.php | 6 +++--- tests/FileSystem/Files/PublicContentFileTest.php | 2 +- tests/FileSystem/Files/PublicFileTest.php | 2 +- tests/ObjectsFromJson/PublicMetaTest.php | 4 ++-- tests/PlainText/PrivateJsonTest.php | 2 +- tests/PlainText/PublicContentTest.php | 2 +- tests/PlainText/PublicJsonTest.php | 2 +- tests/SiteMapTest.php | 6 +++--- tests/SiteTest.php | 2 +- 9 files changed, 14 insertions(+), 14 deletions(-) diff --git a/tests/FileSystem/Directories/PublicDirectoryTest.php b/tests/FileSystem/Directories/PublicDirectoryTest.php index 65e1953..12f9504 100644 --- a/tests/FileSystem/Directories/PublicDirectoryTest.php +++ b/tests/FileSystem/Directories/PublicDirectoryTest.php @@ -16,12 +16,12 @@ class PublicDirectoryTest extends BaseTestCase */ public function is_expected_qualified_path(): void { - $expected = (new SplFileInfo(parent::PUBLIC_BASE . '/deeper-page')) + $expected = (new SplFileInfo(parent::PUBLIC_BASE . '/l1-page')) ->getRealPath(); $sut = PublicDirectory::inRoot( parent::root(), - '/deeper-page' + '/l1-page' ); $result = $sut->toString(); @@ -40,7 +40,7 @@ public function can_check_existence(): void { $sut = PublicDirectory::inRoot( parent::root(), - '/deeper-page' + '/l1-page' ); $this->assertNotNull( diff --git a/tests/FileSystem/Files/PublicContentFileTest.php b/tests/FileSystem/Files/PublicContentFileTest.php index 6164285..279937e 100644 --- a/tests/FileSystem/Files/PublicContentFileTest.php +++ b/tests/FileSystem/Files/PublicContentFileTest.php @@ -42,7 +42,7 @@ public function can_check_existence(): void $result ); - $sut = PublicContentFile::inRoot($root, '/deeper-page'); + $sut = PublicContentFile::inRoot($root, '/l1-page'); $this->assertNotNull( $sut diff --git a/tests/FileSystem/Files/PublicFileTest.php b/tests/FileSystem/Files/PublicFileTest.php index 69c17c0..8f07ef3 100644 --- a/tests/FileSystem/Files/PublicFileTest.php +++ b/tests/FileSystem/Files/PublicFileTest.php @@ -42,7 +42,7 @@ public function can_check_existence(): void $result ); - $sut = PublicFile::inRoot($root, 'meta.json', '/deeper-page'); + $sut = PublicFile::inRoot($root, 'meta.json', '/l1-page'); $this->assertNotNull( $sut diff --git a/tests/ObjectsFromJson/PublicMetaTest.php b/tests/ObjectsFromJson/PublicMetaTest.php index 32c0a75..c23eabd 100644 --- a/tests/ObjectsFromJson/PublicMetaTest.php +++ b/tests/ObjectsFromJson/PublicMetaTest.php @@ -25,7 +25,7 @@ public function can_get_content(): void $result ); - $sut = PublicMeta::inRoot(parent::root(), '/deeper-page'); + $sut = PublicMeta::inRoot(parent::root(), '/l1-page'); $expected = 1.0; @@ -36,7 +36,7 @@ public function can_get_content(): void $result ); - $sut = PublicMeta::inRoot(parent::root(), '/deeper-page'); + $sut = PublicMeta::inRoot(parent::root(), '/l1-page'); $result = $sut->nonexistent(); diff --git a/tests/PlainText/PrivateJsonTest.php b/tests/PlainText/PrivateJsonTest.php index 382defe..e776534 100644 --- a/tests/PlainText/PrivateJsonTest.php +++ b/tests/PlainText/PrivateJsonTest.php @@ -48,7 +48,7 @@ public function can_get_content(): void $expected = ''; - $sut = PrivateJson::inRoot(parent::root(), '/deeper-page'); + $sut = PrivateJson::inRoot(parent::root(), '/l1-page'); $result = $sut->toString(); diff --git a/tests/PlainText/PublicContentTest.php b/tests/PlainText/PublicContentTest.php index 61d5d7a..3029cc6 100644 --- a/tests/PlainText/PublicContentTest.php +++ b/tests/PlainText/PublicContentTest.php @@ -30,7 +30,7 @@ public function can_get_content(): void $expected = ''; - $sut = PublicContent::inRoot(parent::root(), '/deeper-page'); + $sut = PublicContent::inRoot(parent::root(), '/l1-page'); $result = $sut->toString(); diff --git a/tests/PlainText/PublicJsonTest.php b/tests/PlainText/PublicJsonTest.php index c9dde0d..1575b58 100644 --- a/tests/PlainText/PublicJsonTest.php +++ b/tests/PlainText/PublicJsonTest.php @@ -43,7 +43,7 @@ public function can_get_content(): void $expected = ''; - $sut = PublicJson::inRoot(parent::root(), '/deeper-page'); + $sut = PublicJson::inRoot(parent::root(), '/l1-page'); $result = $sut->toString(); diff --git a/tests/SiteMapTest.php b/tests/SiteMapTest.php index 5db7f16..37ce3a7 100644 --- a/tests/SiteMapTest.php +++ b/tests/SiteMapTest.php @@ -29,7 +29,7 @@ public function can_skip_sitemap(): void $expected = << - http://ex.ample/deeper-page/2023-01-011http://ex.ample/0.5 + http://ex.ample/l1-page/2023-01-011http://ex.ample/0.5 xml; $result = (string) Sitemap::create( @@ -50,7 +50,7 @@ public function can_change_default_priority(): void { $expected = << - http://ex.ample/deeper-page/2023-01-011http://ex.ample/0.75 + http://ex.ample/l1-page/2023-01-011http://ex.ample/0.75 xml; $result = (string) Sitemap::create( @@ -71,7 +71,7 @@ public function is_expected_xml(): void { $expected = << - http://ex.ample/deeper-page/2023-01-011http://ex.ample/0.5 + http://ex.ample/l1-page/2023-01-011http://ex.ample/0.5 xml; $result = (string) Sitemap::create( diff --git a/tests/SiteTest.php b/tests/SiteTest.php index d39dd65..73120fd 100644 --- a/tests/SiteTest.php +++ b/tests/SiteTest.php @@ -41,7 +41,7 @@ public function has_titles(): void 'Root test content' ]; - $result = $this->site()->titles('/deeper-page'); + $result = $this->site()->titles('/l1-page'); $this->assertSame( $expected, From b224abb4ea8d673c4fae0f3f4987f8453ce601bb Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Sun, 17 Dec 2023 19:44:16 -0500 Subject: [PATCH 3/5] update: Page title for L1 page --- tests/PlainText/PublicMetaTest.php | 4 ++-- tests/SiteTest.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/PlainText/PublicMetaTest.php b/tests/PlainText/PublicMetaTest.php index af47ccd..ab32c3c 100644 --- a/tests/PlainText/PublicMetaTest.php +++ b/tests/PlainText/PublicMetaTest.php @@ -32,14 +32,14 @@ public function can_get_content(): void $expected = <<toString(); diff --git a/tests/SiteTest.php b/tests/SiteTest.php index 73120fd..94d7f31 100644 --- a/tests/SiteTest.php +++ b/tests/SiteTest.php @@ -37,7 +37,7 @@ public function has_public_content(): void public function has_titles(): void { $expected = [ - 'Deeper page', + 'L1 page', 'Root test content' ]; From 5a6a5634b3a96beedcdf6ade0dd2868e3e2ba3ec Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Sun, 17 Dec 2023 20:22:53 -0500 Subject: [PATCH 4/5] add: L2 page to test content --- tests/SiteMapTest.php | 6 +++--- tests/test-content/public/l1-page/l2-page/meta.json | 5 +++++ 2 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 tests/test-content/public/l1-page/l2-page/meta.json diff --git a/tests/SiteMapTest.php b/tests/SiteMapTest.php index 37ce3a7..2ba5314 100644 --- a/tests/SiteMapTest.php +++ b/tests/SiteMapTest.php @@ -29,7 +29,7 @@ public function can_skip_sitemap(): void $expected = << - http://ex.ample/l1-page/2023-01-011http://ex.ample/0.5 + http://ex.ample/l1-page/l2-page/2023-01-011http://ex.ample/l1-page/2023-01-011http://ex.ample/0.5 xml; $result = (string) Sitemap::create( @@ -50,7 +50,7 @@ public function can_change_default_priority(): void { $expected = << - http://ex.ample/l1-page/2023-01-011http://ex.ample/0.75 + http://ex.ample/l1-page/l2-page/2023-01-011http://ex.ample/l1-page/2023-01-011http://ex.ample/0.75 xml; $result = (string) Sitemap::create( @@ -71,7 +71,7 @@ public function is_expected_xml(): void { $expected = << - http://ex.ample/l1-page/2023-01-011http://ex.ample/0.5 + http://ex.ample/l1-page/l2-page/2023-01-011http://ex.ample/l1-page/2023-01-011http://ex.ample/0.5 xml; $result = (string) Sitemap::create( diff --git a/tests/test-content/public/l1-page/l2-page/meta.json b/tests/test-content/public/l1-page/l2-page/meta.json new file mode 100644 index 0000000..9f90a39 --- /dev/null +++ b/tests/test-content/public/l1-page/l2-page/meta.json @@ -0,0 +1,5 @@ +{ + "title": "L2 page", + "created": "20230101", + "priority": 1.0 +} From 5e8fae21d215ee66775ccff1ec4a99c1e66b61d9 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Sun, 17 Dec 2023 20:34:55 -0500 Subject: [PATCH 5/5] try: Symfony Finder sortByName --- tests/SiteMapTest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/SiteMapTest.php b/tests/SiteMapTest.php index 2ba5314..30ee8c2 100644 --- a/tests/SiteMapTest.php +++ b/tests/SiteMapTest.php @@ -16,6 +16,7 @@ class SiteMapTest extends TestCase private function allPublicMetaFiles(): Traversable { return (new SymfonyFinder())->files()->name('meta.json') + ->sortByName(true) ->in( parent::publicRoot()->toString() );