From 2a68da53c49f650b7c3ffdcc57abfcd830b82406 Mon Sep 17 00:00:00 2001 From: John Learn Date: Fri, 12 Jan 2024 09:26:46 -0500 Subject: [PATCH 01/12] begin update to ss5 --- composer.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 6b582fa..02a1eb5 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ }], "require": { "php": "^7.4||^8.0", - "silverstripe/cms": "^4.0" + "silverstripe/cms": "^4.0||^5.0" }, "extra": { "expose": [ @@ -25,9 +25,9 @@ }, "require-dev": { "phpunit/phpunit": "^9.5", - "silverstripe/sqlite3": "^2.2", - "logicbrush/metrics": "^0.2.0", - "cmrcx/phptidy": "^3.3" + "silverstripe/sqlite3": "*", + "logicbrush/metrics": "*", + "cmrcx/phptidy": "*" }, "autoload": { "psr-4": { From 733c13caf86575eeb80fc62c29b8f397fc7ba208 Mon Sep 17 00:00:00 2001 From: John Learn Date: Sat, 13 Jan 2024 09:27:03 -0500 Subject: [PATCH 02/12] ss5 fies --- src/Model/RollupPage.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Model/RollupPage.php b/src/Model/RollupPage.php index b0e5085..e9a7d10 100644 --- a/src/Model/RollupPage.php +++ b/src/Model/RollupPage.php @@ -59,6 +59,7 @@ public function getCMSFields() { $fields = parent::getCMSFields(); $fields->insertBefore( + 'Content', OptionsetField::create( 'ShowLinksOnly', 'Rollup Display', @@ -67,8 +68,7 @@ public function getCMSFields() { 2 => 'Show children in tabs', 1 => 'Show children as links', ] - ), - 'Content' ); + ) ); $contentField = $fields->dataFieldByName( 'Content' ); $contentField->setTitle( 'Introduction' ); From 186995f4d3ebb9cf40d7e9dcc930799e35c20afe Mon Sep 17 00:00:00 2001 From: John Learn Date: Wed, 25 Sep 2024 09:47:22 -0400 Subject: [PATCH 03/12] adding framework to matrix. --- .github/workflows/ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 73d94bf..b743bdf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,8 +11,6 @@ jobs: fail-fast: false matrix: include: - - operating-system: 'ubuntu-latest' - php-version: '8.2' - operating-system: 'ubuntu-latest' php-version: '8.1' - operating-system: 'ubuntu-latest' @@ -26,6 +24,7 @@ jobs: - uses: actions/checkout@v3 - uses: php-actions/composer@v6 with: + args: silverstripe/framework:^5.0 php_version: ${{ matrix.php-version }} php_extensions: intl - run: | From 577f517bb28ed18e50f6a9bd0aa2ad78aa8ba516 Mon Sep 17 00:00:00 2001 From: John Learn Date: Wed, 25 Sep 2024 12:40:01 -0400 Subject: [PATCH 04/12] ci fixes --- .github/workflows/ci.yml | 10 ++++++---- .github/workflows/t.yml | 2 ++ public/assets/.gitkeep | 0 3 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 public/assets/.gitkeep diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b743bdf..0927f16 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,8 +1,7 @@ name: "Continuous Integration" on: - - pull_request - - push + push: jobs: @@ -12,19 +11,22 @@ jobs: matrix: include: - operating-system: 'ubuntu-latest' + silverstripe-version: '5.0' php-version: '8.1' - operating-system: 'ubuntu-latest' + silverstripe-version: '4.0' php-version: '8.0' - operating-system: 'ubuntu-latest' + silverstripe-version: '4.0' php-version: '7.4' - name: PHP ${{ matrix.php-version }} + name: SS ${{ matrix.silverstripe-version }}, PHP ${{ matrix.php-version }} runs-on: ${{ matrix.operating-system }} steps: - uses: actions/checkout@v3 - uses: php-actions/composer@v6 with: - args: silverstripe/framework:^5.0 + command: update --with silverstripe/framework:^${{ matrix.silverstripe-version }} php_version: ${{ matrix.php-version }} php_extensions: intl - run: | diff --git a/.github/workflows/t.yml b/.github/workflows/t.yml index eb31e9a..87fa1a2 100644 --- a/.github/workflows/t.yml +++ b/.github/workflows/t.yml @@ -15,6 +15,8 @@ jobs: - uses: actions/checkout@v3 - uses: php-actions/composer@v6 with: + command: update --with silverstripe/framework:^5.0 + php_version: 8.1 php_extensions: xdebug intl - name: Generate Code Coverage run: | diff --git a/public/assets/.gitkeep b/public/assets/.gitkeep new file mode 100644 index 0000000..e69de29 From 482c56531abe57a43ec809e9bf3470a150b9f769 Mon Sep 17 00:00:00 2001 From: John Learn Date: Wed, 25 Sep 2024 12:41:22 -0400 Subject: [PATCH 05/12] fix tests --- tests/unit/Model/RollupPageTest.php | 36 ++++++++++++++--------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/tests/unit/Model/RollupPageTest.php b/tests/unit/Model/RollupPageTest.php index 176663e..75d2133 100644 --- a/tests/unit/Model/RollupPageTest.php +++ b/tests/unit/Model/RollupPageTest.php @@ -46,7 +46,7 @@ public function testChildren() { $rollupPage = RollupPage::create(); $rollupPage->ShowLinksOnly = 1; $rollupPage->write(); - $rollupPage->publish( 'Stage', 'Live' ); + $rollupPage->publishSingle(); $this->assertEquals( 0, $rollupPage->Children()->count() ); @@ -54,37 +54,37 @@ public function testChildren() { $page1->Content = '

Page 1

'; $page1->ParentID = $rollupPage->ID; $page1->write(); - $page1->publish( 'Stage', 'Live' ); + $page1->publishSingle(); $page2 = Page::create(); $page2->Content = ''; $page2->ParentID = $rollupPage->ID; $page2->write(); - $page2->publish( 'Stage', 'Live' ); + $page2->publishSingle(); $rollupPage->write(); - $rollupPage->publish( 'Stage', 'Live' ); + $rollupPage->publishSingle(); $this->assertEquals( 1, $rollupPage->Children()->count() ); $page2->Content = '

Page 2

'; $page2->write(); - $page2->publish( 'Stage', 'Live' ); + $page2->publishSingle(); $rollupPage->write(); - $rollupPage->publish( 'Stage', 'Live' ); + $rollupPage->publishSingle(); $this->assertEquals( 2, $rollupPage->Children()->count() ); $rollupPage->ShowLinksOnly = 2; $rollupPage->write(); - $rollupPage->publish( 'Stage', 'Live' ); + $rollupPage->publishSingle(); $this->assertEquals( 0, $rollupPage->Children()->count() ); $rollupPage->ShowLinksOnly = 0; $rollupPage->write(); - $rollupPage->publish( 'Stage', 'Live' ); + $rollupPage->publishSingle(); $this->assertEquals( 0, $rollupPage->Children()->count() ); } @@ -120,7 +120,7 @@ public function testContent() { $rollupPage->Title = 'Rollup Page'; $rollupPage->ShowLinksOnly = 0; $rollupPage->write(); - $rollupPage->publish( 'Stage', 'Live' ); + $rollupPage->publishSingle(); $page1 = Page::create(); @@ -128,14 +128,14 @@ public function testContent() { $page1->Content = '

Page 1 content

'; $page1->ParentID = $rollupPage->ID; $page1->write(); - $page1->publish( 'Stage', 'Live' ); + $page1->publishSingle(); $page2 = FakePage::create(); $page2->Title = 'Page 2'; $page2->Content = '

Page 2 content

'; $page2->ParentID = $rollupPage->ID; $page2->write(); - $page2->publish( 'Stage', 'Live' ); + $page2->publishSingle(); $this->assertStringContainsString( '

Page 1 content

', $rollupPage->Content() ); $this->assertStringContainsString( '

Page 2 content

', $rollupPage->Content() ); @@ -145,13 +145,13 @@ public function testContent() { $rollupPage->ShowLinksOnly = 1; $rollupPage->write(); - $rollupPage->publish( 'Stage', 'Live' ); + $rollupPage->publishSingle(); $page1->write(); - $page1->publish( 'Stage', 'Live' ); + $page1->publishSingle(); $page2->write(); - $page2->publish( 'Stage', 'Live' ); + $page2->publishSingle(); $this->assertStringNotContainsString( '

Page 1 content

', $rollupPage->Content() ); $this->assertStringContainsString( '