Add Joomla-aware development workflows and scripts
- Created extension packaging script - Added PHPStan configuration for static analysis - Added PHP_CodeSniffer configuration with Joomla standards - Created Codeception testing framework setup - Added PHP quality check workflow - Added Joomla testing workflow with multiple versions - Added staging deployment workflow - Created comprehensive documentation - Set up test directory structure with sample tests Co-authored-by: jmiller-moko <230051081+jmiller-moko@users.noreply.github.com>
This commit is contained in:
5
tests/_data/.gitkeep
Normal file
5
tests/_data/.gitkeep
Normal file
@@ -0,0 +1,5 @@
|
||||
# Test Data Directory
|
||||
|
||||
This directory contains test data files such as database dumps and fixtures.
|
||||
|
||||
Add your test data files here as needed.
|
||||
5
tests/_output/.gitkeep
Normal file
5
tests/_output/.gitkeep
Normal file
@@ -0,0 +1,5 @@
|
||||
# Test Output Directory
|
||||
|
||||
This directory contains test output files and reports generated by Codeception.
|
||||
|
||||
Files in this directory are ignored by git and should not be committed.
|
||||
15
tests/_support/AcceptanceHelper.php
Normal file
15
tests/_support/AcceptanceHelper.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Support;
|
||||
|
||||
/**
|
||||
* Acceptance test helper class
|
||||
*
|
||||
* Provides helper methods for acceptance testing
|
||||
*/
|
||||
class AcceptanceHelper extends \Codeception\Module
|
||||
{
|
||||
/**
|
||||
* Custom helper methods can be added here
|
||||
*/
|
||||
}
|
||||
15
tests/_support/UnitHelper.php
Normal file
15
tests/_support/UnitHelper.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Support;
|
||||
|
||||
/**
|
||||
* Unit test helper class
|
||||
*
|
||||
* Provides helper methods for unit testing
|
||||
*/
|
||||
class UnitHelper extends \Codeception\Module
|
||||
{
|
||||
/**
|
||||
* Custom helper methods can be added here
|
||||
*/
|
||||
}
|
||||
14
tests/acceptance.suite.yml
Normal file
14
tests/acceptance.suite.yml
Normal file
@@ -0,0 +1,14 @@
|
||||
# Codeception Test Suite Configuration
|
||||
|
||||
actor: AcceptanceTester
|
||||
modules:
|
||||
enabled:
|
||||
- WebDriver:
|
||||
url: http://localhost
|
||||
browser: chrome
|
||||
window_size: 1920x1080
|
||||
capabilities:
|
||||
chromeOptions:
|
||||
args: ["--headless", "--disable-gpu", "--no-sandbox"]
|
||||
- \Tests\Support\AcceptanceHelper
|
||||
step_decorators: ~
|
||||
23
tests/acceptance/TemplateInstallationCest.php
Normal file
23
tests/acceptance/TemplateInstallationCest.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Acceptance;
|
||||
|
||||
use Tests\Support\AcceptanceTester;
|
||||
|
||||
/**
|
||||
* Sample acceptance test for template installation
|
||||
*/
|
||||
class TemplateInstallationCest
|
||||
{
|
||||
/**
|
||||
* Test that template files exist
|
||||
*/
|
||||
public function checkTemplateFilesExist(AcceptanceTester $I)
|
||||
{
|
||||
$I->wantTo('verify template files are present');
|
||||
|
||||
// This is a placeholder test
|
||||
// Actual tests should be implemented based on your Joomla installation
|
||||
$I->assertTrue(true, 'Template structure test placeholder');
|
||||
}
|
||||
}
|
||||
8
tests/unit.suite.yml
Normal file
8
tests/unit.suite.yml
Normal file
@@ -0,0 +1,8 @@
|
||||
# Codeception Test Suite Configuration
|
||||
|
||||
actor: UnitTester
|
||||
modules:
|
||||
enabled:
|
||||
- Asserts
|
||||
- \Tests\Support\UnitHelper
|
||||
step_decorators: ~
|
||||
66
tests/unit/TemplateConfigurationTest.php
Normal file
66
tests/unit/TemplateConfigurationTest.php
Normal file
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Unit;
|
||||
|
||||
use Codeception\Test\Unit;
|
||||
use Tests\Support\UnitTester;
|
||||
|
||||
/**
|
||||
* Sample unit test for template functionality
|
||||
*/
|
||||
class TemplateConfigurationTest extends Unit
|
||||
{
|
||||
protected UnitTester $tester;
|
||||
|
||||
/**
|
||||
* Test that template has valid configuration structure
|
||||
*/
|
||||
public function testTemplateManifestExists()
|
||||
{
|
||||
$manifestPath = __DIR__ . '/../../src/templates/templateDetails.xml';
|
||||
|
||||
// Check if manifest file exists
|
||||
$this->assertFileExists(
|
||||
$manifestPath,
|
||||
'Template manifest file should exist'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test that manifest is valid XML
|
||||
*/
|
||||
public function testManifestIsValidXml()
|
||||
{
|
||||
$manifestPath = __DIR__ . '/../../src/templates/templateDetails.xml';
|
||||
|
||||
if (!file_exists($manifestPath)) {
|
||||
$this->markTestSkipped('Manifest file not found');
|
||||
}
|
||||
|
||||
$xml = @simplexml_load_file($manifestPath);
|
||||
|
||||
$this->assertNotFalse(
|
||||
$xml,
|
||||
'Template manifest should be valid XML'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test that template has required fields in manifest
|
||||
*/
|
||||
public function testManifestHasRequiredFields()
|
||||
{
|
||||
$manifestPath = __DIR__ . '/../../src/templates/templateDetails.xml';
|
||||
|
||||
if (!file_exists($manifestPath)) {
|
||||
$this->markTestSkipped('Manifest file not found');
|
||||
}
|
||||
|
||||
$xml = simplexml_load_file($manifestPath);
|
||||
|
||||
// Check for required elements
|
||||
$this->assertNotEmpty((string)$xml->name, 'Template should have a name');
|
||||
$this->assertNotEmpty((string)$xml->version, 'Template should have a version');
|
||||
$this->assertNotEmpty((string)$xml->author, 'Template should have an author');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user