feat: VivesPOS landing on Winter CMS 1.2 — theme + plugin + Dockerfile
Some checks are pending
Module sub-split / Sub-split (push) Waiting to run
Some checks are pending
Module sub-split / Sub-split (push) Waiting to run
- Base: wintercms/winter branch 1.2 (full framework) - Theme vivespos: Canvas 7 + Bootstrap 5 CDN, custom CSS - Layout: deferred GTM/GA4 tracking, JSON-LD SoftwareApplication - Partials: hero (offline-first), features, modes (offline/nube toggle), screenshots, pricing (3 planes), comparison, FAQ, CTA - Plugin VivesPOS.Site with ContactForm - Dockerfile: PHP 8.2 Apache, port 80, healthcheck - Added winter/wn-pages, blog, sitemap, seo plugins - Active theme set to vivespos
This commit is contained in:
122
modules/cms/tests/classes/CmsObjectQueryTest.php
Normal file
122
modules/cms/tests/classes/CmsObjectQueryTest.php
Normal file
@@ -0,0 +1,122 @@
|
||||
<?php
|
||||
|
||||
namespace Cms\Tests\Classes;
|
||||
|
||||
use System\Tests\Bootstrap\TestCase;
|
||||
use Cms\Classes\Layout;
|
||||
use Cms\Classes\Page;
|
||||
use Winter\Storm\Halcyon\Model;
|
||||
|
||||
class CmsObjectQueryTest extends TestCase
|
||||
{
|
||||
public function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
Model::clearBootedModels();
|
||||
Model::flushEventListeners();
|
||||
}
|
||||
|
||||
public function testWhere()
|
||||
{
|
||||
$page = Page::where('layout', 'caramba')->first();
|
||||
$this->assertEquals('/no-layout', $page->url);
|
||||
}
|
||||
|
||||
public function testWhereComponent()
|
||||
{
|
||||
$pages = Page::whereComponent('testArchive', 'posts-per-page', '6');
|
||||
$this->assertCount(1, $pages->all());
|
||||
|
||||
$page = $pages->first();
|
||||
$this->assertEquals('/with-components', $page->url);
|
||||
}
|
||||
|
||||
public function testWithComponent()
|
||||
{
|
||||
$pages = Page::withComponent('testArchive')->all();
|
||||
$this->assertCount(2, $pages);
|
||||
foreach ($pages as $page) {
|
||||
$this->assertTrue(!!$page->hasComponent('testArchive'));
|
||||
}
|
||||
}
|
||||
|
||||
public function testWithComponentCallback()
|
||||
{
|
||||
include_once base_path() . '/modules/system/tests/fixtures/plugins/winter/tester/components/Archive.php';
|
||||
|
||||
$pages = Page::withComponent('testArchive', function ($component) {
|
||||
return $component->property('posts-per-page') == '69';
|
||||
})->all();
|
||||
|
||||
$this->assertCount(1, $pages);
|
||||
}
|
||||
|
||||
public function testLists()
|
||||
{
|
||||
// Default theme: test
|
||||
$pages = Page::lists('baseFileName');
|
||||
sort($pages);
|
||||
|
||||
$this->assertEquals([
|
||||
"404",
|
||||
"a/a-page",
|
||||
"ajax-test",
|
||||
"authors",
|
||||
"b/b-page",
|
||||
"blog-archive",
|
||||
"blog-category",
|
||||
"blog-post",
|
||||
"code-namespaces",
|
||||
"code-namespaces-aliases",
|
||||
"component-custom-render",
|
||||
"component-partial",
|
||||
"component-partial-alias-override",
|
||||
"component-partial-nesting",
|
||||
"component-partial-override",
|
||||
"cycle-test",
|
||||
"filters-test",
|
||||
"index",
|
||||
"no-component",
|
||||
"no-component-class",
|
||||
"no-layout",
|
||||
"no-partial",
|
||||
"no-soft-component-class",
|
||||
"optional-full-php-tags",
|
||||
"optional-short-php-tags",
|
||||
"shared-variable",
|
||||
"shared-variable-override",
|
||||
"throw-php",
|
||||
"with-component",
|
||||
"with-components",
|
||||
"with-content",
|
||||
"with-layout",
|
||||
"with-macro",
|
||||
"with-partials",
|
||||
"with-placeholder",
|
||||
"with-soft-component-class",
|
||||
"with-soft-component-class-alias",
|
||||
], $pages);
|
||||
|
||||
$layouts = Layout::lists('baseFileName');
|
||||
sort($layouts);
|
||||
|
||||
$this->assertEquals([
|
||||
"a/a-layout",
|
||||
"ajax-test",
|
||||
"content",
|
||||
"cycle-test",
|
||||
"no-php",
|
||||
"partials",
|
||||
"php-parser-test",
|
||||
"placeholder",
|
||||
"sidebar",
|
||||
], $layouts);
|
||||
}
|
||||
|
||||
public function testListsNonExistentTheme()
|
||||
{
|
||||
$pages = Page::inTheme('NON_EXISTENT_THEME')->lists('baseFileName');
|
||||
$this->assertEmpty($pages);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user