e_tree_model::prepareSimulatedPagination() did not correctly handle the
count-only condition because of an incorrectly written emptiness check.
Fixes: #3034
f080402675 only works when a Deployer is
active, but local developers would not be using a Deployer.
For some reason (still unknown), the Codeception framework doesn't
execute _beforeSuite() for all the active modules, so \Helper\Base has
been coded to pick up the slack.
Actually fixes: #1
e107 is now ready for fully automated testing on all three test suites:
* Acceptance
* Functional
* Unit
New features:
* cPanelDeployer adds a cPanel Remote MySQL access host
* e107 database dump importer
* Unit tests now load e107
Fixes:
* Test prefixes now only use characters valid for MySQL/MariaDB without
escaping
* Refactored a bunch of things
* All existing tests pass now
Changes:
* Deployers now provided by \Helper\DeployerFactory
* Added Twig templating for generating e107_config.php for testing
* cPanelDeployer now outputs to codecept_debug()
This is the least intrusive solution I could come up with.
Anything else I tried to reduce technical debt would break the very
tangled dependency web, so I settled for this.
Fixes: #3033
Refactored by extracting code common to all suites to \Helper\Base
New \Helper\DelayedDb helper to delay initialization so that a new DSN,
username, and password can be loaded in dynamically for automatic
database provisioning. Should still be compatible with manual database
information in codeception.yml
Subclasses may forget to run code to do a total record count, which
leads to output showing "Total Records: 0" on some pages with lists,
like `/e107_admin/links.php`.
This commit cuts out the record counting from the getList() method of
any e_admin_form_ui subclasses and the base class so that subclasses do
not have to reimplement record counting.
The caveat with this implementation is that it violates the Law of
Demeter, as evidenced by the new chained method call:
$this->getController()->getTreeModel()->getTotal()
Jumping through two objects to get a value is not ideal, but this is the
code we have to work with at the moment.
In #3025, e_tree_model sorting was reimplemented in pure PHP, but this
broke custom sorting (like `?field=cat_name&asc=desc`).
This commit introduces a hack that simulates a subset of MySQL/MariaDB
ORDER BY clauses, which should be sufficient for all known custom
sorting that can be requested.
Tree formatting is always preserved, but custom sorting will apply for
all items at a certain depth under the same parent.
This commit also contains some minor formatting fixes and makes a minor
change to some regex to make use of non-capturing groups.
Fixes: #3029
This is a workaround to make the output of xmlClass::xml2array() in PHP
7.2 equal to that of prior PHP versions.
Consider this fix to be a part 2 of #3026.
PHP 7.2 changed the behavior of how we extract tags from
SimpleXMLElement resources. This hack adds a toleration for either the
PHP 7.2 behavior and the past behavior, which allows consistent parsing
of XML files.
One side effect of this change is the fixing of an innocuous bug that
provided blank values in some "@value" keys that should not have existed
in the first place. This should hopefully have no practical effect on
current uses of the modified method.
Fixes: #3027
Since PHP 7.2, running get_object_vars() on a SimpleXMLElement object
may return sequential arrays rather than nothing if there were no
children.
This commit introduces a sanity check in xmlClass::xml2array() that
ensures child tags are processed rather than sequential array keys.
This sanity check does not affect past major versions of PHP.
Fixes: #3018
Supersedes: #3019
Implementation parses db_query parameter and extracts the offset and/or
count from `LIMIT {offset} OFFSET {count}` or syntactically similar
Fixes: #3015
Supersedes: #3016