git-clean in E107Base now runs first in _beforeSuite() so that tainted
files are not uploaded in Acceptance tests
E107Base::revokeLocalE107Config() now checks for file existence before
unlinking. XXX: Could remove this method if cleanVCS() proves reliable
Acceptance won't try to write an e107_config.php because the tests
themselves populate the configuration file
Apparently, reconfiguring only applies to one test. This commit makes
all tests' modules reconfigured.
Introduced command to clean local app repo
InstallCest actually installs e107 now
Ideal for pulls and users who have not uploaded their SSH public key to
their GitHub account
Bit more of a hassle to those who code for e107 and normally push with
their SSH public key
Fixes: #2
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