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:
13
modules/system/console/scaffold/test/pest.class.stub
Normal file
13
modules/system/console/scaffold/test/pest.class.stub
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
use {{ tested_class_full }};
|
||||
|
||||
beforeEach(function () {
|
||||
$this->instance = $this->app->make({{ tested_class }}::class);
|
||||
});
|
||||
|
||||
{% for method in public_methods %}
|
||||
it('the {{ method }} method does something', function () {
|
||||
// $this->assertTrue(method_exists($this->instance, '{{ method }}'));
|
||||
});
|
||||
{% endfor %}
|
||||
45
modules/system/console/scaffold/test/pest.init.stub
Normal file
45
modules/system/console/scaffold/test/pest.init.stub
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Test Case
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The closure you provide to your test functions is always bound to a specific PHPUnit test
|
||||
| case class. By default, that class is "PHPUnit\Framework\TestCase". Of course, you may
|
||||
| need to change it using the "uses()" function to bind a different classes or traits.
|
||||
|
|
||||
*/
|
||||
|
||||
uses(\System\Tests\Bootstrap\TestCase::class)->in('Feature');
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Expectations
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When you're writing tests, you often need to check that values meet certain conditions. The
|
||||
| "expect()" function gives you access to a set of "expectations" methods that you can use
|
||||
| to assert different things. Of course, you may extend the Expectation API at any time.
|
||||
|
|
||||
*/
|
||||
|
||||
// expect()->extend('toBeOne', function () {
|
||||
// return $this->toBe(1);
|
||||
// });
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Functions
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| While Pest is very powerful out-of-the-box, you may have some testing code specific to your
|
||||
| project that you don't want to repeat in every file. Here you can also expose helpers as
|
||||
| global functions to help you to reduce the number of lines of code in your test files.
|
||||
|
|
||||
*/
|
||||
|
||||
// function something()
|
||||
// {
|
||||
// // ..
|
||||
// }
|
||||
7
modules/system/console/scaffold/test/pest.stub
Normal file
7
modules/system/console/scaffold/test/pest.stub
Normal file
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
test('example', function () {
|
||||
$response = $this->get('/');
|
||||
|
||||
$response->assertStatus(200);
|
||||
});
|
||||
5
modules/system/console/scaffold/test/pest.unit.stub
Normal file
5
modules/system/console/scaffold/test/pest.unit.stub
Normal file
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
test('example', function () {
|
||||
expect(true)->toBeTrue();
|
||||
});
|
||||
25
modules/system/console/scaffold/test/phpunit.stub
Normal file
25
modules/system/console/scaffold/test/phpunit.stub
Normal file
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<phpunit backupGlobals="false"
|
||||
backupStaticAttributes="false"
|
||||
bootstrap="../../../modules/system/tests/bootstrap/app.php"
|
||||
colors="true"
|
||||
convertErrorsToExceptions="true"
|
||||
convertNoticesToExceptions="true"
|
||||
convertWarningsToExceptions="true"
|
||||
processIsolation="false"
|
||||
stopOnFailure="false"
|
||||
>
|
||||
<testsuites>
|
||||
<testsuite name="Unit">
|
||||
<directory>./tests/Unit</directory>
|
||||
</testsuite>
|
||||
<testsuite name="Feature">
|
||||
<directory>./tests/Feature</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
<php>
|
||||
<env name="APP_ENV" value="testing"/>
|
||||
<env name="CACHE_DRIVER" value="array"/>
|
||||
<env name="SESSION_DRIVER" value="array"/>
|
||||
</php>
|
||||
</phpunit>
|
||||
34
modules/system/console/scaffold/test/test.class.stub
Normal file
34
modules/system/console/scaffold/test/test.class.stub
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace {{ test_namespace }};
|
||||
|
||||
use {{ tested_class_full }};
|
||||
use System\Tests\Bootstrap\TestCase as WinterTestCase;
|
||||
|
||||
class {{ test_class }} extends WinterTestCase
|
||||
{
|
||||
/**
|
||||
* An instance of the class being tested
|
||||
*/
|
||||
protected ?{{ tested_class }} $instance = null;
|
||||
|
||||
/**
|
||||
* Initialize the {{ tested_class }}
|
||||
*/
|
||||
public function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
$this->instance = $this->app->make({{ tested_class }}::class);
|
||||
}
|
||||
{% for method in public_methods %}
|
||||
|
||||
/**
|
||||
* Test for the {{ method }} method
|
||||
*/
|
||||
public function test_{{ method }}()
|
||||
{
|
||||
$this->assertTrue(method_exists($this->instance, '{{ method }}'));
|
||||
}
|
||||
{% endfor %}
|
||||
}
|
||||
37
modules/system/console/scaffold/test/test.plugin.stub
Normal file
37
modules/system/console/scaffold/test/test.plugin.stub
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace {{ plugin_namespace }}\Tests\Unit;
|
||||
|
||||
use {{ plugin_namespace }}\Plugin;
|
||||
use System\Classes\PluginBase;
|
||||
use System\Tests\Bootstrap\PluginTestCase;
|
||||
|
||||
class PluginTest extends PluginTestCase
|
||||
{
|
||||
protected PluginBase $plugin;
|
||||
|
||||
public function setUp(): void
|
||||
{
|
||||
$this->plugin = new Plugin($this->createApplication());
|
||||
}
|
||||
|
||||
public function testPluginDetails()
|
||||
{
|
||||
$details = $this->plugin->pluginDetails();
|
||||
|
||||
$this->assertIsArray($details);
|
||||
$this->assertArrayHasKey('name', $details);
|
||||
$this->assertArrayHasKey('description', $details);
|
||||
$this->assertArrayHasKey('icon', $details);
|
||||
$this->assertArrayHasKey('author', $details);
|
||||
|
||||
$this->assertEquals('{{ author }}', $details['author']);
|
||||
}
|
||||
|
||||
public function testRegisterPermissions()
|
||||
{
|
||||
$permissions = $this->plugin->registerPermissions();
|
||||
|
||||
$this->assertIsArray($permissions);
|
||||
}
|
||||
}
|
||||
18
modules/system/console/scaffold/test/test.stub
Normal file
18
modules/system/console/scaffold/test/test.stub
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace {{ test_namespace }};
|
||||
|
||||
use System\Tests\Bootstrap\PluginTestCase;
|
||||
|
||||
class {{ test_class }} extends PluginTestCase
|
||||
{
|
||||
/**
|
||||
* A basic feature test example.
|
||||
*/
|
||||
public function test_example(): void
|
||||
{
|
||||
$response = $this->get('/');
|
||||
|
||||
$response->assertStatus(200);
|
||||
}
|
||||
}
|
||||
16
modules/system/console/scaffold/test/test.unit.stub
Normal file
16
modules/system/console/scaffold/test/test.unit.stub
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace {{ test_namespace }};
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class {{ test_class }} extends TestCase
|
||||
{
|
||||
/**
|
||||
* A basic unit test example.
|
||||
*/
|
||||
public function test_example(): void
|
||||
{
|
||||
$this->assertTrue(true);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user