PHP Classes

File: src/Tools/ModuleGeneratorEnhanced/tests/test-namespace.php

Recommend this page to a friend!
  Packages of Adrian M   upMVC   src/Tools/ModuleGeneratorEnhanced/tests/test-namespace.php   Download  
File: src/Tools/ModuleGeneratorEnhanced/tests/test-namespace.php
Role: Auxiliary script
Content type: text/plain
Description: Configuration script
Class: upMVC
Pure PHP web development without other frameworks
Author: By
Last change:
Date: 2 months ago
Size: 903 bytes
 

Contents

Class file image Download
<?php
/**
 * Test namespace generation for Enhanced Module Generator
 */

function testNamespaceGeneration($moduleName) {
   
$namespace = ucfirst(strtolower($moduleName));
    echo
"Module: '$moduleName' -> Namespace: '$namespace'\n";
}

echo
"Testing Enhanced Module Generator Namespace Convention:\n";
echo
"=======================================================\n";
testNamespaceGeneration('testitems');
testNamespaceGeneration('TestItems');
testNamespaceGeneration('TESTITEMS');
testNamespaceGeneration('anythingelse');
testNamespaceGeneration('AnythingElse');
testNamespaceGeneration('ANYTHINGELSE');
testNamespaceGeneration('camelCaseModule');
testNamespaceGeneration('snake_case_module');
echo
"=======================================================\n";
echo
"? All module names now generate consistent namespaces!\n";
echo
"? Convention: First letter capitalized, rest lowercase\n";