schema + cs fix
Some checks failed
CI / testsuite (mysql, 8.2, ) (push) Failing after 4m10s
CI / testsuite (mysql, 8.4, ) (push) Failing after 6m50s
CI / testsuite (pgsql, 8.2, ) (push) Failing after 3m38s
CI / testsuite (sqlite, 8.2, ) (push) Failing after 3m44s
CI / testsuite (pgsql, 8.4, ) (push) Failing after 6m14s
CI / testsuite (sqlite, 8.2, prefer-lowest) (push) Failing after 3m56s
CI / testsuite (sqlite, 8.4, ) (push) Failing after 5m17s
CI / Coding Standard & Static Analysis (push) Successful in 3m6s

This commit is contained in:
2026-03-20 21:54:16 -07:00
2 changed files with 46 additions and 3 deletions

View File

@@ -5,15 +5,14 @@ namespace CheeseCake\View\Helper;
use Cake\Routing\Router; use Cake\Routing\Router;
use Cake\View\Helper; use Cake\View\Helper;
use Cake\View\Helper\HtmlHelper;
/** /**
* ActiveLink helper * ActiveLink helper
* *
* @property HtmlHelper $Html * @property \Cake\View\Helper\HtmlHelper $Html
*/ */
class ActiveLinkHelper extends Helper { class ActiveLinkHelper extends Helper {
/** /**
* Default configuration. * Default configuration.
* *

44
tests/schema.php Normal file
View File

@@ -0,0 +1,44 @@
<?php
/**
* Based entirely off of dereuromark's plugins as I was having trouble getting fixtures to load
* after moving the plugins outside of an existing cakephp app's plugins folder
*
* @link https://github.com/dereuromark/cakephp-tools/blob/master/tests/schema.php
*/
use Cake\Utility\Inflector;
$tables = [];
/**
* @var \DirectoryIterator<\DirectoryIterator> $iterator
*/
$iterator = new DirectoryIterator(__DIR__ . DS . 'Fixture');
foreach ($iterator as $file) {
if (!preg_match('/(\w+)Fixture.php$/', (string)$file, $matches)) {
continue;
}
$name = $matches[1];
$tableName = Inflector::underscore($name);
$class = 'CheeseCake\\Test\\Fixture\\' . $name . 'Fixture';
try {
$object = (new ReflectionClass($class))->getProperty('fields');
} catch (ReflectionException $e) {
continue;
}
$array = $object->getDefaultValue();
$constraints = $array['_constraints'] ?? [];
$indexes = $array['_indexes'] ?? [];
unset($array['_constraints'], $array['_indexes'], $array['_options']);
$table = [
'table' => $tableName,
'columns' => $array,
'constraints' => $constraints,
'indexes' => $indexes,
];
$tables[$tableName] = $table;
}
return $tables;